695593266@qq.com 1 rok pred
rodič
commit
1c43cacf3a

+ 2 - 2
src/views/InTheSystem/components/tg-details-search.vue

@@ -205,8 +205,8 @@
       search() {
         const where = { ...this.where };
         if (where.times?.length) {
-          where.startTime = where.createTime[0];
-          where.endTime = where.createTime[1];
+          where.startTime = where.times[0];
+          where.endTime = where.times[1];
         }
         delete where.times;
 

+ 163 - 154
src/views/exceptionManagement/components/create.vue

@@ -1,6 +1,12 @@
 <template>
-  <ele-modal :visible.sync="visible" :title="title" width="45vw" append-to-body @close="cancel">
-    <div class="switch" v-if="type=='detail'" :maxable="true">
+  <ele-modal
+    :visible.sync="visible"
+    :title="title"
+    width="45vw"
+    append-to-body
+    @close="cancel"
+  >
+    <div class="switch" v-if="type == 'detail'" :maxable="true">
       <div class="switch_left">
         <ul>
           <li
@@ -20,7 +26,7 @@
       :rules="rules"
       label-width="100px"
       class="create-form"
-      v-if="activeComp=='main'"
+      v-if="activeComp == 'main'"
     >
       <headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
 
@@ -238,8 +244,10 @@
         确定
       </el-button>
     </template>
-    <detail  v-if="activeComp === 'bpm' && form.processInstanceId"
-      :id="form.processInstanceId"></detail>
+    <detail
+      v-if="activeComp === 'bpm' && form.processInstanceId"
+      :id="form.processInstanceId"
+    ></detail>
     <productionPlan ref="productionPlanRef" @choose="choose" />
     <workOrder ref="workOrderRef" @choose="choose" />
     <produceOrder ref="produceOrderRef" @choose="choose" />
@@ -247,168 +255,169 @@
 </template>
 
 <script>
-import { save } from '@/api/exceptionManagement/index';
-import { transitionData } from './transition';
-import productionPlan from './productionPlan';
-import workOrder from './workOrder';
-import produceOrder from './produceOrder';
-import fileUpload from '@/components/upload/fileUpload';
-import detail from '@/views/bpm/processInstance/detail.vue';
-const defaultForm = function () {
-  return {
-    accessory: [],
-    images: [],
-    code: '',
-    type: '',
-    relationType: '', //关联类型 1 计划 2订单 3工单
-    relationId: '', //关联id
-    relationCode: '',
-    exceptionDetermine: '', //异常判定
-    exceptionDispose: '', //异常处置
-    approvalStatus: '', //审批状态
-    approvalOpinion: '', //审批意见
-    exceptionClose: '', //异常关闭 0否 1 是
-    createUserName: '', //创建人名称
-    id: '',
-    describes: '',
-    createTime: '',
-    relationJson: [],
-    approvalProcess:[]
-  };
-};
-export default {
-  components: { fileUpload, productionPlan, workOrder, produceOrder, detail },
-  data() {
+  import { save } from '@/api/exceptionManagement/index';
+  import { transitionData } from './transition';
+  import productionPlan from './productionPlan';
+  import workOrder from './workOrder';
+  import produceOrder from './produceOrder';
+  import fileUpload from '@/components/upload/fileUpload';
+  import detail from '@/views/bpm/processInstance/detail.vue';
+  const defaultForm = function () {
     return {
-      visible: false,
-      loading: false,
-      activeComp: 'main',
-      tabOptions: [
-        { key: 'main', name: '异常详情' },
-        { key: 'bpm', name: '流程详情' }
-      ],
-      form: { ...defaultForm() },
-      // 表单验证规则
-      rules: {
-        type: [{ required: true, message: '请选择', trigger: 'change' }],
-        name: [{ required: true, message: '请选择', trigger: 'change' }],
-        relationType: [{ required: true, message: '请选择', trigger: 'change' }]
-      },
+      accessory: [],
+      images: [],
+      code: '',
       type: '',
-      title: '创建',
-      options: [
-        { label: '生产计划', value: 1 },
-        { label: '生产订单', value: 2 },
-        { label: '生产工单', value: 3 }
-      ],
-      planType: [
-        { label: '所有计划类型', value: null },
-        { label: '内销计划', value: '1' },
-        { label: '外销计划', value: '2' },
-        { label: '预制计划', value: '3' }
-      ]
+      relationType: '', //关联类型 1 计划 2订单 3工单
+      relationId: '', //关联id
+      relationCode: '',
+      exceptionDetermine: '', //异常判定
+      exceptionDispose: '', //异常处置
+      approvalStatus: '', //审批状态
+      approvalOpinion: '', //审批意见
+      exceptionClose: '', //异常关闭 0否 1 是
+      createUserName: '', //创建人名称
+      id: '',
+      describes: '',
+      createTime: '',
+      relationJson: [],
+      approvalProcess: []
     };
-  },
-
-  computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
-    }
-  },
-  created() {},
-  methods: {
-    getTitle() {
-      return this.form.relationType == 1
-        ? '计划'
-        : this.form.relationType == 2
-        ? '订单'
-        : '工单';
-    },
-    open(type, row) {
-      this.visible = true;
-      
-      this.activeComp= 'main',
-      this.type = type;
-      if (type != 'add') {
-        this.form = JSON.parse(JSON.stringify(row));
-        this.form.relationJson = this.form.relationJson[0];
-        this.form.type = this.form.type + '';
-      }
-      this.title = type == 'add' ? '新增' : type == 'edit' ? '修改' : '详情';
+  };
+  export default {
+    components: { fileUpload, productionPlan, workOrder, produceOrder, detail },
+    data() {
+      return {
+        visible: false,
+        loading: false,
+        activeComp: 'main',
+        tabOptions: [
+          { key: 'main', name: '异常详情' },
+          { key: 'bpm', name: '流程详情' }
+        ],
+        form: { ...defaultForm() },
+        // 表单验证规则
+        rules: {
+          type: [{ required: true, message: '请选择', trigger: 'change' }],
+          name: [{ required: true, message: '请选择', trigger: 'change' }],
+          relationType: [
+            { required: true, message: '请选择', trigger: 'change' }
+          ]
+        },
+        type: '',
+        title: '创建',
+        options: [
+          { label: '生产计划', value: 1 },
+          { label: '生产订单', value: 2 },
+          { label: '生产工单', value: 3 }
+        ],
+        planType: [
+          { label: '所有计划类型', value: null },
+          { label: '内销计划', value: '1' },
+          { label: '外销计划', value: '2' },
+          { label: '预制计划', value: '3' }
+        ]
+      };
     },
 
-    addProduct() {
-      if (this.form.relationType == 1) {
-        this.$refs.productionPlanRef.open();
-      } else if (this.form.relationType == 2) {
-        this.$refs.workOrderRef.open();
-      } else if (this.form.relationType == 3) {
-        this.$refs.produceOrderRef.open();
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
       }
     },
-    cancel() {
-      this.form = { ...defaultForm() };
-      this.visible = false;
-    },
-    choose(data) {
-      this.form.relationJson = JSON.parse(
-        JSON.stringify(transitionData(data, this.form.relationType))
-      );
-      this.form.relationId = data.relationId;
-      this.form.relationCode = data.code;
-    },
+    created() {},
+    methods: {
+      getTitle() {
+        return this.form.relationType == 1
+          ? '计划'
+          : this.form.relationType == 2
+          ? '订单'
+          : '工单';
+      },
+      open(type, row) {
+        this.visible = true;
 
-    /* 保存编辑 */
-    save() {
-      this.$refs.form.validate((valid) => {
-        if (!valid) {
-          return false;
+        (this.activeComp = 'main'), (this.type = type);
+        if (type != 'add') {
+          this.form = JSON.parse(JSON.stringify(row));
+          this.form.relationJson = this.form.relationJson[0];
+          this.form.type = this.form.type + '';
         }
-        if (!this.form.relationJson.code) {
-          this.$message.error('请选择' + this.getTitle());
-          return;
+        this.title = type == 'add' ? '新增' : type == 'edit' ? '修改' : '详情';
+      },
+
+      addProduct() {
+        if (this.form.relationType == 1) {
+          this.$refs.productionPlanRef.open();
+        } else if (this.form.relationType == 2) {
+          this.$refs.workOrderRef.open();
+        } else if (this.form.relationType == 3) {
+          this.$refs.produceOrderRef.open();
         }
-        // for (let key in this.form) {
-        //   if (key.includes('create')) {
-        //     this.form[key] = '';
-        //   }
-        // }
-        this.loading = true;
-        let data = JSON.parse(JSON.stringify(this.form));
-        data.relationJson = [data.relationJson];
-        save(data)
-          .then((res) => {
-            this.loading = false;
-            this.$message.success('成功');
-            this.cancel();
-            this.$emit('refresh');
-          })
-          .catch((e) => {
-            this.loading = false;
-          });
-      });
+      },
+      cancel() {
+        this.form = { ...defaultForm() };
+        this.visible = false;
+      },
+      choose(data) {
+        this.form.relationJson = JSON.parse(
+          JSON.stringify(transitionData(data, this.form.relationType))
+        );
+        this.form.relationId = data.relationId;
+        this.form.relationCode = data.code;
+      },
+
+      /* 保存编辑 */
+      save() {
+        this.$refs.form.validate((valid) => {
+          if (!valid) {
+            return false;
+          }
+          if (!this.form.relationJson.code) {
+            this.$message.error('请选择' + this.getTitle());
+            return;
+          }
+          // for (let key in this.form) {
+          //   if (key.includes('create')) {
+          //     this.form[key] = '';
+          //   }
+          // }
+          this.loading = true;
+          let data = JSON.parse(JSON.stringify(this.form));
+          data.relationJson = [data.relationJson];
+          save(data)
+            .then((res) => {
+              this.loading = false;
+              this.$message.success('成功');
+              this.cancel();
+              this.$emit('refresh');
+            })
+            .catch((e) => {
+              this.loading = false;
+            });
+        });
+      }
     }
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-.basic-details-title {
-  margin: 10px 0;
-}
+  .basic-details-title {
+    margin: 10px 0;
+  }
 
-.add-product {
-  width: 100%;
-  display: flex;
-  align-items: center;
-  justify-content: flex-end;
-  font-size: 30px;
-  color: #1890ff;
-  margin: 10px 0;
-  cursor: pointer;
-}
+  .add-product {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    font-size: 30px;
+    color: #1890ff;
+    margin: 10px 0;
+    cursor: pointer;
+  }
 
-.create-form .el-form-item {
-  margin-bottom: 15px !important;
-}
+  .create-form .el-form-item {
+    margin-bottom: 15px !important;
+  }
 </style>

+ 8 - 5
src/views/pick/pickApply/components/pick-search.vue

@@ -8,18 +8,18 @@
   >
     <el-row :gutter="15">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="领料单:">
+        <el-form-item label="领料单编号:">
           <el-input
             size="mini"
             clearable
-            v-model="where.workOrderId"
+            v-model="where.code"
             placeholder="请输入"
           />
         </el-form-item>
       </el-col>
 
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="工单号:">
+        <el-form-item label="工单号:">
           <el-input
             size="mini"
             clearable
@@ -29,7 +29,10 @@
         </el-form-item>
       </el-col>
 
-      <el-col v-if="!isReturn" v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+      <el-col
+        v-if="!isReturn"
+        v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }"
+      >
         <el-form-item label="状态:">
           <el-select size="mini" v-model="where.status" style="width: 100%">
             <el-option
@@ -79,7 +82,7 @@
     data() {
       // 默认表单数据
       const defaultWhere = {
-        workOrderId: '',
+        code: '',
         joinWorkOrderCode: '',
         status: ''
       };

+ 426 - 0
src/views/produce/components/createError.vue

@@ -0,0 +1,426 @@
+<template>
+  <ele-modal
+    :visible.sync="visible"
+    v-if="visible"
+    :title="title"
+    width="45vw"
+    append-to-body
+    @close="cancel"
+  >
+    <div class="switch" v-if="type == 'detail'" :maxable="true">
+      <div class="switch_left">
+        <ul>
+          <li
+            v-for="item in tabOptions"
+            :key="item.key"
+            :class="{ active: activeComp == item.key }"
+            @click="activeComp = item.key"
+          >
+            {{ item.name }}
+          </li>
+        </ul>
+      </div>
+    </div>
+    <el-form
+      ref="form"
+      :model="form"
+      :rules="rules"
+      label-width="100px"
+      class="create-form"
+      v-if="activeComp == 'main'"
+    >
+      <headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
+
+      <el-row :gutter="15">
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="类型:" prop="type">
+            <DictSelection
+              dictName="异常类型"
+              v-model="form.type"
+              :disabled="type == 'detail'"
+            ></DictSelection>
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 24 } : { span: 8 }">
+          <el-form-item label="编码:" prop="code">
+            <el-input v-model="form.code" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 16, md: 24 } : { span: 16 }">
+          <el-form-item label="名称:" prop="name">
+            <el-input v-model="form.name" :disabled="type == 'detail'" />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 16, md: 24 } : { span: 16 }">
+          <el-form-item label="异常描述:">
+            <el-input
+              v-model="form.describes"
+              type="textarea"
+              :rows="2"
+              :disabled="type == 'detail'"
+            />
+          </el-form-item>
+        </el-col>
+        <!-- <el-col v-bind="styleResponsive ? { lg: 16, md: 24 } : { span: 16 }">
+          <el-form-item label="关联:" prop="relationType">
+            <el-select
+              :disabled="type == 'detail'"
+              v-model="form.relationType"
+              placeholder="请选择"
+              style="width: 100%"
+              clearable
+              @input="addProduct"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col> -->
+        <el-col :span="16">
+          <el-form-item prop="accessory" label="上传附件">
+            <fileUpload
+              v-model="form.accessory"
+              module="main"
+              :limit="5"
+              :disabled="type == 'detail'"
+              :showLib="false"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <headerTitle
+        v-if="form.relationJson.code"
+        style="margin-top: 15px"
+        :title="getTitle() + '信息'"
+      ></headerTitle>
+      <el-row :gutter="15" v-if="form.relationJson.code">
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item :label="'生产' + getTitle() + '号'">
+            <el-input v-model="form.relationJson.code" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="计划编号">
+            <el-input v-model="form.relationJson.productionPlanCode" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="计划类型">
+            <el-input v-model="form.relationJson.planTypeName" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="工艺路线">
+            <el-input v-model="form.relationJson.produceRoutingName" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="工序">
+            <el-input v-model="form.relationJson.produceVersionName" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="产品编码">
+            <el-input v-model="form.relationJson.productCode" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="产品名称">
+            <el-input v-model="form.relationJson.productName" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="牌号">
+            <el-input v-model="form.relationJson.brandNo" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="型号">
+            <el-input v-model="form.relationJson.model" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="批次号">
+            <el-input v-model="form.relationJson.batchNo" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="要求生产数量">
+            <el-input v-model="form.relationJson.requiredFormingNum" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="要求生产重量">
+            <el-input v-model="form.relationJson.sumOrderWeight" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="计划开始时间">
+            <el-input v-model="form.relationJson.reqMoldTime" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="已生产数量">
+            <el-input v-model="form.relationJson.formedNum" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="已生产重量">
+            <el-input v-model="form.relationJson.formedWeight" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="计划结束时间">
+            <el-input v-model="form.relationJson.deliveryTime" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="状态">
+            <el-input v-model="form.relationJson.status" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="班组">
+            <el-input v-model="form.relationJson.teamName" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="优先级">
+            <el-input v-model="form.relationJson.priority" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="创建人">
+            <el-input v-model="form.relationJson.createUserName" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="创建时间">
+            <el-input v-model="form.relationJson.createTime" disabled />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <headerTitle
+        v-if="form.approvalProcess.length > 0"
+        title="异常判定结果"
+        style="margin-top: 15px"
+      ></headerTitle>
+      <el-row
+        :gutter="15"
+        v-for="(item, index) in form.approvalProcess"
+        :key="index"
+      >
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="审核人:">
+            <el-input :value="item.auditor" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }">
+          <el-form-item label="异常判定:">
+            <el-input :value="item.exceptionDetermine" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col
+          v-if="item.exceptionDispose"
+          v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 8 }"
+        >
+          <el-form-item label="异常处置:">
+            <el-input :value="item.exceptionDispose" disabled />
+          </el-form-item> </el-col
+      ></el-row>
+    </el-form>
+    <template v-slot:footer>
+      <el-button @click="cancel">取消</el-button>
+      <el-button
+        type="primary"
+        @click="save"
+        :loading="loading"
+        v-if="type != 'detail'"
+      >
+        确定
+      </el-button>
+    </template>
+    <detail
+      v-if="activeComp === 'bpm' && form.processInstanceId"
+      :id="form.processInstanceId"
+    ></detail>
+  </ele-modal>
+</template>
+
+<script>
+  import { save } from '@/api/exceptionManagement/index';
+  import { transitionData } from '../../exceptionManagement/components/transition';
+  // import productionPlan from './productionPlan';
+  // import workOrder from './workOrder';
+  // import produceOrder from './produceOrder';
+  import fileUpload from '@/components/upload/fileUpload';
+  import detail from '@/views/bpm/processInstance/detail.vue';
+  import { workorderPage } from '@/api/workOrderList';
+  const defaultForm = function () {
+    return {
+      accessory: [],
+      images: [],
+      code: '',
+      type: '',
+      relationType: '', //关联类型 1 计划 2订单 3工单
+      relationId: '', //关联id
+      relationCode: '',
+      exceptionDetermine: '', //异常判定
+      exceptionDispose: '', //异常处置
+      approvalStatus: '', //审批状态
+      approvalOpinion: '', //审批意见
+      exceptionClose: '', //异常关闭 0否 1 是
+      createUserName: '', //创建人名称
+      id: '',
+      describes: '',
+      createTime: '',
+      relationJson: [],
+      approvalProcess: []
+    };
+  };
+  export default {
+    components: { fileUpload, detail },
+    data() {
+      return {
+        visible: false,
+        loading: false,
+        activeComp: 'main',
+        tabOptions: [
+          { key: 'main', name: '异常详情' },
+          { key: 'bpm', name: '流程详情' }
+        ],
+        form: { ...defaultForm() },
+        // 表单验证规则
+        rules: {
+          type: [{ required: true, message: '请选择', trigger: 'change' }],
+          name: [{ required: true, message: '请选择', trigger: 'change' }],
+          relationType: [
+            { required: true, message: '请选择', trigger: 'change' }
+          ]
+        },
+        type: '',
+        title: '创建',
+        options: [
+          { label: '生产计划', value: 1 },
+          { label: '生产订单', value: 2 },
+          { label: '生产工单', value: 3 }
+        ],
+        planType: [
+          { label: '所有计划类型', value: null },
+          { label: '内销计划', value: '1' },
+          { label: '外销计划', value: '2' },
+          { label: '预制计划', value: '3' }
+        ]
+      };
+    },
+
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created() {},
+    methods: {
+      getTitle() {
+        return this.form.relationType == 1
+          ? '计划'
+          : this.form.relationType == 2
+          ? '订单'
+          : '工单';
+      },
+      open(type, row) {
+        this.visible = true;
+
+        (this.activeComp = 'main'), (this.type = type);
+        if (type != 'add') {
+          this.form = JSON.parse(JSON.stringify(row));
+          this.form.relationJson = this.form.relationJson[0];
+          this.form.type = this.form.type + '';
+        }
+
+        console.log(type, row, 'type,row');
+        this.title = type == 'add' ? '新增' : type == 'edit' ? '修改' : '详情';
+        this.choose(row);
+      },
+
+      addProduct() {
+        if (this.form.relationType == 1) {
+          this.$refs.productionPlanRef.open();
+        } else if (this.form.relationType == 2) {
+          this.$refs.workOrderRef.open();
+        } else if (this.form.relationType == 3) {
+          this.$refs.produceOrderRef.open();
+        }
+      },
+      cancel() {
+        this.form = { ...defaultForm() };
+        this.visible = false;
+      },
+      choose(data) {
+        this.form.relationJson = JSON.parse(
+          JSON.stringify(transitionData(data, this.form.relationType))
+        );
+        this.form.relationId = data.relationId;
+        this.form.relationCode = data.code;
+      },
+
+      /* 保存编辑 */
+      save() {
+        this.$refs.form.validate((valid) => {
+          if (!valid) {
+            return false;
+          }
+          if (!this.form.relationJson.code) {
+            this.$message.error('请选择' + this.getTitle());
+            return;
+          }
+          // for (let key in this.form) {
+          //   if (key.includes('create')) {
+          //     this.form[key] = '';
+          //   }
+          // }
+          this.loading = true;
+          let data = JSON.parse(JSON.stringify(this.form));
+          data.relationJson = [data.relationJson];
+          save(data)
+            .then((res) => {
+              this.loading = false;
+              this.$message.success('成功');
+              // this.cancel();
+              // this.$emit('refresh');
+              this.visible = false;
+            })
+            .catch((e) => {
+              this.loading = false;
+            });
+        });
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .basic-details-title {
+    margin: 10px 0;
+  }
+
+  .add-product {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    font-size: 30px;
+    color: #1890ff;
+    margin: 10px 0;
+    cursor: pointer;
+  }
+
+  .create-form .el-form-item {
+    margin-bottom: 15px !important;
+  }
+</style>

+ 13 - 6
src/views/produce/components/feeding/components/paramBom.vue

@@ -16,17 +16,24 @@
       <div class="table">
         <div class="tr row rx-sc" v-for="(it, idx) in list" :key="idx">
           <div class="item ww40">
-            {{ it.name }}
+            {{ it.name || it.extInfo.name }}
           </div>
-          <div class="item ww40" v-if="it.textType != 3">
-            {{ it.defaultValue }}
+          <div
+            class="item ww40"
+            v-if="it.textType != 3 || (it.extInfo && it.extInfo.textType != 3)"
+          >
+            {{ it.defaultValue || it.extInfo.defaultValue }}
           </div>
 
-          <div class="item ww40" v-if="it.textType == 3">
-            {{ it.minValue }} - {{ it.maxValue }}
+          <div
+            class="item ww40"
+            v-if="it.textType == 3 || (it.extInfo && it.extInfo.textType == 3)"
+          >
+            {{ it.minValue || it.extInfo.minValue }} -
+            {{ it.maxValue || it.extInfo.maxValue }}
           </div>
           <div class="item ww20">
-            {{ it.unitName }}
+            {{ it.unitName || it.extInfo.unitName }}
           </div>
         </div>
       </div>

+ 8 - 1
src/views/produce/components/feeding/details.vue

@@ -20,6 +20,11 @@
         <div v-for="(it, idx) in item.orderInfoList" :key="idx">
           <workOrderBom :item="it" :isDetails="true"></workOrderBom>
 
+          <paramBom
+            v-if="it.paramDetailList.length != 0"
+            :list="it.paramDetailList"
+          ></paramBom>
+
           <deviceBom
             v-if="it.equipmentList.length != 0"
             :list="it.equipmentList"
@@ -125,6 +130,7 @@
   import batchProductsBom from './components/batchProductsBom.vue';
   import turnoverBom from './components/turnoverBom.vue';
   import semiProductJobBom from '@/views/produce/components/jobBooking/components/semiProductJobBom.vue';
+  import paramBom from '../feeding/components/paramBom.vue';
 
   export default {
     components: {
@@ -138,7 +144,8 @@
       semiProductJobBom,
       productsBom,
       batchProductsBom,
-      turnoverBom
+      turnoverBom,
+      paramBom
     },
 
     props: {

+ 5 - 0
src/views/produce/components/jobBooking/details.vue

@@ -27,6 +27,11 @@
             >
           </div>
         </div>
+
+        <paramBom
+          v-if="objData.paramDetailList.length != 0"
+          :list="objData.paramDetailList"
+        ></paramBom>
         <div>
           <workOrderBom
             :item="objData"

+ 7 - 6
src/views/produce/components/picking/details.vue

@@ -125,18 +125,21 @@
           {
             prop: 'createTime',
             label: '领料时间',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'code',
             label: '领料单编号',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'name',
             label: '领料单名称',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
@@ -199,7 +202,6 @@
         this.detailedShow = false;
       },
       openOutsourcingPicking() {
-        console.log('this.workListIds', this.workListIds);
         if (this.workListIds.length == 1) {
           this.getTaskInstanceByIdFn();
           // this.outsourcingPickingShow=true
@@ -213,12 +215,11 @@
 
       pickingClose() {
         this.pickingShow = false;
+        // this.getList(this.workListIds);
       },
 
       //获取工单列表
       getTaskInstanceByIdFn() {
-        console.log(this.taskId, 'this.tasworkTaskIdkId');
-        console.log(this.workListIds[0], 'this.workListIds[0]');
         this.pickingShow = true;
         // let param = {
         //   ids: [this.workListIds[0]],

+ 52 - 13
src/views/produce/components/picking/index.vue

@@ -6,8 +6,12 @@
     :close-on-click-modal="false"
     :maxable="true"
     :close-on-press-escape="false"
+    id="formId"
     append-to-body
     width="80%"
+    @update:fullscreen="fullscreen"
+    :fullscreen="isFullscreen"
+    :height="dialogDynamicHeight"
   >
     <el-form>
       <el-row :gutter="24">
@@ -66,7 +70,7 @@
           <el-table
             :ref="`tableRef${idx}`"
             class="table_content"
-            :max-height="300"
+            :max-height="tabalHeight"
             :data="item.pickList"
             tooltip-effect="dark"
             style="width: 100%"
@@ -87,7 +91,11 @@
               </template>
             </el-table-column>
 
-            <el-table-column label="编码" prop="assetCode">
+            <el-table-column
+              label="编码"
+              prop="assetCode"
+              show-overflow-tooltip
+            >
               <template slot-scope="{ row, $index }">
                 <span
                   v-if="
@@ -106,7 +114,7 @@
               </template>
             </el-table-column>
 
-            <el-table-column label="名称" prop="name">
+            <el-table-column label="名称" prop="name" show-overflow-tooltip>
               <template slot-scope="{ row, $index }">
                 <span
                   v-if="
@@ -119,8 +127,17 @@
                 <span> {{ row.name }}</span>
               </template>
             </el-table-column>
-            <el-table-column label="型号" prop="modelType"> </el-table-column>
-            <el-table-column label="规格" prop="specification">
+            <el-table-column
+              label="型号"
+              prop="modelType"
+              show-overflow-tooltip
+            >
+            </el-table-column>
+            <el-table-column
+              label="规格"
+              prop="specification"
+              show-overflow-tooltip
+            >
             </el-table-column>
             <el-table-column label="批次号" prop="batchNo"> </el-table-column>
 
@@ -272,7 +289,12 @@
         typeName,
 
         tableRules: {},
-        loadingBtn: false
+        loadingBtn: false,
+        contentStyleObj: {
+          height: ''
+        },
+        isFullscreen: false,
+        tabalHeight: 300
       };
     },
     computed: {
@@ -281,6 +303,17 @@
       },
       clientEnvironmentId() {
         return this.$store.state.user.info.clientEnvironmentId;
+      },
+      dialogDynamicHeight() {
+        if (this.isFullscreen) {
+          // 全屏时,高度为窗口高度
+          console.log(window.innerHeight + 'px', '全屏高度');
+          this.tabalHeight = window.innerHeight - 200;
+          return window.innerHeight + 'px';
+        } else {
+          this.tabalHeight = 300;
+          return '500px';
+        }
       }
     },
 
@@ -371,7 +404,6 @@
       },
 
       async getOrderCode() {
-        console.log(this.workListIds, '555555');
         this.pickCode = await getCode('pick_order_code');
       },
 
@@ -398,7 +430,6 @@
       },
 
       save() {
-        console.log(this.workList, 'cvassasasag');
         if (this.workList.length > 0) {
           let bol;
           let _i;
@@ -481,11 +512,19 @@
           pickName: this.pickName,
           pickCode: this.pickCode
         };
-        batchSave(param).then((res) => {
-          this.loadingBtn = false;
-          this.$message.success('领料成功');
-          this.$emit('close', true);
-        });
+        batchSave(param)
+          .then((res) => {
+            this.loadingBtn = false;
+            this.$message.success('领料成功');
+            this.$emit('close', true);
+          })
+          .catch((err) => {
+            this.loadingBtn = false;
+          });
+      },
+
+      fullscreen() {
+        this.isFullscreen = !this.isFullscreen;
       }
     },
 

+ 43 - 9
src/views/produce/components/picking/outsourceIndex.vue

@@ -8,6 +8,9 @@
     :close-on-press-escape="false"
     append-to-body
     width="80%"
+    @update:fullscreen="fullscreen"
+    :fullscreen="isFullscreen"
+    :height="dialogDynamicHeight"
   >
     <el-form>
       <el-row :gutter="24">
@@ -84,7 +87,11 @@
               </template>
             </el-table-column>
 
-            <el-table-column label="编码" prop="assetCode">
+            <el-table-column
+              label="编码"
+              prop="assetCode"
+              show-overflow-tooltip
+            >
               <template slot-scope="{ row, $index }">
                 <span
                   v-if="
@@ -103,7 +110,7 @@
               </template>
             </el-table-column>
 
-            <el-table-column label="名称" prop="name">
+            <el-table-column label="名称" prop="name" show-overflow-tooltip>
               <template slot-scope="{ row, $index }">
                 <span
                   v-if="
@@ -117,8 +124,17 @@
                 <span v-if="row.isOut" style="color: #faad14"> (委外) </span>
               </template>
             </el-table-column>
-            <el-table-column label="型号" prop="modelType"> </el-table-column>
-            <el-table-column label="规格" prop="specification">
+            <el-table-column
+              label="型号"
+              prop="modelType"
+              show-overflow-tooltip
+            >
+            </el-table-column>
+            <el-table-column
+              label="规格"
+              prop="specification"
+              show-overflow-tooltip
+            >
             </el-table-column>
             <el-table-column label="批次号" prop="batchNo"> </el-table-column>
 
@@ -299,6 +315,17 @@
       },
       clientEnvironmentId() {
         return this.$store.state.user.info.clientEnvironmentId;
+      },
+      dialogDynamicHeight() {
+        if (this.isFullscreen) {
+          // 全屏时,高度为窗口高度
+          console.log(window.innerHeight + 'px', '全屏高度');
+          this.tabalHeight = window.innerHeight - 200;
+          return window.innerHeight + 'px';
+        } else {
+          this.tabalHeight = 300;
+          return '500px';
+        }
       }
     },
 
@@ -535,15 +562,22 @@
           pickName: this.pickName,
           pickCode: this.pickCode
         };
