| | |
| | | :data="treeData" :props="defaultProps"> |
| | | </el-tree-select> |
| | | </template> |
| | | <template #drawingNo="{}"> |
| | | <el-autocomplete v-model="attachForm.drawingNo" |
| | | :fetch-suggestions="querySearchAsync" |
| | | :trigger-on-focus="false" @select="handleSelect" |
| | | > |
| | | </el-autocomplete> |
| | | </template> |
| | | </avue-form> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getQueryString, |
| | | } from '@/utils/util'; |
| | | |
| | | export default { |
| | | watch: { |
| | |
| | | disabled: (data) => data.nodeType!=='machine',//仅机床节点可选 |
| | | isLeaf: (data) => !data.hasChildren |
| | | }, |
| | | timeout:0, //零件号加载的timeout |
| | | machineCodeList: [], |
| | | attachOption: { |
| | | labelWidth: 160, |
| | |
| | | }, |
| | | }, |
| | | { |
| | | label: '图号版次', |
| | | label: '图纸版次', |
| | | prop: 'drawingNoEdition', |
| | | type: 'input', |
| | | span: 12, |
| | |
| | | dataType: 'string', |
| | | rules: [{ required: true, message: '必填', trigger: 'blur' }], |
| | | }, |
| | | |
| | | { |
| | | label: '主管工艺', |
| | | prop: 'producePlanId', |
| | | type: 'select',//column 12 |
| | | remote: true, |
| | | placeholder:'无法匹配人员职责表时请选择主管工艺', |
| | | dicUrl: `/blade-mdm/producedivision/select-programmer?programmer={{key}}`, |
| | | dicFormatter:(res)=>{ |
| | | return res.data.map(obj => { |
| | | let item = new Object(); |
| | | item.value = obj.id; |
| | | item.label = obj.programmerName; |
| | | item.desc = `专业组长:${obj.teamLeaderName},校对:${obj.checkerName},审核:${obj.seniorName}` |
| | | return item; |
| | | }); ; |
| | | }, |
| | | span: 12, |
| | | dataType: 'string', |
| | | }, |
| | | { |
| | | type:'hidden', |
| | | prop:'isTempFlow', |
| | |
| | | // 如果既不是machine节点也没有子节点,直接返回原节点 |
| | | return node; |
| | | }, |
| | | querySearchAsync(query, cb) {//零组件号搜索建议 |
| | | |
| | | axios({ |
| | | url: '/blade-mdm/producedivision/select-data', |
| | | method: 'get', |
| | | params: {drawingNo: query}, |
| | | }).then( |
| | | res => { |
| | | if(res.data.code == 200){ |
| | | let list = res.data.data; |
| | | for(let i of list){ |
| | | i.value = i.ljh; |
| | | } |
| | | |
| | | clearTimeout(this.timeout) |
| | | this.timeout = setTimeout(() => { |
| | | cb(list); |
| | | }, 1000) |
| | | |
| | | } |
| | | }, |
| | | error => { |
| | | console.log(error); |
| | | } |
| | | ); |
| | | |
| | | }, |
| | | handleSelect(item) { |
| | | this.attachForm.productModel = item.cph; |
| | | }, |
| | | handleTrim(col){ |
| | | //console.log(col) |
| | | let value = this.attachForm[col.column.prop]; |
| | |
| | | form.machineMode = item.name; |
| | | } |
| | | }) |
| | | if(this.attachForm.producePlanId){ |
| | | //手动指定了人员职责表id,不用继续从服务端验证 |
| | | this.startDispatch(form,done); |
| | | }else{ |
| | | axios({ |
| | | url: '/blade-mdm/producedivision/select-by-drawingno', |
| | | method: 'get', |
| | | params: {drawingNo:this.attachForm.drawingNo}, |
| | | }).then( |
| | | res => { |
| | | |
| | | if(res.data.code == 200){ |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | |
| | | this.attachForm.producePlanId = res.data.data.id; |
| | | |
| | | console.log('planid',this.attachForm.productPlanId) |
| | | this.startDispatch(form,done); |
| | | }else{ |
| | | |
| | | |
| | | this.$alert(res.data.msg+".重新输入或者手动选择主管工艺。", '发起任务失败',{type:'error',confirmButtonText:'关闭'}); |
| | | } |
| | | done(); |
| | | }, |
| | | error => { |
| | | console.log(error); |
| | | done(); |
| | | } |
| | | ); |
| | | } |
| | | |
| | | }, |
| | | |
| | | startDispatch(form,done){ |
| | | axios({ |
| | | url: '/blade-mdm/flow/dispatch/start', |
| | | method: 'post', |
| | | data: form, |
| | | }).then( |
| | | res => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | this.$refs.form.resetForm(); |
| | | this.attachForm = this.defaultForm; |
| | | if(res.data.code == 200){ |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | this.$refs.form.resetForm(); |
| | | this.attachForm = this.defaultForm; |
| | | |
| | | }else{ |
| | | this.$alert(res.data.msg, '发起任务失败',{type:'error',confirmButtonText:'关闭'}); |
| | | } |
| | | done(); |
| | | }, |
| | | error => { |