yangys
2025-09-19 ce70bd97c7f2577f0978b39b9da1ccdd8d5b768f
src/views/flowmgr/taskassign.vue
@@ -22,7 +22,7 @@
          >
        </el-autocomplete>
      </template>
      <!--
      <template #programmer="{}">
        <el-autocomplete ref="autoProgrammer" :disabled="drawingNoMatch"  v-model="attachForm.programmer"
        :fetch-suggestions="queryProgrammerAsync"
@@ -30,16 +30,12 @@
          >
        </el-autocomplete>
      </template>
-->
    </avue-form>
  </basic-container>
</template>
<script>
import {
  getQueryString,
} from '@/utils/util';
export default {
  watch: {
    'attachForm.drawingNo': function (val) {
@@ -75,7 +71,7 @@
        isLeaf: (data) => !data.hasChildren
      },
      timeout:0, //零件号加载的timeout
      drawingNoMatch:true,//零件号是否匹配分工表
      //drawingNoMatch:true,//零件号是否匹配分工表
      attachOption: {
        labelWidth: 160,
        submitBtn: true,
@@ -202,13 +198,13 @@
            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)
            },
@@ -216,12 +212,31 @@
          },
          {
            label: '主管工艺',
            prop: 'programmer',
            type: 'input',//column 12
            disabled:true,
            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天
@@ -305,7 +320,7 @@
    handleSelect(item) {
      this.attachForm.productModel = item.cph;
    },
    /*
    queryProgrammerAsync(query, cb) {//主管工艺搜索建议
      axios({
        url: '/blade-mdm/producedivision/select-programmer',
@@ -332,12 +347,14 @@
      );
      
    },
    */
    /*
    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];
@@ -352,8 +369,8 @@
    },
    formSubmit(form, done) {
      var form = { ...form };
      console.log('submit',form);
      if(this.attachForm.planDrawingNo == this.attachForm.drawingNo && this.attachForm.producePlanId){
      if(this.attachForm.producePlanId){
        //手动指定了人员职责表id,不用继续从服务端验证
         this.startDispatch(form,done);
      }else{
@@ -365,19 +382,15 @@
          res => {
            
            if(res.data.code == 200){
              this.$message({
                type: 'success',
                message: '操作成功!',
              });
            
              this.attachForm.producePlanId = res.data.data.id;
              this.drawingNoMatch = true;
              //this.drawingNoMatch = true;
              console.log('planid',this.attachForm.productPlanId)
              this.startDispatch(form,done);
            }else{
              this.drawingNoMatch = false;
              //this.drawingNoMatch = false;
             
              this.$alert(res.data.msg+".或者手动选择主管工艺。", '发起任务失败',{type:'error',confirmButtonText:'关闭'});
              this.$alert(res.data.msg+".重新输入或者手动选择主管工艺。", '发起任务失败',{type:'error',confirmButtonText:'关闭'});
            }
            done();
          },
@@ -405,7 +418,7 @@
            });
            this.$refs.form.resetForm();
            this.attachForm = this.defaultForm;
            this.drawingNoMatch = true;
            //this.drawingNoMatch = true;
          }else{
            this.$alert(res.data.msg, '发起任务失败',{type:'error',confirmButtonText:'关闭'});
          }