Răsfoiți Sursa

客户退货产品处理审批
合同合成订单

Z 2 ani în urmă
părinte
comite
d40fda08d3

+ 1 - 1
src/api/classifyManage/index.js

@@ -87,7 +87,7 @@ export async function getOutInBySourceBizNo(id) {
   if (res.data.code == 0) {
     return res.data.data;
   }
-  return res.data;
+  return Promise.reject(new Error(res.data.message));
 }
 // 质检
 export async function updateOutInRecord(data) {

+ 26 - 15
src/views/bpm/handleTask/components/contractBook/inventoryTable.vue

@@ -18,7 +18,7 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             @click="handlAdd"
-            v-if="!taskDefinitionKey||(pageName!='businessOpportunity'&&taskDefinitionKey != 'produceLeader')||(pageName=='businessOpportunity'&&['starter','salesmanApprove'].includes(taskDefinitionKey))"
+            v-if="!isContractId&&(!taskDefinitionKey||(pageName!='businessOpportunity'&&taskDefinitionKey != 'produceLeader')||(pageName=='businessOpportunity'&&['starter','salesmanApprove'].includes(taskDefinitionKey)))"
           >
             新增
           </el-button>
@@ -52,7 +52,7 @@
           <el-input
             v-model="row.productName"
             placeholder="请输入"
-            :disabled="taskDefinitionKey == 'produceLeader'"
+            :disabled="taskDefinitionKey == 'produceLeader'||isContractId"
             @click.native="handParent(row, $index)"
           ></el-input>
         </el-form-item>
@@ -62,6 +62,9 @@
           <el-input v-model="row.customerMark" placeholder="请输入"></el-input>
         </el-form-item>
       </template>
+      <template v-slot:headerCustomerMark="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
       <template v-slot:headerProductName="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
@@ -96,7 +99,7 @@
           <el-input
             v-model="scope.row.totalCount"
             placeholder="请输入"
-            :disabled="!!taskDefinitionKey&&taskDefinitionKey!=='salesManagerApprove'"
+            :disabled="!!taskDefinitionKey&&taskDefinitionKey!=='salesManagerApprove'||isContractId"
             @input="getTotalPrice(scope.row)"
           ></el-input>
         </el-form-item>
@@ -154,6 +157,7 @@
           <el-input
             v-model="scope.row.deliveryDays"
             @change="setDeliveryDays(scope.row, scope.$index, 'deliveryDays')"
+            :disabled="isContractId"
             placeholder="请输入"
           ></el-input>
         </el-form-item>
@@ -172,7 +176,7 @@
             >
               <el-input
                 v-model="scope.row.guaranteePeriod"
-                :disabled="!!taskDefinitionKey"
+                :disabled="!!taskDefinitionKey||isContractId"
                 @change="
                   setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
                 "
@@ -184,7 +188,7 @@
             <DictSelection
               dictName="保质期单位"
               clearable
-              :disabled="!!taskDefinitionKey"
+              :disabled="!!taskDefinitionKey||isContractId"
               v-model="scope.row.guaranteePeriodUnitCode"
               @itemChange="(data)=>chaengUnitCode(data,scope.row, scope.$index)"
               @change="
@@ -215,6 +219,7 @@
         >
           <el-input
             v-model="scope.row.remark"
+            :disabled="isContractId"
             type="textarea"
             placeholder="请输入"
           ></el-input>
@@ -235,7 +240,7 @@
             v-model="scope.row.singlePrice"
             placeholder="请输入"
             @input="getTotalPrice"
-            :disabled="!!taskDefinitionKey&&taskDefinitionKey!=='salesManagerApprove'"
+            :disabled="(!!taskDefinitionKey&&taskDefinitionKey!=='salesManagerApprove')||isContractId"
           >
             <template slot="append">元</template>
           </el-input>
@@ -257,7 +262,7 @@
             v-model="row.technicalAnswerName"
             placeholder="请输入"
             @click.native="handHead(row, $index)"
-            :disabled="!isTech"
+            :disabled="!isTech||isContractId"
           ></el-input>
         </el-form-item>
       </template>
@@ -269,7 +274,7 @@
           <el-input
             type="textarea"
             v-model="scope.row.technicalParams"
-            :disabled="!isTech"
+            :disabled="!isTech||isContractId"
             placeholder="请输入"
           ></el-input>
         </el-form-item>
@@ -284,7 +289,7 @@
             module="main"
             :showLib="false"
             :limit="5"
-            :disabled="!isTech"
+            :disabled="!isTech||isContractId"
           />
         </el-form-item>
       </template>
@@ -312,7 +317,7 @@
             module="main"
             :showLib="false"
             :limit="5"
-            :disabled="!isTech"
+            :disabled="!isTech||isContractId"
           />
         </el-form-item>
       </template>
@@ -326,7 +331,7 @@
             module="main"
             :showLib="false"
             :limit="5"
-            :disabled="!isTech"
+            :disabled="!isTech||isContractId"
           />
         </el-form-item>
       </template>
@@ -344,7 +349,7 @@
             v-model="scope.row.produceDeliveryDeadline"
             type="date"
             placeholder="选择日期"
-            :disabled="!isProduction"
+            :disabled="!isProduction||isContractId"
           >
           </el-date-picker>
         </el-form-item>
@@ -365,7 +370,7 @@
             v-model="scope.row.customerExpectDeliveryDeadline"
             type="date"
             placeholder="选择日期"
-            :disabled="!!taskDefinitionKey"
+            :disabled="!!taskDefinitionKey||isContractId"
           >
           </el-date-picker>
         </el-form-item>
@@ -379,7 +384,7 @@
             v-model="scope.row.guaranteePeriodDeadline"
             type="date"
             placeholder="选择日期"
-            :disabled="!!taskDefinitionKey"
+            :disabled="!!taskDefinitionKey||isContractId"
           >
           </el-date-picker>
         </el-form-item>
@@ -397,7 +402,7 @@
         >
           <el-input
             v-model="scope.row.singleWeight"
-            :disabled="!isSingleWeight"
+            :disabled="!isSingleWeight||isContractId"
             @input="singleWeightChange(scope.row)"
             placeholder="请输入"
           ></el-input>
@@ -414,6 +419,7 @@
         >
           <el-input
             v-model="scope.row.technologyRouteName"
+            :disabled="isContractId"
             placeholder="请选择"
             @click.native="openVersion(scope.$index)"
           ></el-input>
@@ -504,6 +510,10 @@
         default: true,
         type: Boolean
       },
+      isContractId: {
+        default: false,
+        type: Boolean
+      },
       taskDefinitionKey: {},
       pageName: { type: String },
       contractBookType: {
@@ -579,6 +589,7 @@
             prop: 'customerMark',
             label: '客户代号',
             slot: 'customerMark',
+            headerSlot: 'headerCustomerMark',
             show: this.isCustomerMark
           },
           {

+ 3 - 3
src/views/bpm/handleTask/components/purchaseOrder/addDialog.vue

@@ -271,15 +271,15 @@
 
       <headerTitle title="产品清单" style="margin-top: 30px"></headerTitle>
 
-      <inventoryTable ref="inventoryTable"></inventoryTable>
+      <inventoryTable ref="inventoryTable" :isContractId='!!form.contractId'></inventoryTable>
       <el-row style="margin-top: 20px">
         <el-col :span="12">
           <el-form-item
-            label="金额"
+            label="优惠总金额"
             prop="payAmount"
             style="margin-bottom: 22px"
           >
-            <el-input clearable v-model="form.payAmount" placeholder="请输入">
+            <el-input clearable v-model="form.payAmount" :disabled="form.contractId" placeholder="请输入">
               <template slot="append">元</template>
             </el-input>
           </el-form-item>

+ 398 - 373
src/views/bpm/handleTask/components/purchaseOrder/inventoryTable.vue

@@ -19,6 +19,7 @@
               icon="el-icon-plus"
               class="ele-btn-icon"
               @click="handlAdd"
+              v-if="!isContractId"
             >
               新增
             </el-button>
@@ -35,6 +36,7 @@
             }"
           >
             <el-input
+              :disabled="isContractId"
               v-model="row.productName"
               placeholder="请输入"
               @click.native="handParent(row, $index)"
@@ -80,6 +82,7 @@
             }"
           >
             <el-input
+              :disabled="isContractId"
               v-model="scope.row.totalCount"
               placeholder="请输入"
               @input="getTotalPrice"
@@ -136,6 +139,7 @@
               v-model="scope.row.deliveryDays"
               @change="setDeliveryDays(scope.row, scope.$index, 'deliveryDays')"
               placeholder="请输入"