-        batchSave(param).then((res) => {
-          this.loadingBtn = false;
-          this.$message.success('领料成功');
-          this.$emit('close', true);
-        });
+        batchSave(param)
+          .then((res) => {
+            this.loadingBtn = false;
+            this.$message.success('领料成功');
+            this.$emit('close', true);
+          })
+          .catch((err) => {
+            this.loadingBtn = false;
+          });
       },
 
       closeOutsourcingPicking() {
         this.outsourcingPickingShow = false;
+      },
+      fullscreen() {
+        this.isFullscreen = !this.isFullscreen;
       }
     },
 

+ 6 - 0
src/views/produce/components/workPlan/components/newQualityContentTabs.vue

@@ -978,6 +978,10 @@
           templateIds: select.map((item) => item.id)
         });
 
+        data.forEach((item) => {
+          item.id = null;
+        });
+
         // 这里是选择方案后,数据新加,要改为覆盖
         // this.templateList.push(...data);
         // const strings = this.templateList.map((item) => JSON.stringify(item));
@@ -1002,6 +1006,8 @@
             this.templateList
           );
         });
+        this.$set(this.form, 'templateList', this.templateList);
+        this.$emit('setSchemeList', this.templateList);
         this.schemePagination.total = this.templateList.length;
       },
       handDel(index) {

+ 28 - 1
src/views/produce/components/workPlan/edit.vue

@@ -60,6 +60,7 @@
           @handleSampleSubmit="handleSampleSubmit"
           @getConditionType="getConditionType"
           @countQualityResults="countQualityResults"
+          @setSchemeList="setSchemeList"
         />
       </el-card>
 
@@ -144,7 +145,7 @@
           imgUrl: [],
           qualityTimeStart: '',
           qualityTimeEnd: '',
-
+          templateList: [],
           sampleMeasureUnit: '',
           conditionType: null
         };
