From b311b3cfee0a4635c236eea6c5870d805a29a160 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期一, 22 九月 2025 13:09:31 +0800
Subject: [PATCH] 优化导出工控网
---
src/views/flowmgr/taskassign.vue | 235 ++++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 184 insertions(+), 51 deletions(-)
diff --git a/src/views/flowmgr/taskassign.vue b/src/views/flowmgr/taskassign.vue
index 7eb5bc5..2c27e8c 100644
--- a/src/views/flowmgr/taskassign.vue
+++ b/src/views/flowmgr/taskassign.vue
@@ -8,27 +8,45 @@
-->
<template>
<basic-container>
- <avue-form ref="form" :option="attachOption" v-model="attachForm" @submit="formSubmit">
+ <avue-form ref="form" :option="attachOption" v-model="attachForm" @submit="formSubmit"><!-- -->
<template #machineCode="{}">
<el-tree-select ref="tree" filterable v-model="attachForm.machineCode"
node-key="machineCode"
:data="treeData" :props="defaultProps">
</el-tree-select>
</template>
+ <template #drawingNo="{}">
+ <el-autocomplete v-model="attachForm.drawingNo"
+ :trigger-on-focus="false" :fetch-suggestions="querySearchAsync"
+ @select="handleSelect"
+ >
+ <!--
+ <template solt="input" slot-scope="{$attrs}">
+ <input type="hidden" :disabled="true" :value="$refs.input.value"/>
+ </template>-->
+ </el-autocomplete>
+ </template>
+ <!--
+ <template #programmer="{}">
+ <el-autocomplete ref="autoProgrammer" :disabled="drawingNoMatch" v-model="attachForm.programmer"
+ :fetch-suggestions="queryProgrammerAsync"
+ :trigger-on-focus="false" @select="handleProgrammerSelect"
+ >
+ </el-autocomplete>
+ </template>
+-->
</avue-form>
</basic-container>
</template>
<script>
-import {
- getQueryString,
-} from '@/utils/util';
-
export default {
watch: {
'attachForm.drawingNo': function (val) {
if(val && this.attachForm.processNo && this.attachForm.processEdition) {
this.attachForm.title = `${val}-${this.attachForm.processNo}-${this.attachForm.processEdition}-璁″垝浠诲姟`;
+
+
}
},
'attachForm.processNo': function (val) {
@@ -45,10 +63,6 @@
},
},
data() {
-
- //var isTempFlow = getQueryString("isTempFlow");
- //isTempFlow = isTempFlow === 'Y'?'Y':'N';
-
var that = this;
return {
form: {},
@@ -60,7 +74,8 @@
disabled: (data) => data.nodeType!=='machine',//浠呮満搴婅妭鐐瑰彲閫�
isLeaf: (data) => !data.hasChildren
},
-
+ timeout:0, //闆朵欢鍙峰姞杞界殑timeout
+ //drawingNoMatch:true,//闆朵欢鍙锋槸鍚﹀尮閰嶅垎宸ヨ〃
attachOption: {
labelWidth: 160,
submitBtn: true,
@@ -82,12 +97,13 @@
span: 12,
dataType: 'string',
blur: (col) => {
- this.handleTrim(col)
+ this.handleTrim(col);
+
},
rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
},
{
- label: '鍥惧彿鐗堟',
+ label: '鍥剧焊鐗堟',
prop: 'drawingNoEdition',
type: 'input',
span: 12,
@@ -102,11 +118,9 @@
prop: 'productModel',
type: 'input',
span: 12,
+ disabled:true,
+ placeholder:'閫夋嫨闆剁粍浠跺彿鑷姩濉厖',
dataType: 'string',
- rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
- blur: (col) => {
- this.handleTrim(col)
- },
},
{
label: '宸ュ簭鍙�',
@@ -120,6 +134,15 @@
blur: (col) => {
this.handleTrim(col)
},
+ },
+ {
+ label: '闆剁粍浠跺悕绉�',
+ prop: 'drawingName',
+ type: 'input',
+ placeholder:'閫夋嫨闆剁粍浠跺彿鑷姩濉厖',
+ span: 12,
+ disabled:true,
+ dataType: 'string',
},
{
label: '宸ュ簭鍚嶇О',
@@ -146,7 +169,7 @@
{
label: '鎵规鍙�',
prop: 'craftEdition',
- placeholder:'濡�"A"',
+ placeholder:'濡�"2S24001"',
type: 'input',
span: 12,
dataType: 'string',
@@ -155,29 +178,12 @@
this.handleTrim(col)
},
},
- /*{
- label: '鍔犲伐鏈哄簥',
- prop: 'machineCode',
- type: 'select',
- filterable: true,
- dicUrl: `/blade-mdm/machine/page?size=10000`,
- dicFormatter: function (res) {
- that.machineCodeList = res.data.records;
- return res.data.records;
- },
- rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
- props: {
- label: 'code',
- value: 'code',
- },
- span: 12
- },*/
+
{
label: '鍔犲伐鏈哄簥',
prop: 'machineCode',
type: 'select',
rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
-
span: 12
},
{
@@ -203,18 +209,45 @@
rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
},
{
- label: '鍋忕鍗曞彿',
+ label: '涓存椂鏇存敼鍗曞彿',
prop: 'deviation',
type: 'input',
span: 12,
dataType: 'string',
class:'input_holder_warn',
- placeholder:'闈炲亸绂诲崟浠诲姟璇风暀绌�',
+ placeholder:'闈炰复鏃舵洿鏀瑰崟浠诲姟璇风暀绌�',
blur: (col) => {
this.handleTrim(col)
},
// rules: [{ required: true, message: '蹇呭~', trigger: 'blur' }],
- }
+ },
+ {
+ label: '涓荤宸ヨ壓',
+ prop: 'producePlanId',
+ type: 'select',//column 12
+ clearable:true,
+ 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',
+ },
+ /*{
+ label: '涓荤宸ヨ壓',
+ prop: 'programmer',
+ type: 'input',//column 12
+ span: 12,
+ dataType: 'string',
+ },*/
],
},
attachForm: {planLockDays:7,planStartTime: this.$dayjs().format('YYYY-MM-DD')},//榛樿7澶�
@@ -269,6 +302,72 @@
return node;
},
+ querySearchAsync(query, cb) {//闆剁粍浠跺彿鎼滅储寤鸿
+ axios({
+ url: '/blade-mdm/producedivision/select-data',
+ method: 'get',
+ params: {drawingNo: query},
+ }).then(
+ res => {
+ this.attachForm.productModel = '';//
+ 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;
+ this.attachForm.drawingName = item.ljmc;
+ },
+ /*
+ queryProgrammerAsync(query, cb) {//涓荤宸ヨ壓鎼滅储寤鸿
+ axios({
+ url: '/blade-mdm/producedivision/select-programmer',
+ method: 'get',
+ params: {programmer: query},
+ }).then(
+ res => {
+ if(res.data.code == 200){
+ let list = res.data.data;
+ for(let i of list){
+ i.value = '涓荤宸ヨ壓锛�'+i.programmerName+',鏍″锛�'+i.checkerName;
+ }
+
+ clearTimeout(this.timeout)
+ this.timeout = setTimeout(() => {
+ cb(list);
+ }, 600)
+
+ }
+ },
+ error => {
+ console.log(error);
+ }
+ );
+
+ },
+ */
+ /*
+ handleProgrammerSelect(item){
+ this.attachForm.producePlanId = item.id;
+ this.attachForm.planDrawingNo = this.attachForm.drawingNo;//璁板綍姝ゆ椂鐨勯浂缁勪欢鍙�
+ console.log('productid',this.attachForm )
+
+ },*/
handleTrim(col){
//console.log(col)
let value = this.attachForm[col.column.prop];
@@ -283,25 +382,59 @@
},
formSubmit(form, done) {
var form = { ...form };
- /*
- this.machineCodeList.forEach(item => {
- if (form.machineCode == item.code) {
- form.machineMode = item.name;
- }
- })
- */
+
+ if(this.attachForm.producePlanId){
+ //鎵嬪姩鎸囧畾浜嗕汉鍛樿亴璐h〃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.attachForm.producePlanId = res.data.data.id;
+ //this.drawingNoMatch = true;
+ console.log('planid',this.attachForm.productPlanId)
+ this.startDispatch(form,done);
+ }else{
+ //this.drawingNoMatch = false;
+
+ 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;
+ //this.drawingNoMatch = true;
+ }else{
+ this.$alert(res.data.msg, '鍙戣捣浠诲姟澶辫触',{type:'error',confirmButtonText:'鍏抽棴'});
+ }
done();
},
error => {
--
Gitblit v1.9.3