+              :disabled="isContractId"
             ></el-input>
           </el-form-item>
         </template>
@@ -153,6 +157,7 @@
               >
                 <el-input
                   v-model="scope.row.guaranteePeriod"
+                  :disabled="isContractId"
                   @change="
                     setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
                   "
@@ -163,6 +168,7 @@
             <div class="borderrightnone">
               <DictSelection
                 dictName="质保期单位"
+                :disabled="isContractId"
                 clearable
                 v-model="scope.row.guaranteePeriodUnitCode"
                 @change="
@@ -180,6 +186,7 @@
             :prop="'datasource.' + scope.$index + '.measuringUnit'"
           >
             <el-input
+              :disabled="isContractId"
               v-model="scope.row.measuringUnit"
               placeholder="请输入"
             ></el-input>
@@ -191,6 +198,7 @@
             :prop="'datasource.' + scope.$index + '.remark'"
           >
             <el-input
+              :disabled="isContractId"
               v-model="scope.row.remark"
               type="textarea"
               placeholder="请输入"
@@ -209,6 +217,7 @@
             }"
           >
             <el-input
+              :disabled="isContractId"
               v-model="scope.row.singlePrice"
               placeholder="请输入"
               @input="getTotalPrice"
@@ -223,6 +232,7 @@
             :prop="'datasource.' + $index + '.technicalAnswerName'"
           >
             <el-input
+              :disabled="isContractId"
               v-model="row.technicalAnswerName"
               placeholder="请输入"
               @click.native="handHead(row, $index)"
@@ -235,6 +245,7 @@
             :prop="'datasource.' + scope.$index + '.technicalParams'"
           >
             <el-input
+              :disabled="isContractId"
               type="textarea"
               v-model="scope.row.technicalParams"
               placeholder="请输入"
@@ -247,6 +258,7 @@
             :prop="'datasource.' + scope.$index + '.technicalDrawings'"
           >
             <fileUpload
+              :disabled="isContractId"
               v-model="scope.row.technicalDrawings"
               module="main"
               :showLib="false"
@@ -259,6 +271,7 @@
             :prop="'datasource.' + scope.$index + '.guaranteePeriodDeadline'"
           >
             <el-date-picker
+              :disabled="isContractId"
               style="width: 140px"
               v-model="scope.row.guaranteePeriodDeadline"
               type="date"
@@ -272,6 +285,7 @@
             :prop="'datasource.' + scope.$index + '.deliveryDeadline'"
           >
             <el-date-picker
+              :disabled="isContractId"
               style="width: 140px"
               v-model="scope.row.deliveryDeadline"
               type="date"
@@ -320,406 +334,417 @@
   </el-form>
 </template>
 <script>
-  import { numberReg } from 'ele-admin';
-  import productList from '@/views/bpm/handleTask/components/quotation/product-list.vue';
-  import dictMixins from '@/mixins/dictMixins';
-  import fileUpload from '@/components/upload/fileUpload';
-  import headList from '@/components/headList';
+import {numberReg} from 'ele-admin';
+import productList from '@/views/bpm/handleTask/components/quotation/product-list.vue';
+import dictMixins from '@/mixins/dictMixins';
+import fileUpload from '@/components/upload/fileUpload';
+import headList from '@/components/headList';
 
-  const dayjs = require('dayjs');
+const dayjs = require('dayjs');
 