@@ -1001,6 +1002,15 @@
         }
         const selectedData = [];
         selectedData.push(this.sampleList[index]);
+
+        if (this.schemeList.length != 0) {
+          this.sampleList.forEach((item) => {
+            if (item.qualitySampleTemplateList.length == 0) {
+              item.qualitySampleTemplateList.push(...this.schemeList);
+            }
+          });
+        }
+
         this.$refs.detailRef.openDia(
           index,
           row,
@@ -1190,8 +1200,25 @@
         // *** 选完批量质检调用
         this.countQualityResults();
       },
+
+      setSchemeList(list) {
+        this.schemeList = list;
+        console.log(this.schemeList, 'this.schemeList');
+      },
       // 批量质检
       batchQuality(index, row, type) {
+        if (this.sampleList.length == 0) {
+          this.$message.error('样品清单不能为空');
+          return;
+        }
+
+        if (this.schemeList.length != 0) {
+          this.sampleList.forEach((item) => {
+            if (item.qualitySampleTemplateList.length == 0) {
+              item.qualitySampleTemplateList.push(...this.schemeList);
+            }
+          });
+        }
         this.$refs.detailRef.openDia(
           null,
           null,

+ 14 - 1
src/views/produce/index.vue

@@ -260,6 +260,9 @@
     <workStep ref="workStepRef" />
     <!--  任务  -->
     <TaskDialog ref="taskDialogRef" />
+
+    <!-- 异常 -->
+    <createError ref="createErrorRef" />
   </div>
 </template>
 
@@ -286,6 +289,7 @@
   import warehousing from './components/warehousing/index.vue';
   import outsourceList from './components/outsourcing/outsourceList.vue';
   import workStep from './components/workStep/index.vue';
+  import createError from './components/createError.vue';
   import { parameterGetByCode } from '@/api/system/dictionary-data';
   import {
     getByTaskId,
@@ -315,7 +319,8 @@
       warehousing,
       workStep,
       workPlan,
-      TaskDialog
+      TaskDialog,
+      createError
     },
     data() {
       return {
@@ -620,6 +625,14 @@
             this.workData.list[0]
           );
         }
+
+        if (t === 'error') {
+          if (this.workListIds.length > 1) {
+            return this.$message.warning('异常只能选择一个工单!');
+          }
+          // console.log(this.workListIds, 'this.workListIds');
+          this.$refs.createErrorRef.open('add', this.workData.list[0]);
+        }
         // 工艺路线 *** 修改 判断只能选择一个
         // if (t === 'work') {
         //   let req = {

+ 17 - 10
src/views/produceOrder/index.vue

@@ -305,8 +305,7 @@
             label: '计划编号:',
             value: 'productionPlanCode',
             type: 'input',
-
-            placeholder: ''
+            width: 240
           },
           {
             label: '计划类型:',
@@ -437,7 +436,8 @@
             slot: 'code',
             label: '生产工单号',
             align: 'center',
-            minWidth: 110
+            minWidth: 110,
+            showOverflowTooltip: true
           },
           // {
           //   prop: 'originalCode',
@@ -450,19 +450,22 @@
             slot: 'QRcode',
             label: '二维码',
             align: 'center',
-            minWidth: 110
+            minWidth: 110,
+            showOverflowTooltip: true
           },
           {
             label: '生产订单号',
             slot: 'apsWorkOrderCode',
             align: 'center',
-            minWidth: 110
+            minWidth: 110,
+            showOverflowTooltip: true
           },
           {
             prop: 'productionPlanCode',
             label: '计划编号',
             align: 'center',
-            minWidth: 110
+            minWidth: 110,
+            showOverflowTooltip: true
           },
           {
             prop: 'planType',
@@ -476,22 +479,26 @@
           {
             prop: 'produceRoutingName',
             label: '工艺路线',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'productCode',
             label: '编码',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'productName',
             label: '名称',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'model',
             label: '型号',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'productionCodes',

+ 270 - 258
src/views/unacceptedProduct/components/create.vue

@@ -1,5 +1,12 @@
 <template>
-  <ele-modal :visible.sync="visible" :title="title" width="80vw" append-to-body @close="cancel" :maxable="true"> 
+  <ele-modal
+    :visible.sync="visible"
+    :title="title"
+    width="80vw"
+    append-to-body
+    @close="cancel"
+    :maxable="true"
+  >
     <el-form
       ref="form"
       :model="form"
@@ -15,7 +22,11 @@
         </el-col>
         <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
           <el-form-item label="来源编码:">
-            <el-input :maxlength="20" v-model="form.unqualifiedSourceCode" disabled />
+            <el-input
+              :maxlength="20"
+              v-model="form.unqualifiedSourceCode"
+              disabled
+            />
           </el-form-item>
         </el-col>
         <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
@@ -186,282 +197,283 @@
 </template>
 
 <script>
-import EquipmentDialog from '../components/EquipmentDialog.vue';
-import ProductionVersion from '@/components/ProductionVersion/ProductionVersion.vue';
-import { getProduceTaskList } from '@/api/aps';
-import {
-  unqualifiedProductsAdd,
-  getDetail,
-  deleteUnacceptedProductDetail
-} from '@/api/unacceptedProduct/index';
-export default {
-  components: {
-    EquipmentDialog,
-    ProductionVersion
-  },
-  data() {
-    return {
-      validatePass: (rule, value, callback) => {
-        if (!value) {
-          callback(new Error('数量不能为0'));
-        } else {
-          callback();
-        }
-      },
-      visible: false,
-      loading: false,
-      produceTaskList: [],
-      form: {
-        poList: [],
-        code: '',
-        unqualifiedSourceCode: '',
-        unqualifiedSourceId: '',
-      
-        unqualifiedQuantity: '',
-        type: '',
-        status: null,
-        reviewerId: null,
-        reviewerName: '',
-        createUserName: '',
-        brandNo: '',
-        produceRoutingId: '',
-        produceRoutingName: '',
-        produceTaskId: '',
-        produceTaskName: '',
-        batchNo: ''
-      },
-      // 表单验证规则
-      rules: {
-        deliveryTime: [
-          { required: true, message: '请选择交付日期', trigger: 'change' }
-        ]
-      },
-
-      title: '创建'
-    };
-  },
-
-  computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
-    }
-  },
-  created() {},
-  methods: {
-    open(row, type) {
-      this.visible = true;
-      if (type == 'add') {
-        this.title = '创建';
-        this.form = row;
-        this.getProduceTaskList();
-        return;
-      }
-      if (row) {
-        this.title = '修改';
-        this.detail(row);
-      } else {
-        this.title = '创建';
-      }
-    },
-    //选择工艺路线
-    openVersion() {
-      this.$refs.versionRefs.open();
-    },
-    //工艺路线回调
-    changeProduct(data) {
-      this.form.produceRoutingId = data.id;
-      this.form.produceRoutingName = data.name;
-      this.form.produceTaskId = '';
-      this.form.produceTaskName = '';
-      this.getProduceTaskList();
-    },
-    async getProduceTaskList() {
-      const res = await getProduceTaskList({
-        isDetail: true,
-        pageNum: 1,
-        routingId: this.form.produceRoutingId,
-        size: -1
-      });
-      this.produceTaskList = res.list;
-    },
-    produceTaskChange() {
-      if (!this.form.produceTaskId) {
-        return;
-      }
-      this.form.produceTaskName = this.produceTaskList.find(
-        (item) => item.id == this.form.produceTaskId
-      ).name;
-      this.form.poList.forEach((item, index) => {
-        this.$set(
-          this.form.poList[index],
-          'produceRoutingId',
-          this.form.produceRoutingId
-        );
-        this.$set(
-          this.form.poList[index],
-          'produceRoutingName',
-          this.form.produceRoutingName
-        );
-        this.$set(
-          this.form.poList[index],
-          'produceTaskId',
-          this.form.produceTaskId
-        );
-        this.$set(
-          this.form.poList[index],
-          'produceTaskName',
-          this.form.produceTaskName
-        );
-      });
+  import EquipmentDialog from '../components/EquipmentDialog.vue';
+  import ProductionVersion from '@/components/ProductionVersion/ProductionVersion.vue';
+  import { getProduceTaskList } from '@/api/aps';
+  import {
+    unqualifiedProductsAdd,
+    getDetail,
+    deleteUnacceptedProductDetail
+  } from '@/api/unacceptedProduct/index';
+  export default {
+    components: {
+      EquipmentDialog,
+      ProductionVersion
     },
-
-    detail(row) {
-      getDetail(row.id).then((res) => {
-        this.form = row;
-        this.getProduceTaskList();
-        this.form.poList = res;
-      });
-    },
-    cancel() {
-      this.form = {
-        poList: [],
-        code: '',
-        workOrderId: '',
-        productCode: '',
-        productName: '',
-        specifications: '',
-        unqualifiedQuantity: '',
-        type: '',
-        status: null,
-        reviewerId: null,
-        reviewerName: '',
-        createUserName: '',
-        brandNo: '',
-        produceRoutingId: '',
-        produceRoutingName: '',
-        produceTaskId: '',
-        produceTaskName: '',
-        batchNo: ''
-      };
-      this.$refs.form.clearValidate();
-      this.visible = false;
-    },
-    // 删除产品
-    handleDeleteItem(index, id) {
-      this.$confirm('确认删除吗?', '提示', {
-        confirmButtonText: '确定',
-        cancleButtonText: '取消',
-        type: 'warning'
-      })
-        .then((res) => {
-          if (id) {
-            deleteUnacceptedProductDetail([id]).then((res) => {
-              this.form.poList.splice(index, 1);
-            });
+    data() {
+      return {
+        validatePass: (rule, value, callback) => {
+          if (!value) {
+            callback(new Error('数量不能为0'));
           } else {
-            this.form.poList.splice(index, 1);
+            callback();
           }
-        })
-        .catch(() => {});
+        },
+        visible: false,
+        loading: false,
+        produceTaskList: [],
+        form: {
+          poList: [],
+          code: '',
+          unqualifiedSourceCode: '',
+          unqualifiedSourceId: '',
 
-      this.inputNumber();
+          unqualifiedQuantity: '',
+          type: '',
+          status: null,
+          reviewerId: null,
+          reviewerName: '',
+          createUserName: '',
+          brandNo: '',
+          produceRoutingId: '',
+          produceRoutingName: '',
+          produceTaskId: '',
+          produceTaskName: '',
+          batchNo: ''
+        },
+        // 表单验证规则
+        rules: {
+          deliveryTime: [
+            { required: true, message: '请选择交付日期', trigger: 'change' }
+          ]
+        },
+
+        title: '创建'
+      };
     },
-    addEquipment() {
-      this.$refs.equipmentRefs.open();
+
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
     },
-    /* 保存编辑 */
-    save() {
-      console.log(this.form.poList);
-      this.$refs.form.validate((valid) => {
-        if (!valid) {
-          return false;
+    created() {},
+    methods: {
+      open(row, type) {
+        this.visible = true;
+        if (type == 'add') {
+          this.title = '创建';
+          this.form = row;
+          this.getProduceTaskList();
+          return;
         }
-        if (!this.form.poList.length) {
-          return this.$message.warning('产品列表不能为空!');
+        if (row) {
+          this.title = '修改';
+          this.detail(row);
+        } else {
+          this.title = '创建';
         }
-        for (let key in this.form) {
-          if (key.includes('create')) {
-            this.form[key] = '';
-          }
+      },
+      //选择工艺路线
+      openVersion() {
+        this.$refs.versionRefs.open();
+      },
+      //工艺路线回调
+      changeProduct(data) {
+        this.form.produceRoutingId = data.id;
+        this.form.produceRoutingName = data.name;
+        this.form.produceTaskId = '';
+        this.form.produceTaskName = '';
+        this.getProduceTaskList();
+      },
+      async getProduceTaskList() {
+        const res = await getProduceTaskList({
+          isDetail: true,
+          pageNum: 1,
+          routingId: this.form.produceRoutingId,
+          size: -1
+        });
+        this.produceTaskList = res.list;
+      },
+      produceTaskChange() {
+        if (!this.form.produceTaskId) {
+          return;
         }
-        this.form.poList.forEach((item) => {
-          for (let key in item) {
-            if (key.includes('create')) {
-              item[key] = '';
-            }
-          }
+        this.form.produceTaskName = this.produceTaskList.find(
+          (item) => item.id == this.form.produceTaskId
+        ).name;
+        this.form.poList.forEach((item, index) => {
+          this.$set(
+            this.form.poList[index],
+            'produceRoutingId',
+            this.form.produceRoutingId
+          );
+          this.$set(
+            this.form.poList[index],
+            'produceRoutingName',
+            this.form.produceRoutingName
+          );
+          this.$set(
+            this.form.poList[index],
+            'produceTaskId',
+            this.form.produceTaskId
+          );
+          this.$set(
+            this.form.poList[index],
+            'produceTaskName',
+            this.form.produceTaskName
+          );
+        });
+      },
+
+      detail(row) {
+        getDetail(row.id).then((res) => {
+          this.form = row;
+          this.getProduceTaskList();
+          this.form.poList = res;
         });
-        this.loading = true;
-        unqualifiedProductsAdd(this.form)
+      },
+      cancel() {
+        this.form = {
+          poList: [],
+          code: '',
+          workOrderId: '',
+          productCode: '',
+          productName: '',
+          specifications: '',
+          unqualifiedQuantity: '',
+          type: '',
+          status: null,
+          reviewerId: null,
+          reviewerName: '',
+          createUserName: '',
+          brandNo: '',
+          produceRoutingId: '',
+          produceRoutingName: '',
+          produceTaskId: '',
+          produceTaskName: '',
+          batchNo: ''
+        };
+        this.$refs.form.clearValidate();
+        this.visible = false;
+      },
+      // 删除产品
+      handleDeleteItem(index, id) {
+        this.$confirm('确认删除吗?', '提示', {
+          confirmButtonText: '确定',
+          cancleButtonText: '取消',
+          type: 'warning'
+        })
           .then((res) => {
-            this.loading = false;
-            this.$message.success('成功');
-            this.cancel();
-            this.$emit('refresh');
+            if (id) {
+              deleteUnacceptedProductDetail([id]).then((res) => {
+                this.form.poList.splice(index, 1);
+              });
+            } else {
+              this.form.poList.splice(index, 1);
+            }
           })
-          .catch((e) => {
-            this.loading = false;
+          .catch(() => {});
+
+        this.inputNumber();
+      },
+      addEquipment() {
+        this.$refs.equipmentRefs.open();
+      },
+      /* 保存编辑 */
+      save() {
+        console.log(this.form.poList);
+        this.$refs.form.validate((valid) => {
+          if (!valid) {
+            return false;
+          }
+          if (!this.form.poList.length) {
+            return this.$message.warning('产品列表不能为空!');
+          }
+          for (let key in this.form) {
+            if (key.includes('create')) {
+              this.form[key] = '';
+            }
+          }
+          this.form.poList.forEach((item) => {
+            for (let key in item) {
+              if (key.includes('create')) {
+                item[key] = '';
+              }
+            }
           });
-      });
-    },
+          this.loading = true;
+          unqualifiedProductsAdd(this.form)
+            .then((res) => {
+              this.loading = false;
+              this.$message.success('成功');
+              this.cancel();
+              this.$emit('refresh');
+            })
+            .catch((e) => {
+              this.loading = false;
+            });
+        });
+      },
 
-    // 确定选择
-    confirmChoose(data) {
-      let list = [];
-      list = data.map((item, index) => {
-        if (item.productCode) {
-          return item;
-        } else {
-          return {
-            productCode: item.code,
-            productName: item.name,
-            // productUnitWeight: item.netWeight,
-            // weightUnit: item.weightUnit,
-            specification: item.specification,
-            brandNo: item.brandNum,
-            unqualifiedQuantity: '',
-            unqualifiedReason: '',
-            produceRoutingId: '',
-            produceRoutingName: '',
-            produceTaskId: '',
-            produceTaskName: ''
-          };
-        }
-      });
+      // 确定选择
+      confirmChoose(data) {
+        let list = [];
+        list = data.map((item, index) => {
+          if (item.productCode) {
+            return item;
+          } else {
+            return {
+              productCode: item.code,
+              productName: item.name,
+              // productUnitWeight: item.netWeight,
+              // weightUnit: item.weightUnit,
+              specification: item.specification,
+              brandNo: item.brandNum,
+              unqualifiedQuantity: '',
+              unqualifiedReason: '',
+              produceRoutingId: '',
+              produceRoutingName: '',
+              produceTaskId: '',
+              produceTaskName: ''
+            };
+          }
+        });
 
-      this.form.poList = this.form.poList.concat(list);
+        this.form.poList = this.form.poList.concat(list);
 
-      this.produceTaskChange();
-      this.inputNumber();
-    },
+        this.produceTaskChange();
+        this.inputNumber();
+      },
 
-    inputNumber() {
-      this.form.unqualifiedQuantity = 0;
-      this.form.poList.forEach((item) => {
-        this.form.unqualifiedQuantity += Number(item.unqualifiedQuantity) || 0;
-      });
+      inputNumber() {
+        this.form.unqualifiedQuantity = 0;
+        this.form.poList.forEach((item) => {
+          this.form.unqualifiedQuantity +=
+            Number(item.unqualifiedQuantity) || 0;
+        });
+      }
     }
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-.basic-details-title {
-  margin: 10px 0;
-}
+  .basic-details-title {
+    margin: 10px 0;
+  }
 
-.add-product {
-  width: 100%;
-  display: flex;
-  align-items: center;
-  justify-content: flex-end;
-  font-size: 30px;
-  color: #1890ff;
-  margin: 10px 0;
-  cursor: pointer;
-}
+  .add-product {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    font-size: 30px;
+    color: #1890ff;
+    margin: 10px 0;
+    cursor: pointer;
+  }
 
-.create-form .el-form-item {
-  margin-bottom: 15px !important;
-}
+  .create-form .el-form-item {
+    margin-bottom: 15px !important;
+  }
 </style>

+ 16 - 8
src/views/unacceptedProduct/index.vue

@@ -88,43 +88,51 @@
           {
             prop: 'code',
             label: '编码',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'unqualifiedSourceCode',
             label: '来源编码',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'batchNo',
             label: '批次号',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'unqualifiedQuantity',
             label: '数量',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'produceRoutingName',
             label: '工艺路线',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'produceTaskName',
             label: '工序',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
 
           {
             prop: 'createTime',
             label: '创建时间',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           {
             prop: 'reviewerName',
             label: '创建人',
-            align: 'center'
+            align: 'center',
+            showOverflowTooltip: true
           },
           // {
           //   prop: 'slottingType',

+ 194 - 159
src/views/warehousing/index.vue

@@ -4,7 +4,7 @@
       <search @search="reload" ref="searchRef"> </search>
 
       <!-- 数据表格 -->
-      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" >
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource">
         <template v-slot:totalCount="{ row }">
           {{ row.totalCount }} {{ row.measuringUnit }}
         </template>
@@ -45,168 +45,203 @@
 </template>
 
 <script>
-import { getList } from '@/api/warehousing/index.js';
-
-import search from './components/search.vue';
-import tgDetails from './components/tgDetails.vue';
-import storage from './storageComponents/storage.vue';
-export default {
-  components: {
-    search,
-    tgDetails,
-    storage
-  },
-  data() {
-    return {
-      loading: false,
-
-      statusOpt: [
-        { label: '未提交', value: 0 },
-        { label: '审核中', value: 1 },
-        { label: '审核通过', value: 2 },
-        { label: '审核不通过', value: 3 }
-      ]
-    };
-  },
-  computed: {
-    // 表格列配置
-    columns() {
-      return [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'code',
-          label: '编码',
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          prop: 'workOrderCode',
-          label: '工单编码',
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          prop: 'warehouseName',
-          label: '仓库名称	',
-          align: 'center'
-        },
-
-        {
-          prop: 'categoryLevelName',
-          label: '物品分类',
-          align: 'center'
-        },
-        {
-          prop: 'categoryName',
-          label: '名称',
-          align: 'center'
-        },
-        { label: '批次号', prop: 'batchNo', width: '90' },
-        { label: '型号', prop: 'modelType', width: '150' },
-        { label: '规格', prop: 'specification', width: '150' },
-        { label: '牌号', prop: 'brandNum', width: '50' },
-        {
-          slot: 'totalCount',
-          label: '总数量',
-          align: 'center'
-        },
-
-        {
-          slot: 'totalPackage',
-          label: '总包装',
-          align: 'center'
-        },
-
-        {
-          slot: 'totalWeight',
-          label: '总重量',
-          align: 'center'
-        },
-        {
-          prop: 'type',
-          label: '入库类型',
-          align: 'center',
-          formatter: (row, column, cellValue) => {
-            return cellValue==1?'生产入库':cellValue==8?'委外入库':''
-          }
-        },
-        {
-          prop: 'approvalUserName',
-          label: '审核人',
-          align: 'center'
-        },
-
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          slot: 'approvalStatus',
-          label: '状态',
-          align: 'center'
-        },
-
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 120,
-          align: 'center',
-          resizable: false,
-          fixed: 'right',
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ];
-    }
-  },
-  created() {},
-  methods: {
-    statusFormatter(status) {
-      const obj = this.statusOpt.find((i) => i.value == status);
-      return obj && obj.label;
+  import { getList } from '@/api/warehousing/index.js';
+
+  import search from './components/search.vue';
+  import tgDetails from './components/tgDetails.vue';
+  import storage from './storageComponents/storage.vue';
+  export default {
+    components: {
+      search,
+      tgDetails,
+      storage
     },
-    /* 表格数据源 */
-    datasource({ page, limit, where }) {
-      return getList({
-        pageNum: page,
-        size: limit,
-        ...where
-      });
-    },
-
-    details(row) {
-      this.$refs.tgDetailsRefs.open(row);
+    data() {
+      return {
+        loading: false,
+
+        statusOpt: [
+          { label: '未提交', value: 0 },
+          { label: '审核中', value: 1 },
+          { label: '审核通过', value: 2 },
+          { label: '审核不通过', value: 3 }
+        ]
+      };
     },
-
-    storage(row) {
-      // let data = JSON.parse(JSON.stringify(row))
-      // data.detailList.forEach(item=>{
-      //   if(data.categoryName.includes('砌块')||data.categoryName.includes('板材')){
-      //     item.packingCount=item.packingCount
-      //   }
-      // })
-      this.$refs.storageRefs.pickerSuccess(row);
+    computed: {
+      // 表格列配置
+      columns() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '编码',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'workOrderCode',
+            label: '工单编码',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'warehouseName',
+            label: '仓库名称	',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'categoryLevelName',
+            label: '物品分类',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryName',
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '批次号',
+            prop: 'batchNo',
+            width: '90',
+            showOverflowTooltip: true
+          },
+          {
+            label: '型号',
+            prop: 'modelType',
+            width: '150',
+            showOverflowTooltip: true
+          },
+          {
+            label: '规格',
+            prop: 'specification',
+            width: '150',
+            showOverflowTooltip: true
+          },
+          {
+            label: '牌号',
+            prop: 'brandNum',
+            width: '50',
+            showOverflowTooltip: true
+          },
+          {
+            slot: 'totalCount',
+            label: '总数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            slot: 'totalPackage',
+            label: '总包装',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            slot: 'totalWeight',
+            label: '总重量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'type',
+            label: '入库类型',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row, column, cellValue) => {
+              return cellValue == 1
+                ? '生产入库'
+                : cellValue == 8
+                ? '委外入库'
+                : '';
+            }
+          },
+          {
+            prop: 'approvalUserName',
+            label: '审核人',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            slot: 'approvalStatus',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ];
+      }
     },
-
-    /* 刷新表格 */
-    reload(where) {
-      this.$nextTick(() => {
-        this.$refs.table.reload({ page: 1, where });
-      });
+    created() {},
+    methods: {
+      statusFormatter(status) {
+        const obj = this.statusOpt.find((i) => i.value == status);
+        return obj && obj.label;
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        return getList({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+      },
+
+      details(row) {
+        this.$refs.tgDetailsRefs.open(row);
+      },
+
+      storage(row) {
+        // let data = JSON.parse(JSON.stringify(row))
+        // data.detailList.forEach(item=>{
+        //   if(data.categoryName.includes('砌块')||data.categoryName.includes('板材')){
+        //     item.packingCount=item.packingCount
+        //   }
+        // })
+        this.$refs.storageRefs.pickerSuccess(row);
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$nextTick(() => {
+          this.$refs.table.reload({ page: 1, where });
+        });
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped></style>