|
|
@@ -128,7 +128,7 @@
|
|
|
:props="{children: 'children',label: 'label', value: 'value'}"
|
|
|
style="border: 1px solid #ececec; padding: 10px;height: 400px;overflow: auto;"
|
|
|
node-key="value"
|
|
|
- :default-expanded-keys="['编号']"
|
|
|
+ :default-expanded-keys="form['车间名称']"
|
|
|
>
|
|
|
</el-tree>
|
|
|
</el-dialog>
|
|
|
@@ -137,7 +137,8 @@
|
|
|
|
|
|
<script setup>
|
|
|
import {ref, reactive} from 'vue'
|
|
|
-import {gdzl_MachineList, PrintDetailList, WastageList,getDepartName, capacityList} from "@/api/yunyin/yunying";
|
|
|
+import {gdzl_MachineList, PrintDetailList, WastageList,getDepartName, capacityList,
|
|
|
+} from "@/api/yunyin/yunying";
|
|
|
|
|
|
const form = reactive({})
|
|
|
const visible = ref(false)
|
|
|
@@ -158,7 +159,7 @@ const cjList = ref([
|
|
|
const gdzl_MachineList_address = ref()
|
|
|
|
|
|
//新增工艺资料弹窗 键盘 input框跳转
|
|
|
-const add_gyzlent = (event,id1,id2,id3) => {
|
|
|
+const add_gyzlent = async (event,id1,id2,id3) => {
|
|
|
if (id2==='印件编号' && event.key==='Tab' || id2 === '印件编号' && event.key=== 'Enter') {
|
|
|
const node = yjList.value.find(item => item.no ===form['yjno'])
|
|
|
if (! node) {
|
|
|
@@ -170,9 +171,9 @@ const add_gyzlent = (event,id1,id2,id3) => {
|
|
|
document.getElementById(id3).focus()
|
|
|
cjdisplay.value = true
|
|
|
}
|
|
|
- if (id2 === '工序损耗' && event.key==='Tab' || id2 === '工序损耗' && event.key=== 'Enter') {
|
|
|
- if(form['车间名称']){
|
|
|
- gxshList();
|
|
|
+ if (id2 === '工序损耗' && event.key==='Tab' || id2 === '工序损耗' && event.key=== 'Enter' && form['车间名称']) {
|
|
|
+ await getGxshList();
|
|
|
+ if (gxshList.value[0].children.length > 1) {
|
|
|
gxshdisplay.value = true
|
|
|
}
|
|
|
}
|
|
|
@@ -218,14 +219,29 @@ const open = async (gdbh, gxlist) => {
|
|
|
}
|
|
|
|
|
|
//工序损耗列表
|
|
|
-const gxshList = async ()=>{
|
|
|
+const gxshList = ref([])
|
|
|
+const getGxshList = async ()=>{
|
|
|
const WastageList_data = await WastageList({search: form['车间名称']})
|
|
|
- console.log(WastageList_data)
|
|
|
+ gxshList.value = [{
|
|
|
+ label: form['车间名称'],
|
|
|
+ value: form['车间名称'],
|
|
|
+ children: []
|
|
|
+ }]
|
|
|
+ if (WastageList_data.data.length === 0) return
|
|
|
+ if (WastageList_data.data.length > 1) {
|
|
|
+ gxshList.value[0].children = WastageList_data.data.map(item => {
|
|
|
+ return { label: `${item.编号} - ${item.名称}`, label2: item.名称, UniqId: item.UniqId, value: item.编号 }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ form['shdh'] = WastageList_data.data[0].编号;
|
|
|
+ form['工序损耗名称'] = WastageList_data.data[0].名称;
|
|
|
+ }
|
|
|
}
|
|
|
//点击工序损耗列表数据
|
|
|
const gxshselectHandle = async (node)=>{
|
|
|
- console.log(node)
|
|
|
- console.log(1232131)
|
|
|
+ form['shdh'] = node.value
|
|
|
+ form['工序损耗名称'] = node.label2
|
|
|
+ gxshdisplay.value = false
|
|
|
}
|
|
|
const selectHandle = async (node)=>{
|
|
|
if (node.children && node.children.length> 0) return
|
|
|
@@ -255,10 +271,10 @@ const selectHandle = async (node)=>{
|
|
|
//通过车间名称查询机台
|
|
|
const MachineList_jitai = await gdzl_MachineList({address:form['车间名称']});
|
|
|
gdzl_MachineList_address.value = MachineList_jitai.data;
|
|
|
+ form['shdh'] = ''
|
|
|
+ form['工序损耗名称'] = ''
|
|
|
//通过车间名称查询工序损耗
|
|
|
- const WastageList_data = await WastageList({search:form['车间名称']});
|
|
|
- console.log(WastageList_data.data)
|
|
|
-
|
|
|
+ await getGxshList()
|
|
|
cjdisplay.value = false
|
|
|
}
|
|
|
|