-  export default {
-    mixins: [dictMixins],
-    components: {
-      productList,headList,
-      fileUpload
-    },
+export default {
+  mixins: [dictMixins],
+  props: {
+    isContractId: {
+      type: Boolean,
+      default: false
+    }
+  },
+  components: {
+    productList, headList,
+    fileUpload
+  },
 
-    data() {
-      const defaultForm = {
-        key: null,
-        endTime: '',
-        isFirst: 0,
-        name: '',
-        startTime: '',
-        workHour: '',
-        technicalDrawings: []
-      };
-      return {
-        discountTotalPrice: 0.0,
-        allPrice: 0.0,
-        numberReg,
-        defaultForm,
-        contractStartDate: new Date(),
-        form: {
-          datasource: []
-        },
-        rules: {},
+  data() {
+    const defaultForm = {
+      key: null,
+      endTime: '',
+      isFirst: 0,
+      name: '',
+      startTime: '',
+      workHour: '',
+      technicalDrawings: []
+    };
+    return {
+      discountTotalPrice: 0.0,
+      allPrice: 0.0,
+      numberReg,
+      defaultForm,
+      contractStartDate: new Date(),
+      form: {
+        datasource: []
+      },
+      rules: {},
 
-        columns: [
-          {
-            width: 45,
-            type: 'index',
-            columnKey: 'index',
-            align: 'center',
-            fixed: 'left'
-          },
-          {
-            width: 200,
-            prop: 'productName',
-            label: '名称',
-            slot: 'productName'
-          },
-          {
-            width: 120,
-            prop: 'productCode',
-            label: '编码',
-            slot: 'productCode'
-          },
-          {
-            width: 200,
-            prop: 'productCategoryName',
-            label: '类型',
-            slot: 'productCategoryName'
-          },
-          {
-            width: 160,
-            prop: 'productBrand',
-            label: '牌号',
-            slot: 'productBrand'
-          },
-          {
-            width: 120,
-            prop: 'modelType',
-            label: '型号',
-            slot: 'modelType'
-          },
-          {
-            width: 120,
-            prop: 'supplierMark',
-            label: '供应商代号',
-            headerSlot: 'headerSupplierMark',
-            slot: 'supplierMark'
-          },
-          {
-            width: 120,
-            prop: 'specification',
-            label: '规格',
-            slot: 'specification'
-          },
+      columns: [
+        {
+          width: 45,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          width: 200,
+          prop: 'productName',
+          label: '名称',
+          slot: 'productName'
+        },
+        {
+          width: 120,
+          prop: 'productCode',
+          label: '编码',
+          slot: 'productCode'
+        },
+        {
+          width: 200,
+          prop: 'productCategoryName',
+          label: '类型',
+          slot: 'productCategoryName'
+        },
+        {
+          width: 160,
+          prop: 'productBrand',
+          label: '牌号',
+          slot: 'productBrand'
+        },
+        {
+          width: 120,
+          prop: 'modelType',
+          label: '型号',
+          slot: 'modelType'
+        },
+        {
+          width: 120,
+          prop: 'supplierMark',
+          label: '供应商代号',
+          headerSlot: 'headerSupplierMark',
+          slot: 'supplierMark'
+        },
+        {
+          width: 120,
+          prop: 'specification',
+          label: '规格',
+          slot: 'specification'
+        },
 
-          {
-            width: 80,
-            prop: 'totalCount',
-            label: '数量',
-            slot: 'totalCount'
-          },
-          {
-            width: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit'
-          },
-          {
-            width: 160,
-            prop: 'singlePrice',
-            label: '单价',
-            slot: 'singlePrice'
-          },
-          {
-            width: 120,
-            prop: 'totalPrice',
-            label: '合计',
-            slot: 'totalPrice'
-          },
-          // {
-          //   width: 80,
-          //   prop: 'deliveryDays',
-          //   label: '交期(天)',
-          //   slot: 'deliveryDays'
-          // },
-          {
-            width: 160,
-            prop: 'deliveryDeadline',
-            label: '交期截止日期',
-            slot: 'deliveryDeadline'
-          },
-          {
-            width: 200,
-            prop: 'guaranteePeriod',
-            label: '质保期',
-            slot: 'guaranteePeriod'
-          },
-          {
-            width: 160,
-            prop: 'guaranteePeriodDeadline',
-            label: '	质保截止日期',
-            slot: 'guaranteePeriodDeadline'
-          },
-          // {
-          //   width: 120,
-          //   prop: 'guaranteePeriodUnitCode',
-          //   label: '',
-          //   slot: 'guaranteePeriodUnitCode'
-          // },
-          {
-            width: 130,
-            prop: 'technicalAnswerName',
-            label: '技术答疑人',
-            slot: 'technicalAnswerName'
-          },
-          {
-            width: 220,
-            prop: 'technicalParams',
-            label: '技术参数',
-            slot: 'technicalParams'
-          },
-          {
-            width: 240,
-            prop: 'technicalDrawings',
-            label: '技术图纸',
-            slot: 'technicalDrawings'
-          },
-          {
-            width: 220,
-            prop: 'remark',
-            label: '备注',
-            slot: 'remark'
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 120,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            fixed: 'right',
-            showOverflowTooltip: true
-          }
-        ]
-      };
+        {
+          width: 80,
+          prop: 'totalCount',
+          label: '数量',
+          slot: 'totalCount'
+        },
+        {
+          width: 80,
+          prop: 'measuringUnit',
+          label: '计量单位',
+          slot: 'measuringUnit'
+        },
+        {
+          width: 160,
+          prop: 'singlePrice',
+          label: '单价',
+          slot: 'singlePrice'
+        },
+        {
+          width: 120,
+          prop: 'totalPrice',
+          label: '合计',
+          slot: 'totalPrice'
+        },
+        // {
+        //   width: 80,
+        //   prop: 'deliveryDays',
+        //   label: '交期(天)',
+        //   slot: 'deliveryDays'
+        // },
+        {
+          width: 160,
+          prop: 'deliveryDeadline',
+          label: '交期截止日期',
+          slot: 'deliveryDeadline'
+        },
+        {
+          width: 200,
+          prop: 'guaranteePeriod',
+          label: '质保期',
+          slot: 'guaranteePeriod'
+        },
+        {
+          width: 160,
+          prop: 'guaranteePeriodDeadline',
+          label: '	质保截止日期',
+          slot: 'guaranteePeriodDeadline'
+        },
+        // {
+        //   width: 120,
+        //   prop: 'guaranteePeriodUnitCode',
+        //   label: '',
+        //   slot: 'guaranteePeriodUnitCode'
+        // },
+        {
+          width: 130,
+          prop: 'technicalAnswerName',
+          label: '技术答疑人',
+          slot: 'technicalAnswerName'
+        },
+        {
+          width: 220,
+          prop: 'technicalParams',
+          label: '技术参数',
+          slot: 'technicalParams'
+        },
+        {
+          width: 240,
+          prop: 'technicalDrawings',
+          label: '技术图纸',
+          slot: 'technicalDrawings'
+        },
+        {
+          width: 220,
+          prop: 'remark',
+          label: '备注',
+          slot: 'remark'
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 120,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          fixed: 'right',
+          showOverflowTooltip: true
+        }
+      ]
+    };
+  },
+  computed: {
+    canHandl() {
+      return this.form.datasource.length;
     },
-    computed: {
-      canHandl() {
-        return this.form.datasource.length;
-      },
-      contractId() {
-        return this.$store.state.order.contractId;
-      }
+    contractId() {
+      return this.$store.state.order.contractId;
+    }
+  },
+  methods: {
+    // 返回列表数据
+    getTableValue() {
+      let comitDatasource = this.form.datasource;
+      if (comitDatasource.length === 0) return [];
+      comitDatasource.forEach((v) => {
+        v.totalPrice = (v.totalCount * v.singlePrice)?.toFixed(2) || 0;
+        v.guaranteePeriodUnitName = this.getDictValue(
+          '质保期单位',
+          v.guaranteePeriodUnitCode
+        );
+        v.technicalDrawings = Array.isArray(v.technicalDrawings)
+          ? v.technicalDrawings
+          : [];
+      });
+      return comitDatasource;
     },
-    methods: {
-      // 返回列表数据
-      getTableValue() {
-        let comitDatasource = this.form.datasource;
-        if (comitDatasource.length === 0) return [];
-        comitDatasource.forEach((v) => {
-          v.totalPrice = (v.totalCount * v.singlePrice)?.toFixed(2) || 0;
-          v.guaranteePeriodUnitName = this.getDictValue(
-            '质保期单位',
-            v.guaranteePeriodUnitCode
-          );
-          v.technicalDrawings = Array.isArray(v.technicalDrawings)
-            ? v.technicalDrawings
-            : [];
+    getPrice() {
+      return [this.allPrice];
+    },
+    //计算总金额
+    getTotalPrice() {
+      if (this.form.datasource.length) {
+        let datasource = this.form.datasource,
+          sum = 0;
+        datasource.forEach((r) => {
+          if (r.singlePrice && r.totalCount) {
+            sum += r.singlePrice * r.totalCount;
+          }
         });
-        return comitDatasource;
-      },
-      getPrice() {
-        return [this.allPrice];
-      },
-      //计算总金额
-      getTotalPrice() {
-        if (this.form.datasource.length) {
-          let datasource = this.form.datasource,
-            sum = 0;
-          datasource.forEach((r) => {
-            if (r.singlePrice && r.totalCount) {
-              sum += r.singlePrice * r.totalCount;
-            }
-          });
-          let allsum = sum.toFixed(2);
-          this.allPrice = allsum;
-          this.$store.commit('order/setAllcountAmount', allsum);
-        } else {
-          this.allPrice = 0.0;
-        }
-      },
+        let allsum = sum.toFixed(2);
+        this.allPrice = allsum;
+        this.$store.commit('order/setAllcountAmount', allsum);
+      } else {
+        this.allPrice = 0.0;
+      }
+    },
 
-      //修改回显
-      putTableValue(data, contractStartDate) {
-        if (contractStartDate) {
-          this.contractStartDate = contractStartDate;
-        }
-        if (data) {
-          data.forEach((item) => {
-            item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode + '';
+    //修改回显
+    putTableValue(data, contractStartDate) {
+      if (contractStartDate) {
+        this.contractStartDate = contractStartDate;
+      }
+      if (data) {
+        data.forEach((item) => {
+          item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode + '';
 
-            // if (item.deliveryDays) {
-            //   item['deliveryDeadline'] = this.setDay(item.deliveryDays);
-            // }
-          });
-          this.form.datasource = data;
-        }
-      },
-      //选择产品
-      handParent(row, index) {
-        let item = {
-          id: row.productCode
-        };
-        this.$refs.productListRef.open(item, index);
-      },
-      //选择技术人回调
-      changeAnswer(obj, idx) {
-        this.$set(this.form.datasource[idx], 'technicalAnswerId', obj.id);
-        this.$set(this.form.datasource[idx], 'technicalAnswerName', obj.name);
-      },
-      handHead(row, index) {
-        let item = {
-          id: row.technicalAnswerId
-        };
-        this.$refs.headRef.open(item, index);
-      },
-      //选择产品回调
-      changeParent(obj, idx) {
-        console.log(obj, '33333');
-        console.log(idx);
+          // if (item.deliveryDays) {
+          //   item['deliveryDeadline'] = this.setDay(item.deliveryDays);
+          // }
+        });
+        this.form.datasource = data;
+      }
+    },
+    //选择产品
+    handParent(row, index) {
+      let item = {
+        id: row.productCode
+      };
+      this.$refs.productListRef.open(item, index);
+    },
+    //选择技术人回调
+    changeAnswer(obj, idx) {
+      this.$set(this.form.datasource[idx], 'technicalAnswerId', obj.id);
+      this.$set(this.form.datasource[idx], 'technicalAnswerName', obj.name);
+    },
+    handHead(row, index) {
+      let item = {
+        id: row.technicalAnswerId
+      };
+      this.$refs.headRef.open(item, index);
+    },
+    //选择产品回调
+    changeParent(obj, idx) {
+      console.log(obj, '33333');
+      console.log(idx);
 
-        this.$set(this.form.datasource[idx], 'categoryName', obj.name);
-        this.$set(
-          this.form.datasource[idx],
-          'productCategoryId',
-          obj.categoryLevelId
-        );
-        this.$set(this.form.datasource[idx], 'productBrand', obj.brandNum);
+      this.$set(this.form.datasource[idx], 'categoryName', obj.name);
+      this.$set(
+        this.form.datasource[idx],
+        'productCategoryId',
+        obj.categoryLevelId
+      );
+      this.$set(this.form.datasource[idx], 'productBrand', obj.brandNum);
+      this.$set(
+        this.form.datasource[idx],
+        'productCategoryName',
+        obj.categoryLevelPath
+      );
+      this.$set(this.form.datasource[idx], 'productCode', obj.code);
+      this.$set(this.form.datasource[idx], 'productName', obj.name);
+      this.$set(this.form.datasource[idx], 'modelType', obj.modelType);
+      this.$set(
+        this.form.datasource[idx],
+        'measuringUnit',
+        obj.measuringUnit
+      );
+      this.$set(
+        this.form.datasource[idx],
+        'specification',
+        obj.specification
+      );
+    },
+    remove(row) {
+      let index = this.form.datasource.findIndex((n) => n.key == row.key);
+      if (index !== -1) {
+        this.form.datasource.splice(index, 1);
+        this.setSort();
+      }
+    },
+    // 清空表格
+    restTable() {
+      this.form.datasource = [];
+    },
+    // 重新排序
+    setSort() {
+      this.form.datasource.forEach((n, index) => {
+        n.key = index + 1;
+      });
+    },
+    // 添加
+    handlAdd() {
+      let item = JSON.parse(JSON.stringify(this.defaultForm));
+      item.key = this.form.datasource.length + 1;
+      this.form.datasource.push(item);
+    },
+    setDeliveryDays(row, index, type) {
+      if (type == 'deliveryDays') {
         this.$set(
-          this.form.datasource[idx],
-          'productCategoryName',
-          obj.categoryLevelPath
+          this.form.datasource[index],
+          'deliveryDeadline',
+          this.setDay(row.deliveryDays)
         );
-        this.$set(this.form.datasource[idx], 'productCode', obj.code);
-        this.$set(this.form.datasource[idx], 'productName', obj.name);
-        this.$set(this.form.datasource[idx], 'modelType', obj.modelType);
-        this.$set(
-          this.form.datasource[idx],
-          'measuringUnit',
-          obj.measuringUnit
+      }
+      if (type == 'guaranteePeriod') {
+        let guaranteePeriodUnitName = this.guaranteePeriodUnit(
+          row.guaranteePeriodUnitCode
         );
         this.$set(
-          this.form.datasource[idx],
-          'specification',
-          obj.specification
+          this.form.datasource[index],
+          'guaranteePeriodDeadline',
+          guaranteePeriodUnitName != 'second'
+            ? this.setDay(row.guaranteePeriod, guaranteePeriodUnitName)
+            : ''
         );
-      },
-      remove(row) {
-        let index = this.form.datasource.findIndex((n) => n.key == row.key);
-        if (index !== -1) {
-          this.form.datasource.splice(index, 1);
-          this.setSort();
-        }
-      },
-      // 清空表格
-      restTable() {
-        this.form.datasource = [];
-      },
-      // 重新排序
-      setSort() {
-        this.form.datasource.forEach((n, index) => {
-          n.key = index + 1;
-        });
-      },
-      // 添加
-      handlAdd() {
-        let item = JSON.parse(JSON.stringify(this.defaultForm));
-        item.key = this.form.datasource.length + 1;
-        this.form.datasource.push(item);
-      },
-      setDeliveryDays(row, index, type) {
-        if (type == 'deliveryDays') {
-          this.$set(
-            this.form.datasource[index],
-            'deliveryDeadline',
-            this.setDay(row.deliveryDays)
-          );
-        }
-        if (type == 'guaranteePeriod') {
-          let guaranteePeriodUnitName = this.guaranteePeriodUnit(
-            row.guaranteePeriodUnitCode
-          );
-          this.$set(
-            this.form.datasource[index],
-            'guaranteePeriodDeadline',
-            guaranteePeriodUnitName != 'second'
-              ? this.setDay(row.guaranteePeriod, guaranteePeriodUnitName)
-              : ''
-          );
-        }
-      },
-      guaranteePeriodUnit(code) {
-        return code == 3
-          ? 'day'
-          : code == 4
+      }
+    },
+    guaranteePeriodUnit(code) {
+      return code == 3
+        ? 'day'
+        : code == 4
           ? 'month'
           : code == 5
-          ? 'year'
-          : 'second';
-      },
-      setDay(addDay, dateType = 'day') {
-        return dayjs(this.contractStartDate || new Date())
-          .add(addDay, dateType)
-          .format('YYYY-MM-DD');
-      },
+            ? 'year'
+            : 'second';
+    },
+    setDay(addDay, dateType = 'day') {
+      return dayjs(this.contractStartDate || new Date())
+        .add(addDay, dateType)
+        .format('YYYY-MM-DD');
+    },
 
-      validateForm(callback) {
-        //开始表单校验
-        this.$refs.form.validate((valid) => {
-          callback(valid);
-        });
-      }
+    validateForm(callback) {
+      //开始表单校验
+      this.$refs.form.validate((valid) => {
+        callback(valid);
+      });
     }
-  };
+  }
+};
 </script>
 <style lang="scss" scoped>
-  .headbox {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    .amount {
-      font-size: 14px;
-      font-weight: bold;
-      padding-right: 30px;
-    }
-  }
-  .time-form .el-form-item {
-    margin-bottom: 0 !important;
+.headbox {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+    padding-right: 30px;
   }
+}
 
-  ::v-deep .period {
-    display: flex;
-    .borderleftnone {
-      .el-input--medium .el-input__inner {
-        border-top-right-radius: 0;
-        border-bottom-right-radius: 0;
-      }
-    }
-    .borderrightnone {
-      .el-input--medium .el-input__inner {
-        border-top-left-radius: 0;
-        border-bottom-left-radius: 0;
-      }
+.time-form .el-form-item {
+  margin-bottom: 0 !important;
+}
+
+::v-deep .period {
+  display: flex;
+
+  .borderleftnone {
+    .el-input--medium .el-input__inner {
+      border-top-right-radius: 0;
+      border-bottom-right-radius: 0;
     }
   }
 
-  ::v-deep .time-form tbody > tr:hover > td {
-    background-color: transparent !important;
-  }
-  ::v-deep .time-form .el-table tr {
-    background-color: #ffffff;
+  .borderrightnone {
+    .el-input--medium .el-input__inner {
+      border-top-left-radius: 0;
+      border-bottom-left-radius: 0;
+    }
   }
+}
 
-  .pricebox {
-    display: flex;
-    justify-content: flex-start;
-    align-items: center;
-    font-weight: bold;
-  }
+::v-deep .time-form tbody > tr:hover > td {
+  background-color: transparent !important;
+}
+
+::v-deep .time-form .el-table tr {
+  background-color: #ffffff;
+}
+
+.pricebox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  font-weight: bold;
+}
 </style>

+ 473 - 465
src/views/bpm/handleTask/components/saleOrder/addDialog.vue

@@ -28,7 +28,13 @@
             >
             </DictSelection>
           </el-form-item>
-
+          <el-form-item
+            label="生产性订单"
+            prop="needProduce"
+            style="margin-bottom: 22px">
+            <el-radio v-model="form.needProduce" :label="1">是</el-radio>
+            <el-radio v-model="form.needProduce" :label="0">否</el-radio>
+          </el-form-item>
           <el-form-item
             label="销售部门"
             prop="salesDeptId"
@@ -165,7 +171,7 @@
             prop="partaFax"
             style="margin-bottom: 22px"
           >
-            <el-input clearable v-model="form.partaFax" placeholder="请输入" />
+            <el-input clearable v-model="form.partaFax" placeholder="请输入"/>
           </el-form-item>
           <el-form-item
             label="	客户Email"
@@ -249,10 +255,10 @@
             />
           </el-form-item>
           <el-form-item prop="partbTel" label="售出方联系电话">
-            <el-input clearable v-model="form.partbTel" placeholder="请输入" />
+            <el-input clearable v-model="form.partbTel" placeholder="请输入"/>
           </el-form-item>
           <el-form-item prop="partbFax" label="售出方传真">
-            <el-input clearable v-model="form.partbFax" placeholder="请输入" />
+            <el-input clearable v-model="form.partbFax" placeholder="请输入"/>
           </el-form-item>
 
           <el-form-item
@@ -283,11 +289,11 @@
 
       <headerTitle title="产品清单" style="margin-top: 30px"></headerTitle>
 
-      <inventoryTable ref="inventoryTable"></inventoryTable>
+      <inventoryTable ref="inventoryTable" :isContractId='!!form.contractId'></inventoryTable>
       <el-row style="margin-top: 20px">
         <el-col :span="12">
           <el-form-item
-            label="金额"
+            label="优惠总金额"
             prop="payAmount"
             style="margin-bottom: 22px"
           >
@@ -343,499 +349,501 @@
 </template>
 
 <script>
-  import { emailReg, numberReg } from 'ele-admin';
-  // import inventoryTable from './inventoryTable.vue';
-  import inventoryTable from '@/views/bpm/handleTask/components/contractBook/inventoryTable.vue';
+import {emailReg, numberReg} from 'ele-admin';
+// import inventoryTable from './inventoryTable.vue';
+import inventoryTable from '@/views/bpm/handleTask/components/contractBook/inventoryTable.vue';
 
-  import fileUpload from '@/components/upload/fileUpload';
-  import dictMixins from '@/mixins/dictMixins';
-  import parentList from '@/views//bpm/handleTask/components/quotation/parentList.vue';
-  import {
-    getDetail,
-    enterprisePage
-  } from '@/api/bpm/components/contractManage/contractBook';
-  import { getSaleOrderDetail } from '@/api/bpm/components/saleManage/saleorder';
-  import { getcontactlink } from '@/api/bpm/components/saleManage/businessOpportunity.js';
-  import headList from '@/components/headList';
-  import contractListDialog from './contractListDialog.vue';
-  import { listOrganizations } from '@/api/system/organization';
-  import { copyObj } from '@/utils/util';
+import fileUpload from '@/components/upload/fileUpload';
+import dictMixins from '@/mixins/dictMixins';
+import parentList from '@/views//bpm/handleTask/components/quotation/parentList.vue';
+import {
+  getDetail,
+  enterprisePage
+} from '@/api/bpm/components/contractManage/contractBook';
+import {getSaleOrderDetail} from '@/api/bpm/components/saleManage/saleorder';
+import {getcontactlink} from '@/api/bpm/components/saleManage/businessOpportunity.js';
+import headList from '@/components/headList';
+import contractListDialog from './contractListDialog.vue';
+import {listOrganizations} from '@/api/system/organization';
+import {copyObj} from '@/utils/util';
 
-  export default {
-    mixins: [dictMixins],
-    components: {
-      fileUpload,
-      headList,
-      contractListDialog,
-      inventoryTable,
-      parentList
-    },
-    props: {
-      businessId: {
-        default: ''
-      }
-    },
-    data() {
-      let formDef = {
-        id: '',
-        contractId: '',
-        orderFiles: [],
-        contractName: '',
-        deliveryDate: '',
-        payAmount: '',
-        projectName: '',
-        projectId: '',
-        receiveAddress: '',
-        remark: '',
-        saleType: '',
-        saleTypeName: '',
-        totalAmount: '',
+export default {
+  mixins: [dictMixins],
+  components: {
+    fileUpload,
+    headList,
+    contractListDialog,
+    inventoryTable,
+    parentList
+  },
+  props: {
+    businessId: {
+      default: ''
+    }
+  },
+  data() {
+    let formDef = {
+      id: '',
+      contractId: '',
+      orderFiles: [],
+      contractName: '',
+      deliveryDate: '',
+      payAmount: '',
+      projectName: '',
+      projectId: '',
+      receiveAddress: '',
+      remark: '',
+      saleType: '',
+      saleTypeName: '',
+      totalAmount: '',
 
-        partaUnifiedSocialCreditCode: '',
-        partbUnifiedSocialCreditCode: '',
-        partaAddress: '',
-        partaEmail: '',
-        partaFax: '',
-        partaId: '',
-        partaLinkId: '',
-        partaLinkName: '',
-        partaName: '',
-        partaTel: '',
-        partbAddress: '',
-        partbEmail: '',
-        partbFax: '',
-        partbId: '',
-        partbLinkId: '',
-        partbLinkName: '',
-        partbName: '',
-        partbTel: '',
-        settlementMode: '',
-        settlementModeName: ''
-      };
+      partaUnifiedSocialCreditCode: '',
+      partbUnifiedSocialCreditCode: '',
+      partaAddress: '',
+      partaEmail: '',
+      partaFax: '',
+      partaId: '',
+      partaLinkId: '',
+      partaLinkName: '',
+      partaName: '',
+      partaTel: '',
+      partbAddress: '',
+      partbEmail: '',
+      partbFax: '',
+      partbId: '',
+      partbLinkId: '',
+      partbLinkName: '',
+      partbName: '',
+      partbTel: '',
+      settlementMode: '',
+      settlementModeName: '',
+      needProduce: 1,
+    };
 
-      return {
-        clearing: false, //是否清除合同
-        payWayOptions: [],
-        delDetailIds: [],
-        linkNameOptions: [],
-        visible: false,
-        title: '',
-        row: {},
-        activeName: 'base',
-        formDef,
-        form: copyObj(formDef),
-        tableBankData: [],
-        tableLinkData: [],
-        // 组织机构树形结构数据
-        groupTreeData: [],
-        groupData: [],
-        rules: {
-          // deliveryDate: [
-          //   { required: true, message: '请选择交货日期', trigger: 'change' }
-          // ],
-          settlementMode: [
-            { required: true, message: '请选择结算方式', trigger: 'change' }
-          ],
+    return {
+      clearing: false, //是否清除合同
+      payWayOptions: [],
+      delDetailIds: [],
+      linkNameOptions: [],
+      visible: false,
+      title: '',
+      row: {},
+      activeName: 'base',
+      formDef,
+      form: copyObj(formDef),
+      tableBankData: [],
+      tableLinkData: [],
+      // 组织机构树形结构数据
+      groupTreeData: [],
+      groupData: [],
+      rules: {
+        // deliveryDate: [
+        //   { required: true, message: '请选择交货日期', trigger: 'change' }
+        // ],
+        settlementMode: [
+          {required: true, message: '请选择结算方式', trigger: 'change'}
+        ],
 
-          saleType: [
-            { required: true, message: '请选择销售类型', trigger: 'change' }
-          ],
+        saleType: [
+          {required: true, message: '请选择销售类型', trigger: 'change'}
+        ],
 
-          partaName: [
-            { required: true, message: '请选择客户名称', trigger: 'change' }
-          ],
-          partaLinkName: [
-            { required: true, message: '请选择客户联系人', trigger: 'change' }
-          ],
-          acceptUnpack: [
-            { required: true, message: '请选择是否接受', trigger: 'change' }
-          ],
-          partaTel: [
-            {
-              required: true,
-              pattern: numberReg,
-              message: '请输入客户联系电话',
-              trigger: 'blur'
-            }
-          ],
+        partaName: [
+          {required: true, message: '请选择客户名称', trigger: 'change'}
+        ],
+        partaLinkName: [
+          {required: true, message: '请选择客户联系人', trigger: 'change'}
+        ],
+        acceptUnpack: [
+          {required: true, message: '请选择是否接受', trigger: 'change'}
+        ],
+        partaTel: [
+          {
+            required: true,
+            pattern: numberReg,
+            message: '请输入客户联系电话',
+            trigger: 'blur'
+          }
+        ],
 
-          partbName: [
-            { required: true, message: '请输入售出方名称', trigger: 'change' }
-          ],
-          partbLinkName: [
-            { required: true, message: '请输入售出方联系人', trigger: 'change' }
-          ],
-          partbTel: [
-            {
-              required: true,
-              pattern: numberReg,
-              message: '请输入售出方联系电话',
-              trigger: 'blur'
-            }
-          ],
-          partaEmail: [
-            { pattern: emailReg, message: '邮箱格式不正确', trigger: 'blur' }
-          ]
-        },
+        partbName: [
+          {required: true, message: '请输入售出方名称', trigger: 'change'}
+        ],
+        partbLinkName: [
+          {required: true, message: '请输入售出方联系人', trigger: 'change'}
+        ],
+        partbTel: [
+          {
+            required: true,
+            pattern: numberReg,
+            message: '请输入售出方联系电话',
+            trigger: 'blur'
+          }
+        ],
+        partaEmail: [
+          {pattern: emailReg, message: '邮箱格式不正确', trigger: 'blur'}
+        ]
+      },
 
-        // 提交状态
-        loading: false,
-        // 是否是修改
-        isUpdate: false,
-        enterprisePage: []
-      };
+      // 提交状态
+      loading: false,
+      // 是否是修改
+      isUpdate: false,
+      enterprisePage: []
+    };
+  },
+  computed: {
+    allcountAmount() {
+      this.form.payAmount = this.$store.state.order.allcountAmount;
+      return this.$store.state.order.allcountAmount;
+    }
+  },
+  async created() {
+    await this.getGroupAll();
+    await this.getEnterprisePage();
+    await this.getSaleOrderDetail(this.businessId);
+  },
+  methods: {
+    // 选择负责人部门
+    change_principalDep(id) {
+      const info = this.groupData.find((e) => e.id == id);
+      this.form.salesDeptName = info.name;
     },
-    computed: {
-      allcountAmount() {
-        return this.$store.state.order.allcountAmount;
-      }
+    // 获取公司数据
+    getGroupAll() {
+      listOrganizations().then((list) => {
+        this.groupData = list;
+        this.groupTreeData = this.$util.toTreeData({
+          data: list,
+          idField: 'id',
+          parentIdField: 'parentId'
+        });
+      });
     },
-    async created() {
-      await this.getGroupAll();
-      await this.getEnterprisePage();
-      await this.getSaleOrderDetail(this.businessId);
+    listFormatte(data) {
+      return data.filter((item) => item.dictCode !== 0);
     },
-    methods: {
-      // 选择负责人部门
-      change_principalDep(id) {
-        const info = this.groupData.find((e) => e.id == id);
-        this.form.salesDeptName = info.name;
-      },
-      // 获取公司数据
-      getGroupAll() {
-        listOrganizations().then((list) => {
-          this.groupData = list;
-          this.groupTreeData = this.$util.toTreeData({
-            data: list,
-            idField: 'id',
-            parentIdField: 'parentId'
+    //选择供应商
+    changeSupplier(obj) {
+      this.form = Object.assign({}, this.form, {
+        partbId: obj.id,
+        partbName: obj.name,
+        partbAddress: obj.addressName + obj.address,
+        partbLinkId: '',
+        partbLinkName: '',
+        partbEmail: '',
+        partbTel: ''
+      });
+      this.getLinkInfo(obj.id);
+    },
+    //选择合同获取合同的详情
+    async getDetailData(id) {
+      this.loading = true;
+      const data = await getDetail(id);
+      this.loading = false;
+      if (data) {
+        this.$nextTick(() => {
+          let {contractVO} = data;
+          // this.form=contractVOform.receiveAddress
+          let {
+            partaAddress,
+            partaEmail,
+            partaFax,
+            partaId,
+            partaLinkId,
+            partaLinkName,
+            partaName,
+            partaTel,
+            partbAddress,
+            partbEmail,
+            partbFax,
+            partbId,
+            partbLinkId,
+            partbLinkName,
+            partbName,
+            partbTel,
+            totalPrice,
+            discountTotalPrice,
+            partaUnifiedSocialCreditCode,
+            partbUnifiedSocialCreditCode,
+            settlementMode,
+            settlementModeName
+          } = contractVO;
+          this.form = Object.assign({}, this.form, {
+            partaAddress,
+            partaEmail,
+            partaFax,
+            partaId,
+            partaLinkId,
+            partaLinkName,
+            partaName,
+            partaTel,
+            partbAddress,
+            partbEmail,
+            partbFax,
+            partbId,
+            partbLinkId,
+            partbLinkName,
+            partbName,
+            partbTel,
+            totalPrice,
+            discountTotalPrice,
+            partaUnifiedSocialCreditCode,
+            partbUnifiedSocialCreditCode,
+            totalAmount: totalPrice,
+            payAmount: discountTotalPrice,
+            receiveAddress: partaAddress,
+            settlementMode,
+            settlementModeName
           });
+          this.getLinkInfo(partaId);
+          this.$refs.inventoryTable &&
+          this.$refs.inventoryTable.putTableValue(data);
+          this.$store.commit('order/setAllcountAmount', totalPrice);
         });
-      },
-      listFormatte(data) {
-        return data.filter((item) => item.dictCode !== 0);
-      },
-      //选择供应商
-      changeSupplier(obj) {
-        this.form = Object.assign({}, this.form, {
-          partbId: obj.id,
-          partbName: obj.name,
-          partbAddress: obj.addressName + obj.address,
-          partbLinkId: '',
-          partbLinkName: '',
-          partbEmail: '',
-          partbTel: ''
-        });
-        this.getLinkInfo(obj.id);
-      },
-      //选择合同获取合同的详情
-      async getDetailData(id) {
-        this.loading = true;
-        const data = await getDetail(id);
-        this.loading = false;
-        if (data) {
-          this.$nextTick(() => {
-            let { contractVO } = data;
-            // this.form=contractVOform.receiveAddress
-            let {
-              partaAddress,
-              partaEmail,
-              partaFax,
-              partaId,
-              partaLinkId,
-              partaLinkName,
-              partaName,
-              partaTel,
-              partbAddress,
-              partbEmail,
-              partbFax,
-              partbId,
-              partbLinkId,
-              partbLinkName,
-              partbName,
-              partbTel,
-              totalPrice,
-              discountTotalPrice,
-              partaUnifiedSocialCreditCode,
-              partbUnifiedSocialCreditCode,
-              settlementMode,
-              settlementModeName
-            } = contractVO;
-            this.form = Object.assign({}, this.form, {
-              partaAddress,
-              partaEmail,
-              partaFax,
-              partaId,
-              partaLinkId,
-              partaLinkName,
-              partaName,
-              partaTel,
-              partbAddress,
-              partbEmail,
-              partbFax,
-              partbId,
-              partbLinkId,
-              partbLinkName,
-              partbName,
-              partbTel,
-              totalPrice,
-              discountTotalPrice,
-              partaUnifiedSocialCreditCode,
-              partbUnifiedSocialCreditCode,
-              totalAmount: totalPrice,
-              payAmount: discountTotalPrice,
-              receiveAddress: partaAddress,
-              settlementMode,
-              settlementModeName
-            });
-            this.getLinkInfo(partaId);
-            this.$refs.inventoryTable &&
-              this.$refs.inventoryTable.putTableValue(data);
-            this.$store.commit('order/setAllcountAmount', totalPrice);
-          });
-        }
-      },
-
-      //获取订单详情
-      async getSaleOrderDetail(id) {
-        this.loading = true;
-        const data = await getSaleOrderDetail(id);
-        this.loading = false;
-        if (data) {
-          this.$nextTick(() => {
-            data.saleType=+data.saleType
-            this.form = data;
-            this.$refs.inventoryTable &&
-              this.$refs.inventoryTable.putTableValue(data);
-            this.getLinkInfo(data.partaId);
-            this.$store.commit('order/setAllcountAmount', data.totalAmount);
-            this.$store.commit('order/setContractId', data.contractId);
-          });
-        }
-      },
-
-      //更新联系人数据
-      async getLinkInfo(contactId) {
-        const data = await getcontactlink({ contactId });
-        if (data && data?.length) {
-          this.linkNameOptions = data;
-        }
-      },
-      selectFocus() {
-        if (this.linkNameOptions.length === 0) {
-          return this.$message.error('请先选择名称');
-        }
-      },
+      }
+    },
 
-      //选择下拉框
-      onchangeLink(selectedOptions) {
-        const option = this.linkNameOptions.find(
-          (opt) => opt.id === selectedOptions
-        );
-        this.form = Object.assign({}, this.form, {
-          partaEmail: option?.email,
-          partaLinkName: option?.linkName || '',
-          partaTel: option?.mobilePhone || option?.phone || '',
-          partaLinkId: option?.id
+    //获取订单详情
+    async getSaleOrderDetail(id) {
+      this.loading = true;
+      const data = await getSaleOrderDetail(id);
+      this.loading = false;
+      if (data) {
+        this.$nextTick(() => {
+          data.saleType = +data.saleType
+          this.form = data;
+          this.$refs.inventoryTable &&
+          this.$refs.inventoryTable.putTableValue(data);
+          this.getLinkInfo(data.partaId);
+          this.$store.commit('order/setAllcountAmount', data.totalAmount);
+          this.$store.commit('order/setContractId', data.contractId);
         });
-      },
+      }
+    },
 
-      handHead() {
-        let item = {
-          id: this.form.partbLinkId
-        };
-        this.$refs.headRef.open(item);
-      },
+    //更新联系人数据
+    async getLinkInfo(contactId) {
+      const data = await getcontactlink({contactId});
+      if (data && data?.length) {
+        this.linkNameOptions = data;
+      }
+    },
+    selectFocus() {
+      if (this.linkNameOptions.length === 0) {
+        return this.$message.error('请先选择名称');
+      }
+    },
 
-      //选择售出方人回调
-      changePersonel(obj) {
-        this.$set(this.form, 'partbLinkId', obj.id);
-        this.$set(this.form, 'partbLinkName', obj.name);
-        this.$set(this.form, 'partbTel', obj.phone);
-        this.$set(this.form, 'partbEmail', obj.email);
-      },
-      //选择客户回调
-      changeParent(obj) {
-        this.form = Object.assign({}, this.form, {
-          partaId: obj.id,
-          partaName: obj.name,
-          partaAddress: obj.addressName + obj.address,
-          partaLinkId: '',
-          partaLinkName: '',
-          partaEmail: '',
-          partaTel: ''
-        });
-        this.getLinkInfo(obj.id);
-      },
+    //选择下拉框
+    onchangeLink(selectedOptions) {
+      const option = this.linkNameOptions.find(
+        (opt) => opt.id === selectedOptions
+      );
+      this.form = Object.assign({}, this.form, {
+        partaEmail: option?.email,
+        partaLinkName: option?.linkName || '',
+        partaTel: option?.mobilePhone || option?.phone || '',
+        partaLinkId: option?.id
+      });
+    },
 
-      //选择合同回调
-      changeContract(obj) {
-        this.form = Object.assign({}, this.form, {
-          contractId: obj.id,
-          contractName: obj.contractName,
-          contractNo: obj.contractNo
-        });
-        this.getDetailData(obj.id);
-        this.$store.commit('order/setContractId', obj.id);
-      },
+    handHead() {
+      let item = {
+        id: this.form.partbLinkId
+      };
+      this.$refs.headRef.open(item);
+    },
 
-      //选择合同弹框
-      handleContractBtn() {
-        console.log('5556666');
-        if (this.clearing) return;
-        let item = {
-          id: this.form.contractId
-        };
-        this.$refs.selectContractRef.open(item);
-      },
-      //清除合同
-      clearContrcat() {
-        this.clearing = true;
-        let {
-          id,
-          projectName,
-          saleType,
-          saleTypeName,
-          deliveryDate,
-          orderFiles,
-          remark
-        } = this.form;
-        this.form = Object.assign({}, copyObj(this.formDef), {
-          id,
-          projectName,
-          saleType:+saleType,
-          saleTypeName,
-          deliveryDate,
-          orderFiles,
-          remark
-        });
+    //选择售出方人回调
+    changePersonel(obj) {
+      this.$set(this.form, 'partbLinkId', obj.id);
+      this.$set(this.form, 'partbLinkName', obj.name);
+      this.$set(this.form, 'partbTel', obj.phone);
+      this.$set(this.form, 'partbEmail', obj.email);
+    },
+    //选择客户回调
+    changeParent(obj) {
+      this.form = Object.assign({}, this.form, {
+        partaId: obj.id,
+        partaName: obj.name,
+        partaAddress: obj.addressName + obj.address,
+        partaLinkId: '',
+        partaLinkName: '',
+        partaEmail: '',
+        partaTel: ''
+      });
+      this.getLinkInfo(obj.id);
+    },
 
-        this.$store.commit('order/setContractId', '');
-        this.$store.commit('order/setAllcountAmount', 0);
-        this.$refs.inventoryTable.putTableValue([]);
+    //选择合同回调
+    changeContract(obj) {
+      this.form = Object.assign({}, this.form, {
+        contractId: obj.id,
+        contractName: obj.contractName,
+        contractNo: obj.contractNo
+      });
+      this.getDetailData(obj.id);
+      this.$store.commit('order/setContractId', obj.id);
+    },
 
-        setTimeout(() => {
-          this.clearing = false;
-        }, 500);
-      },
+    //选择合同弹框
+    handleContractBtn() {
+      console.log('5556666');
+      if (this.clearing) return;
+      let item = {
+        id: this.form.contractId
+      };
+      this.$refs.selectContractRef.open(item);
+    },
+    //清除合同
+    clearContrcat() {
+      this.clearing = true;
+      let {
+        id,
+        projectName,
+        saleType,
+        saleTypeName,
+        deliveryDate,
+        orderFiles,
+        remark
+      } = this.form;
+      this.form = Object.assign({}, copyObj(this.formDef), {
+        id,
+        projectName,
+        saleType: +saleType,
+        saleTypeName,
+        deliveryDate,
+        orderFiles,
+        remark
+      });
 
-      handParent() {
-        if (this.form.contractId) {
-          return this.$message.error('选择了合同不能更改客户名称');
-        }
-        let item = {
-          id: this.form.contactId
-        };
-        this.$refs.parentRef.open(item);
-      },
+      this.$store.commit('order/setContractId', '');
+      this.$store.commit('order/setAllcountAmount', 0);
+      this.$refs.inventoryTable.putTableValue([]);
 
-      getEnterprisePage() {
-        enterprisePage({
-          pageNum: 1,
-          size: 100
-        }).then((res) => {
-          this.enterprisePage = [];
-          this.enterprisePage.push(...res.list);
-        });
-      },
-      getEnterprise() {
-        let data = this.enterprisePage.find(
-          (item) => item.name == this.form.quoteName
-        );
-        this.form.partbName = data.name;
-        this.form.partbUnifiedSocialCreditCode = data.unifiedSocialCreditCode;
-        this.form.partbFax = data.fax;
-        this.form.partbAddress = data.address;
-      },
-      salesmanChange(val, info) {
-        this.otherForm.salesmanName = info.name;
-      },
-      settlementModeChange(info) {
-        this.form.settlementModeName = info.dictValue;
-      },
-      ifChiefChange(value, idx) {
-        if (value === 1) {
-          this.tableLinkData.forEach((e) => (e.ifChief = 0));
-          this.tableLinkData[idx].ifChief = 1;
-        }
-      },
+      setTimeout(() => {
+        this.clearing = false;
+      }, 500);
+    },
 
-      getValidate() {
-        return Promise.all([
-          new Promise((resolve, reject) => {
-            this.$refs.form.validate((valid) => {
-              if (!valid) {
-                reject(false);
-              } else {
-                resolve(true);
-              }
-            });
-          }),
-          new Promise((resolve, reject) => {
-            this.$refs.inventoryTable.validateForm((valid) => {
-              if (!valid) {
-                reject(false);
-              } else {
-                resolve(true);
-              }
-            });
-          })
-        ]);
-      },
-      async getTableValue() {
-        try {
-          await this.getValidate();
-          // 表单验证通过,执行保存操作
-          this.loading = true;
+    handParent() {
+      if (this.form.contractId) {
+        return this.$message.error('选择了合同不能更改客户名称');
+      }
+      let item = {
+        id: this.form.contactId
+      };
+      this.$refs.parentRef.open(item);
+    },
 
-          if (!this.form.contractId) {
-            this.form.totalAmount = this.allcountAmount;
-          }
+    getEnterprisePage() {
+      enterprisePage({
+        pageNum: 1,
+        size: 100
+      }).then((res) => {
+        this.enterprisePage = [];
+        this.enterprisePage.push(...res.list);
+      });
+    },
+    getEnterprise() {
+      let data = this.enterprisePage.find(
+        (item) => item.name == this.form.quoteName
+      );
+      this.form.partbName = data.name;
+      this.form.partbUnifiedSocialCreditCode = data.unifiedSocialCreditCode;
+      this.form.partbFax = data.fax;
+      this.form.partbAddress = data.address;
+    },
+    salesmanChange(val, info) {
+      this.otherForm.salesmanName = info.name;
+    },
+    settlementModeChange(info) {
+      this.form.settlementModeName = info.dictValue;
+    },
+    ifChiefChange(value, idx) {
+      if (value === 1) {
+        this.tableLinkData.forEach((e) => (e.ifChief = 0));
+        this.tableLinkData[idx].ifChief = 1;
+      }
+    },
 
-          let commitData = Object.assign({}, this.form, {
-            productList: this.$refs.inventoryTable.getTableValue(),
-            saleTypeName: this.getDictValue('销售类型', this.form.saleType)
+    getValidate() {
+      return Promise.all([
+        new Promise((resolve, reject) => {
+          this.$refs.form.validate((valid) => {
+            if (!valid) {
+              reject(false);
+            } else {
+              resolve(true);
+            }
           });
+        }),
+        new Promise((resolve, reject) => {
+          this.$refs.inventoryTable.validateForm((valid) => {
+            if (!valid) {
+              reject(false);
+            } else {
+              resolve(true);
+            }
+          });
+        })
+      ]);
+    },
+    async getTableValue() {
+      try {
+        await this.getValidate();
+        // 表单验证通过,执行保存操作
+        this.loading = true;
 
-          return commitData;
-        } catch (error) {
-          console.log(error);
-          // 表单验证未通过,不执行保存操作
+        if (!this.form.contractId) {
+          this.form.totalAmount = this.allcountAmount;
         }
-      },
-      cancel() {
-        this.$nextTick(() => {
-          this.activeName = 'base';
-          // 关闭后,销毁所有的表单数据
-          this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
-          this.$refs['formRef'] && this.$refs['formRef'].resetFields();
-          this.$store.commit('order/clearUserData');
-          this.form = copyObj(this.formDef);
-          this.visible = false;
+
+        let commitData = Object.assign({}, this.form, {
+          productList: this.$refs.inventoryTable.getTableValue(),
+          saleTypeName: this.getDictValue('销售类型', this.form.saleType)
         });
-      },
-      //查找合同分类对应name
-      findNameById(tree, targetId) {
-        for (let i = 0; i < tree.length; i++) {
-          const node = tree[i];
-          if (node.id === targetId) {
-            return node.name;
-          }
-          if (node.children && node.children.length > 0) {
-            const name = this.findNameById(node.children, targetId);
-            if (name) {
-              return name;
-            }
+
+        return commitData;
+      } catch (error) {
+        console.log(error);
+        // 表单验证未通过,不执行保存操作
+      }
+    },
+    cancel() {
+      this.$nextTick(() => {
+        this.activeName = 'base';
+        // 关闭后,销毁所有的表单数据
+        this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
+        this.$refs['formRef'] && this.$refs['formRef'].resetFields();
+        this.$store.commit('order/clearUserData');
+        this.form = copyObj(this.formDef);
+        this.visible = false;
+      });
+    },
+    //查找合同分类对应name
+    findNameById(tree, targetId) {
+      for (let i = 0; i < tree.length; i++) {
+        const node = tree[i];
+        if (node.id === targetId) {
+          return node.name;
+        }
+        if (node.children && node.children.length > 0) {
+          const name = this.findNameById(node.children, targetId);
+          if (name) {
+            return name;
           }
         }
-        return null;
       }
+      return null;
     }
-  };
+  }
+};
 </script>
 <style scoped lang="scss">
-  .TotalAmount {
-    font-size: 16px;
-    padding-right: 30px;
-  }
+.TotalAmount {
+  font-size: 16px;
+  padding-right: 30px;
+}
 </style>

+ 28 - 26
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrder.vue

@@ -107,7 +107,7 @@
                 :prop="'detailList.' + $index + '.reason'"
                 :rules="{ required: true, trigger: 'blur', message: '请输入' }"
               >
-                <el-input v-if="isTrue" v-model="row.reason"></el-input>
+                <el-input type="textarea" v-if="isTrue" v-model="row.reason"></el-input>
                 <div v-else>{{ row.reason }}</div>
               </el-form-item>
             </template>
@@ -273,7 +273,7 @@
                 <!--                  v-if="isTrue"-->
                 <!--                  v-model="row.unqualifiedType"-->
                 <!--                ></el-input>-->
-                                <div v-else>{{ row.unqualifiedTypeName }}</div>
+                <div v-else>{{ row.unqualifiedTypeName }}</div>
               </el-form-item>
             </template>
             <template v-slot:headerUnqualifiedType="{ column }">
@@ -305,17 +305,20 @@
             </template>
             <!--////-->
             <!--  ///  生产员审核 -->
-            <template v-slot:outHelp="{ row }">
-              <el-form-item prop="outHelp">
-                <el-input v-if="isTrue" v-model="row.outHelp"></el-input>
-                <div v-else>{{ row.outHelp }}</div>
+            <template v-slot:inOrOut="{ row }">
+              <el-form-item prop="inOrOut">
+                <el-select v-if="isTrue" v-model="row.inOrOut" @change="()=>row.outerInfo=''">
+                  <el-option label="内部" :value="1"/>
+                  <el-option label="外部" :value="2"/>
+                </el-select>
+                <div v-else>{{ row.inOrOut && (row.inOrOut == 1 ? '内部' : '外部') }}</div>
               </el-form-item>
             </template>
 
-            <template v-slot:inHelp="{ row }">
-              <el-form-item prop="inHelp">
-                <el-input v-if="isTrue" v-model="row.inHelp"></el-input>
-                <div v-else>{{ row.inHelp }}</div>
+            <template v-slot:outerInfo="{ row }">
+              <el-form-item prop="outerInfo">
+                <el-input v-if="isTrue&&row.inOrOut==2" v-model="row.outerInfo"></el-input>
+                <div v-else>{{ row.outerInfo }}</div>
               </el-form-item>
             </template>
             <!--////-->
@@ -664,7 +667,7 @@ export default {
             headerSlot: 'headerUnqualifiedReasonAnalysis'
           },
           {
-            minWidth: 250,
+            minWidth: 200,
             prop: 'unqualifiedType',
             label: '不合格类型',
             align: 'center',
@@ -718,21 +721,19 @@ export default {
         //生产员审核
         produceApprove: [
           {
-            minWidth: 250,
-            prop: 'outHelp',
-            label: '外部协助',
+            minWidth: 130,
+            prop: 'inOrOut',
+            label: '内部或外部',
             align: 'center',
-            slot: 'outHelp',
-            headerSlot: 'headerOutHelp'
+            slot: 'inOrOut',
           },
           {
-            minWidth: 250,
-            prop: 'inHelp',
-            label: '内部',
+            minWidth: 120,
+            prop: 'outerInfo',
+            label: '外协单位',
             align: 'center',
-            slot: 'inHelp',
-            headerSlot: 'headerInHelp'
-          }
+            slot: 'outerInfo',
+          },
         ],
         //质检员反馈
         QCApprove2: [
@@ -874,7 +875,7 @@ export default {
             item.packingUnit = find.packingUnit;
             item.measuringUnit = find.measuringUnit;
           }
-          item.unqualifiedTypeList = item.unqualifiedType?.split(',') ?? []
+          item.unqualifiedTypeList = item.unqualifiedType ? item.unqualifiedType?.split(',') : []
         });
       }
 
@@ -954,8 +955,8 @@ export default {
                   ifReasonMatch: i.ifReasonMatch,
                   improveCorrect: i.improveCorrect,
                   improveOpinion: i.improveOpinion,
-                  inHelp: i.inHelp,
-                  outHelp: i.outHelp,
+                  outerInfo: i.outerInfo,
+                  inOrOut: i.inOrOut,
                   remark: i.remark,
                   unpackUserId: i.unpackUserId,
                   unpackUserName: i.unpackUserName,
@@ -964,7 +965,8 @@ export default {
                   unqualifiedTypeName: i.unqualifiedTypeName
                 };
               }),
-              returnRecordId: this.form.returnRecordId
+              returnRecordId: this.form.returnRecordId,
+              id: this.form.id
             };
             resolve(params);
           }

+ 7 - 0
src/views/bpm/handleTask/components/saleOrder/detailDialog.vue

@@ -115,6 +115,13 @@
             >
               {{ form.totalAmount }}元
             </el-form-item>
+            <el-form-item
+              label="生产性订单:"
+              prop="totalAmount"
+              style="margin-bottom: 16px"
+            >
+              {{ form.needProduce?'是':'否' }}
+            </el-form-item>
           </el-col>
         </el-row>
         <headerTitle title="基本信息"></headerTitle>

+ 7 - 1
src/views/bpm/handleTask/components/saleOrder/invoice/addInvoiceDialog.vue

@@ -79,7 +79,7 @@
               style="margin-bottom: 22px"
             >
             <span>{{form.orderNo}}</span>
-              
+
             </el-form-item> -->
 
           <el-form-item
@@ -229,6 +229,12 @@
         rules: {
           partaName: [
             { required: true, message: '请选择客户名称', trigger: 'change' }
+          ],
+          linkName: [
+            { required: true, message: '请输入', trigger: ['blur','change'] }
+          ],
+          orderNo: [
+            { required: true, message: '请选择', trigger: 'change' }
           ]
         },
 

+ 4 - 1
src/views/bpm/handleTask/components/saleOrder/invoice/submit.vue

@@ -25,7 +25,7 @@
         size="mini"
         v-if="taskDefinitionKey != 'storemanApprove'||(taskDefinitionKey == 'storemanApprove'&&outInData.verifyStatus==2)"
         @click="handleAudit(1)"
-        
+
         >通过
       </el-button>
       <el-button
@@ -122,8 +122,11 @@
       if (this.taskDefinitionKey == 'storemanApprove') {
         let data = await getSendSaleOrderrecordDetail(this.businessId);
         try {
+          console.log(1111,'1111111111');
           this.outInData = await getOutInBySourceBizNo(data.docNo)
+          console.log(this.outInData,'============');
         } catch (error) {
+          console.log(22222222,'22222222222');
           this.outInData.verifyStatus=0
         }
       }

+ 2 - 2
src/views/bpm/handleTask/components/saleOrder/returnGoods/detailDialog.vue

@@ -34,7 +34,7 @@
             {{ form.totalAmount }}元
           </el-form-item>
           <el-form-item
-            label="备注:"
+            label="退货备注:"
             prop="remark"
             style="margin-bottom: 16px"
           >
@@ -82,7 +82,7 @@
             {{ reviewStatusEnum[form.reviewStatus]?.label }}
           </el-form-item>
           <el-form-item
-            label="货附件:"
+            label="退货附件:"
             prop="returnFiles"
             style="margin-bottom: 16px"
           >