yusheng 1 vuosi sitten
vanhempi
commit
f6c32ae200
23 muutettua tiedostoa jossa 1577 lisäystä ja 1143 poistoa
  1. 37 13
      src/BIZComponents/inventoryTable.vue
  2. 18 0
      src/BIZComponents/inventoryTableDetails.vue
  3. 2 2
      src/BIZComponents/saleGeneralityInventoryTable.vue
  4. 2 1
      src/enum/dict.js
  5. 8 0
      src/views/financialManage/components/planDialog.vue
  6. 33 0
      src/views/purchasingManage/inquiryManage/components/detailDialog.vue
  7. 22 2
      src/views/purchasingManage/inquiryManage/components/inquiryTable.vue
  8. 19 2
      src/views/purchasingManage/inquiryManage/components/inventoryTable.vue
  9. 282 245
      src/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue
  10. 501 454
      src/views/purchasingManage/purchaseNeedManage/components/inventoryTable.vue
  11. 31 9
      src/views/purchasingManage/purchaseOrder/components/addDialog.vue
  12. 73 38
      src/views/purchasingManage/purchaseOrder/components/detailDialog.vue
  13. 27 13
      src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue
  14. 18 1
      src/views/purchasingManage/purchaseOrder/invoice/components/detailDialog.vue
  15. 17 0
      src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue
  16. 362 339
      src/views/purchasingManage/purchaseOrder/outSourceSend/components/detailDialog.vue
  17. 16 0
      src/views/purchasingManage/purchaseOrder/outSourceSend/components/inventoryTable.vue
  18. 19 1
      src/views/purchasingManage/purchaseOrder/returnGoods/components/detailDialog.vue
  19. 17 4
      src/views/purchasingManage/purchaseOrder/returnGoods/components/inventoryTable.vue
  20. 19 0
      src/views/purchasingManage/purchasePlanManage/components/detailDialog.vue
  21. 20 1
      src/views/purchasingManage/purchasePlanManage/components/inventoryTable.vue
  22. 33 17
      src/views/saleManage/contact/components/addContactDialog.vue
  23. 1 1
      src/views/saleManage/contact/components/darwerComponents/contactInfo.vue

+ 37 - 13
src/BIZComponents/inventoryTable.vue

@@ -248,7 +248,6 @@
               style="margin-bottom: 20px"
               :prop="'datasource.' + scope.$index + '.guaranteePeriod'"
               :rules="{
-              
                 pattern: numberReg,
                 message: '请输入质保期',
                 trigger: 'blur'
@@ -469,7 +468,18 @@
           </el-date-picker>
         </el-form-item>
       </template>
-
+      <template v-slot:provenance="scope">
+        <el-form-item :prop="'datasource.' + scope.$index + '.provenance'">
+          <DictSelection
+            dictName="产地"
+            clearable
+            :disabled="status == 'Detail'"
+            v-model="scope.row.provenance"
+            multiple
+          >
+          </DictSelection>
+        </el-form-item>
+      </template>
       <template v-slot:guaranteePeriodDeadline="scope">
         <el-form-item
           :prop="'datasource.' + scope.$index + '.guaranteePeriodDeadline'"
@@ -670,7 +680,7 @@
         //临时
         type: Boolean,
         default: false
-      },
+      }
     },
     data() {
       const defaultForm = {
@@ -834,6 +844,15 @@
             slot: 'availableCountBase',
             align: 'center'
           },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200,
+            show:this.contractBookType==2
+          },
           {
             width: 120,
             prop: 'measuringUnit',
@@ -1023,7 +1042,6 @@
     created() {
       this.requestDict('生产类型');
       this.requestDict('保质期单位');
-      
     },
     methods: {
       openVersion(index) {
@@ -1218,7 +1236,7 @@
             if (supplierObj[item.productId]?.length === 1) {
               item.entrustedEnterpriseId = supplierObj[item.productId][0].id;
             }
-            item['customerMark'] = item.customerMark||this.customerMark;
+            item['customerMark'] = item.customerMark || this.customerMark;
           });
           this.form.datasource = productList;
           if (this.isChangeCount) {
@@ -1232,15 +1250,20 @@
               data.payAmount || data?.contractVO?.discountTotalPrice;
           }
 
-          let codeList = this.form.datasource.filter(item=>item.productCode).map((item) => item.productCode);
+          let codeList = this.form.datasource
+            .filter((item) => item.productCode)
+            .map((item) => item.productCode);
           //获取仓库库存
           let inventoryTotalList = await getInventoryTotalAPI(codeList);
-          this.form.datasource.filter(item=>item.productCode).forEach((item) => {
-            let find =
-              inventoryTotalList.find((key) => key.code == item.productCode) ||
-              {};
-            item.availableCountBase = find.availableCountBase;
-          });
+          this.form.datasource
+            .filter((item) => item.productCode)
+            .forEach((item) => {
+              let find =
+                inventoryTotalList.find(
+                  (key) => key.code == item.productCode
+                ) || {};
+              item.availableCountBase = find.availableCountBase;
+            });
           this.$refs.table.reload();
         }
       },
@@ -1298,7 +1321,7 @@
           );
           console.log(this.customerMark, 'this.customerMark');
           this.$set(parasm, 'customerMark', this.customerMark);
-          // this.$set(parasm, 'supplierMark', this.customerMark);
+          this.$set(parasm, 'provenance', item.purchaseOrigins || []);
 
           if (idx == -1) {
             this.form.datasource.push(row);
@@ -1325,6 +1348,7 @@
       handlAdd() {
         let item = JSON.parse(JSON.stringify(this.defaultForm));
         item.key = this.form.datasource.length + 1;
+        item.customerMark = this.customerMark;
         this.form.datasource.push(item);
       },
 

+ 18 - 0
src/BIZComponents/inventoryTableDetails.vue

@@ -319,6 +319,23 @@
             label: '图号/件号',
             showOverflowTooltip: true
           },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            show:this.contractBookType==2,
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+       
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item ))
+                    .join(',')
+                : '';
+            }
+          },
           {
             width: 120,
             prop: 'produceType',
@@ -448,6 +465,7 @@
     computed: {},
 
     created() {
+      this.requestDict('产地');
       this.requestDict('生产类型');
     },
     methods: {

+ 2 - 2
src/BIZComponents/saleGeneralityInventoryTable.vue

@@ -1279,10 +1279,10 @@
           // this.getTotalPrice();
 
           this.form.discountTotalPrice = data?.contractVO?.discountTotalPrice;
-          let codeList = this.form.datasource.map((item) => item.productCode);
+          let codeList = this.form.datasource.filter((item) => item.productCode).map((item) => item.productCode);
           //获取仓库库存
           let inventoryTotalList = await getInventoryTotalAPI(codeList);
-          this.form.datasource.forEach((item) => {
+          this.form.datasource.filter((item) => item.productCode).forEach((item) => {
             let find =
               inventoryTotalList.find((key) => key.code == item.productCode) ||
               {};

+ 2 - 1
src/enum/dict.js

@@ -59,7 +59,8 @@ export default {
   所属行业:'industry',
   纳税人资质:'taxpayer',
   企业荣誉:"enterprise_honor",
-  企业规模:'enterprise_size'
+  企业规模:'enterprise_size',
+  产地:'purchase_origin'
 };
 
 export const numberList = [

+ 8 - 0
src/views/financialManage/components/planDialog.vue

@@ -55,6 +55,10 @@ export default {
       type: String,
       default: ''
     },
+    collectionId:{
+      type: String,
+      default: ''
+    }
   },
 
   data() {
@@ -177,6 +181,10 @@ export default {
     },
     /* 表格数据源 */
     datasource({page, limit, where, order}) {
+      alert(this.collectionId)
+      if(this.collectionId){
+        where['supplierId']=this.collectionId
+      }
       return getTableList({
         pageNum: page,
         size: limit,

+ 33 - 0
src/views/purchasingManage/inquiryManage/components/detailDialog.vue

@@ -236,6 +236,36 @@
             slot: 'totalWeight',
             align: 'center'
           },
+          {
+            minWidth: 220,
+            prop: 'taskName',
+            label: '工序',
+            slot: 'taskName',
+            align: 'center'
+          },
+          {
+            width: 110,
+            prop: 'batchNo',
+            label: '批次号',
+            slot: 'batchNo',
+            align: 'center'
+          },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+       
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item ))
+                    .join(',')
+                : '';
+            }
+          },
           {
             minWidth: 80,
             prop: 'measuringUnit',
@@ -293,6 +323,9 @@
         ]
       };
     },
+    created(){
+      this.requestDict('产地');
+    },
     methods: {
       // //导出
       // async exportTable() {

+ 22 - 2
src/views/purchasingManage/inquiryManage/components/inquiryTable.vue

@@ -278,7 +278,19 @@
           totalPrice(scope.row.totalCount, scope.row.singlePrice, scope.row)
         }}</span>
       </template>
+      <template v-slot:provenance="scope">
+        <el-form-item :prop="'datasource.' + scope.$index + '.provenance'">
+          <DictSelection
+            dictName="产地"
+            clearable
+            :disabled="status == 'Detail'"
 
+            v-model="scope.row.provenance"
+            multiple
+          >
+          </DictSelection>
+        </el-form-item>
+      </template>
       <template v-slot:modelType="scope" v-if="status !== 'Detail'">
         <el-form-item
           style="margin-bottom: 20px"
@@ -530,6 +542,14 @@
       slot: 'batchNo',
       align: 'center'
     },
+    {
+      prop: 'provenance',
+      label: '产地',
+      slot: 'provenance',
+      align: 'center',
+      showOverflowTooltip: true,
+      minWidth: 200
+    },
     {
       minWidth: 120,
       prop: 'modelType',
@@ -724,10 +744,10 @@
         };
       },
       async getInventoryTotalAPI() {
-        let codeList = this.form.resultList.map((item) => item.productCode);
+        let codeList = this.form.resultList.filter((item) => item.productCode).map((item) => item.productCode);
         //获取仓库库存
         let inventoryTotalList = await getInventoryTotalAPI(codeList);
-        this.form.resultList.forEach((item, index) => {
+        this.form.resultList.filter((item) => item.productCode).forEach((item, index) => {
           let find =
             inventoryTotalList.find((key) => key.code == item.productCode) ||
             {};

+ 19 - 2
src/views/purchasingManage/inquiryManage/components/inventoryTable.vue

@@ -309,6 +309,22 @@
             slot: 'batchNo',
             align: 'center'
           },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+       
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item ))
+                    .join(',')
+                : '';
+            }
+          },
           {
             minWidth: 80,
             prop: 'measuringUnit',
@@ -420,6 +436,7 @@
       }
     },
     created() {
+      this.requestDict('产地');
       this.getDictList('productionType');
     },
     methods: {
@@ -503,10 +520,10 @@
           let supplierList = [],
             supplierIds = [];
           this.form.datasource = data;
-          let codeList = this.form.datasource.map((item) => item.productCode);
+          let codeList = this.form.datasource.filter((item) => item.productCode).map((item) => item.productCode);
           //获取仓库库存
           let inventoryTotalList = await getInventoryTotalAPI(codeList);
-          this.form.datasource.forEach((item, index) => {
+          this.form.datasource.filter((item) => item.productCode).forEach((item, index) => {
             let find =
               inventoryTotalList.find((key) => key.code == item.productCode) ||
               {};

+ 282 - 245
src/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue

@@ -11,8 +11,11 @@
     :fullscreen="fullscreen"
     :modal="isModal"
   >
-  <template slot="title">
-     <modalTitle :title="title" @setFullscreen="fullscreen=!fullscreen"></modalTitle>
+    <template slot="title">
+      <modalTitle
+        :title="title"
+        @setFullscreen="fullscreen = !fullscreen"
+      ></modalTitle>
     </template>
     <div class="switch">
       <div class="switch_left">
@@ -63,19 +66,24 @@
             </el-form-item>
           </el-col>
 
-          <el-col v-if="form.sourceType==1" :span="12">
+          <el-col v-if="form.sourceType == 1" :span="12">
             <el-form-item label="销售合同">
               <el-input v-model="form.saleContractName" disabled></el-input>
             </el-form-item>
           </el-col>
-          <el-col v-if="form.sourceType==1" :span="12">
+          <el-col v-if="form.sourceType == 1" :span="12">
             <el-form-item label="销售订单">
               <el-input v-model="form.saleOrderNo" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item prop="remark" label="是否接受拆单">
-              <el-select v-model="form.acceptUnpack" placeholder="请选择" disabled style="width: 100%">
+              <el-select
+                v-model="form.acceptUnpack"
+                placeholder="请选择"
+                disabled
+                style="width: 100%"
+              >
                 <el-option label="接受" :value="1"></el-option>
                 <el-option label="不接受" :value="0"></el-option>
               </el-select>
@@ -88,13 +96,21 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="用途:" prop="useTo">
-              <el-input type="textarea" v-model="form.useTo" disabled></el-input>
+              <el-input
+                type="textarea"
+                v-model="form.useTo"
+                disabled
+              ></el-input>
             </el-form-item>
           </el-col>
 
           <el-col :span="12">
             <el-form-item prop="remark" label="备注:">
-              <el-input type="textarea" v-model="form.remark" disabled></el-input>
+              <el-input
+                type="textarea"
+                v-model="form.remark"
+                disabled
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -140,34 +156,34 @@
         </template>
 
         <template v-slot:technicalDrawings="{ row }">
-          <fileMain v-model="row.technicalDrawings" type="view" ></fileMain>
-<!--          <div v-if="row.technicalDrawings && row.technicalDrawings?.length">-->
-<!--            <el-link-->
-<!--              v-for="link in row.technicalDrawings"-->
-<!--              :key="link.id"-->
-<!--              type="primary"-->
-<!--              :underline="false"-->
-<!--              @click="downloadFile(link)"-->
-<!--            >-->
-<!--              {{ link.name }}-->
-<!--            </el-link-->
-<!--            >-->
-<!--          </div>-->
+          <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
+          <!--          <div v-if="row.technicalDrawings && row.technicalDrawings?.length">-->
+          <!--            <el-link-->
+          <!--              v-for="link in row.technicalDrawings"-->
+          <!--              :key="link.id"-->
+          <!--              type="primary"-->
+          <!--              :underline="false"-->
+          <!--              @click="downloadFile(link)"-->
+          <!--            >-->
+          <!--              {{ link.name }}-->
+          <!--            </el-link-->
+          <!--            >-->
+          <!--          </div>-->
         </template>
         <template v-slot:files="{ row }">
-          <fileMain v-model="row.files" type="view" ></fileMain>
-<!--          <div v-if="row.files && row.files?.length">-->
-<!--            <el-link-->
-<!--              v-for="link in row.files"-->
-<!--              :key="link.id"-->
-<!--              type="primary"-->
-<!--              :underline="false"-->
-<!--              @click="downloadFile(link)"-->
-<!--            >-->
-<!--              {{ link.name }}-->
-<!--            </el-link-->
-<!--            >-->
-<!--          </div>-->
+          <fileMain v-model="row.files" type="view"></fileMain>
+          <!--          <div v-if="row.files && row.files?.length">-->
+          <!--            <el-link-->
+          <!--              v-for="link in row.files"-->
+          <!--              :key="link.id"-->
+          <!--              type="primary"-->
+          <!--              :underline="false"-->
+          <!--              @click="downloadFile(link)"-->
+          <!--            >-->
+          <!--              {{ link.name }}-->
+          <!--            </el-link-->
+          <!--            >-->
+          <!--          </div>-->
         </template>
       </ele-pro-table>
     </div>
@@ -185,233 +201,254 @@
 </template>
 
 <script>
-import {getDetail} from '@/api/purchasingManage/purchaseNeedManage';
-import {getFile} from '@/api/system/file';
-import dictMixins from '@/mixins/dictMixins';
-import {copyObj} from '@/utils/util';
-import bpmDetail from '@/views/bpm/processInstance/detail.vue';
-import timeDialog from '@/components/timeDialog/index.vue';
-import fileMain from '@/components/addDoc/index';
-import modalTitle from '@/BIZComponents/modalTitle.vue';
-
-export default {
-  mixins: [dictMixins],
-  props: {
-    isModal: {
-      default: true
-    }
-  },
-  components: {
-    bpmDetail, timeDialog,fileMain,modalTitle
-  },
-  data() {
-    return {
-      fullscreen:false,
-      activeComp: 'main',
-      tabOptions: [
-        {key: 'main', name: '需求详情'},
-        {key: 'bpm', name: '流程详情'}
-      ],
-      visible: false,
-      title: '详情',
-      row: {},
-      form: {},
-      detailData: {},
-      columns: [
-        {
-          width: 45,
-          type: 'index',
-          columnKey: 'index',
-          align: 'center',
-          fixed: 'left'
-        },
-        {
-          width: 150,
-          prop: 'productCategoryName',
-          label: '分类',
-          slot: 'productCategoryName',
-          align: 'center',
-        },
-        {
-          width: 140,
-          prop: 'productCode',
-          label: '编码',
-          slot: 'productCode',
-          align: 'center',
-        },
-        {
-          width: 240,
-          prop: 'productName',
-          label: '名称',
-          slot: 'productName',
-          align: 'center',
-        },
-        {
-          width: 150,
-          prop: 'productBrand',
-          label: '牌号',
-          slot: 'productBrand',
-          align: 'center',
-        },
-        {
-          width: 80,
-          prop: 'totalCount',
-          label: '数量',
-          slot: 'totalCount',
-          align: 'center',
-        },
-        {
-          width: 80,
-          prop: 'doneTotalCount',
-          label: '已采数量',
-          align: "center"
+  import { getDetail } from '@/api/purchasingManage/purchaseNeedManage';
+  import { getFile } from '@/api/system/file';
+  import dictMixins from '@/mixins/dictMixins';
+  import { copyObj } from '@/utils/util';
+  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+  import timeDialog from '@/components/timeDialog/index.vue';
+  import fileMain from '@/components/addDoc/index';
+  import modalTitle from '@/BIZComponents/modalTitle.vue';
 
-        },
-        {
-          width: 80,
-          prop: 'waitTotalCount',
-          label: '待采数量',
-          align: "center"
-        },
-        {
-          minWidth: 120,
-          prop: 'taskName',
-          label: '工序',
-          slot: 'taskName',
-          align: "center"
-        },
-        {
-          width: 110,
-          prop: 'batchNo',
-          label: '批次号',
-          slot: 'batchNo',
-          align: "center",
-        },
-        {
-          width: 100,
-          prop: 'measuringUnit',
-          label: '单位',
-          slot: 'measuringUnit',
-          align: 'center',
-        },
-        {
-          width: 130,
-          prop: 'modelType',
-          label: '型号',
-          slot: 'modelType',
-          align: 'center',
-        },
-        {
-          width: 120,
-          prop: 'specification',
-          label: '规格',
-          slot: 'specification',
-          align: 'center',
-        },
-        {
-          width: 130,
-          prop: 'brand',
-          label: '品牌',
-          slot: 'brand',
-          align: 'center',
-        },
-        {
-          width: 150,
-          prop: 'arrivalWay',
-          label: '	到货方式',
-          formatter: (row, column, cellValue) => {
-            return cellValue == 1 ? '一次性到货' : '分批到货';
-          },
-          align: 'center',
-        },
-        {
-          width: 170,
-          prop: 'expectReceiveDate',
-          label: '到货日期',
-          slot: 'expectReceiveDate',
-          align: 'center',
-        },
-        {
-          width: 160,
-          prop: 'technicalDrawings',
-          label: '图纸附件',
-          slot: 'technicalDrawings',
-          align: 'center',
-        },
-        {
-          width: 140,
-          prop: 'files',
-          label: '附件',
-          slot: 'files',
-          align: 'center',
-        },
-        {
-          width: 220,
-          prop: 'remark',
-          label: '备注',
-          slot: 'remark',
-          align: 'center',
-        }
-      ]
-    };
-  },
-  methods: {
-    async open(row) {
-      this.visible = true;
-      this.getDetailData(row.requirementId || row.id);
+  export default {
+    mixins: [dictMixins],
+    props: {
+      isModal: {
+        default: true
+      }
     },
-    cancel() {
-      this.$nextTick(() => {
-        // 关闭后,销毁所有的表单数据
-        (this.form = copyObj(this.formDef)),
-          (this.otherForm = copyObj(this.otherFormDef)),
-          (this.tableBankData = []);
-        this.tableLinkData = [];
-        this.visible = false;
-      });
+    components: {
+      bpmDetail,
+      timeDialog,
+      fileMain,
+      modalTitle
     },
-    downloadFile(file) {
-      getFile({objectName: file.storePath}, file.name);
+    data() {
+      return {
+        fullscreen: false,
+        activeComp: 'main',
+        tabOptions: [
+          { key: 'main', name: '需求详情' },
+          { key: 'bpm', name: '流程详情' }
+        ],
+        visible: false,
+        title: '详情',
+        row: {},
+        form: {},
+        detailData: {},
+        columns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            width: 150,
+            prop: 'productCategoryName',
+            label: '分类',
+            slot: 'productCategoryName',
+            align: 'center'
+          },
+          {
+            width: 140,
+            prop: 'productCode',
+            label: '编码',
+            slot: 'productCode',
+            align: 'center'
+          },
+          {
+            width: 240,
+            prop: 'productName',
+            label: '名称',
+            slot: 'productName',
+            align: 'center'
+          },
+          {
+            width: 150,
+            prop: 'productBrand',
+            label: '牌号',
+            slot: 'productBrand',
+            align: 'center'
+          },
+          {
+            width: 80,
+            prop: 'totalCount',
+            label: '数量',
+            slot: 'totalCount',
+            align: 'center'
+          },
+          {
+            width: 80,
+            prop: 'doneTotalCount',
+            label: '已采数量',
+            align: 'center'
+          },
+          {
+            width: 80,
+            prop: 'waitTotalCount',
+            label: '待采数量',
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'taskName',
+            label: '工序',
+            slot: 'taskName',
+            align: 'center'
+          },
+          {
+            width: 110,
+            prop: 'batchNo',
+            label: '批次号',
+            slot: 'batchNo',
+            align: 'center'
+          },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+       
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item ))
+                    .join(',')
+                : '';
+            }
+          },
+          {
+            width: 100,
+            prop: 'measuringUnit',
+            label: '单位',
+            slot: 'measuringUnit',
+            align: 'center'
+          },
+          {
+            width: 130,
+            prop: 'modelType',
+            label: '型号',
+            slot: 'modelType',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'specification',
+            label: '规格',
+            slot: 'specification',
+            align: 'center'
+          },
+          {
+            width: 130,
+            prop: 'brand',
+            label: '品牌',
+            slot: 'brand',
+            align: 'center'
+          },
+          {
+            width: 150,
+            prop: 'arrivalWay',
+            label: '	到货方式',
+            formatter: (row, column, cellValue) => {
+              return cellValue == 1 ? '一次性到货' : '分批到货';
+            },
+            align: 'center'
+          },
+          {
+            width: 170,
+            prop: 'expectReceiveDate',
+            label: '到货日期',
+            slot: 'expectReceiveDate',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'technicalDrawings',
+            label: '图纸附件',
+            slot: 'technicalDrawings',
+            align: 'center'
+          },
+          {
+            width: 140,
+            prop: 'files',
+            label: '附件',
+            slot: 'files',
+            align: 'center'
+          },
+          {
+            width: 220,
+            prop: 'remark',
+            label: '备注',
+            slot: 'remark',
+            align: 'center'
+          }
+        ]
+      };
     },
-    handleMethod(row) {
-      this.$refs.timeDialogRef.open(row);
+    created() {
+      this.requestDict('产地');
     },
-    async getDetailData(id) {
-      this.loading = true;
-      const data = await getDetail(id);
-      this.loading = false;
-      if (data) {
-        this.form = data;
-        if (this.form.fileId) {
+    methods: {
+      async open(row) {
+        this.visible = true;
+        this.getDetailData(row.requirementId || row.id);
+      },
+      cancel() {
+        this.$nextTick(() => {
+          // 关闭后,销毁所有的表单数据
+          (this.form = copyObj(this.formDef)),
+            (this.otherForm = copyObj(this.otherFormDef)),
+            (this.tableBankData = []);
+          this.tableLinkData = [];
+          this.visible = false;
+        });
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
+      handleMethod(row) {
+        this.$refs.timeDialogRef.open(row);
+      },
+      async getDetailData(id) {
+        this.loading = true;
+        const data = await getDetail(id);
+        this.loading = false;
+        if (data) {
+          this.form = data;
+          if (this.form.fileId) {
             this.form.fileId = JSON.parse(this.form.fileId);
           }
-        this.detailData = data;
-        if (data.files && data.files.length > 0) {
-          this.form.files = data.files[0];
-        } else {
-          this.form.files = null;
+          this.detailData = data;
+          if (data.files && data.files.length > 0) {
+            this.form.files = data.files[0];
+          } else {
+            this.form.files = null;
+          }
         }
       }
     }
-  }
-};
+  };
 </script>
 
 <style scoped lang="scss">
-.ele-dialog-form {
-  .el-form-item {
-    margin-bottom: 10px;
+  .ele-dialog-form {
+    .el-form-item {
+      margin-bottom: 10px;
+    }
   }
-}
 
-.headbox {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
+  .headbox {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
 
-  .amount {
-    font-size: 14px;
-    font-weight: bold;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+    }
   }
-}
 </style>

+ 501 - 454
src/views/purchasingManage/purchaseNeedManage/components/inventoryTable.vue

@@ -19,7 +19,8 @@
               type="primary"
               icon="el-icon-plus"
               class="ele-btn-icon"
-              @click="handParent('',-1)">
+              @click="handParent('', -1)"
+            >
               新增
             </el-button>
             <el-button
@@ -27,11 +28,11 @@
               type="primary"
               icon="el-icon-plus"
               class="ele-btn-icon"
-              @click="handlAdd">
+              @click="handlAdd"
+            >
               新增临时产品
             </el-button>
           </div>
-
         </div>
       </template>
       <template v-slot:productName="{ row, $index }">
@@ -42,7 +43,8 @@
             required: true,
             message: '请输入',
             trigger: 'change'
-          }">
+          }"
+        >
           <el-input
             v-model="row.productName"
             placeholder="请输入"
@@ -53,9 +55,8 @@
             size="small"
             type="primary"
             @click.native="handParent(row, $index)"
-          >选择
-          </el-button
-          >
+            >选择
+          </el-button>
         </el-form-item>
       </template>
       <template v-slot:productCode="scope">
@@ -82,9 +83,8 @@
             size="small"
             type="primary"
             @click.native="handleTaskinstance(scope.row, scope.$index)"
-          >选择
-          </el-button
-          >
+            >选择
+          </el-button>
         </el-form-item>
       </template>
       <template v-slot:productCategoryName="scope">
@@ -221,12 +221,12 @@
           :prop="'datasource.' + scope.$index + '.files'"
         >
           <fileMain v-model="scope.row.files"></fileMain>
-<!--          <fileUpload-->
-<!--            v-model="scope.row.files"-->
-<!--            module="main"-->
-<!--            :showLib="false"-->
-<!--            :limit="5"-->
-<!--          />-->
+          <!--          <fileUpload-->
+          <!--            v-model="scope.row.files"-->
+          <!--            module="main"-->
+          <!--            :showLib="false"-->
+          <!--            :limit="5"-->
+          <!--          />-->
         </el-form-item>
       </template>
       <template v-slot:technicalDrawings="scope">
@@ -234,15 +234,14 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.technicalDrawings'"
         >
-
           <fileMain v-model="scope.row.technicalDrawings"></fileMain>
 
-<!--          <fileUpload-->
-<!--            v-model="scope.row.technicalDrawings"-->
-<!--            module="main"-->
-<!--            :showLib="false"-->
-<!--            :limit="5"-->
-<!--          />-->
+          <!--          <fileUpload-->
+          <!--            v-model="scope.row.technicalDrawings"-->
+          <!--            module="main"-->
+          <!--            :showLib="false"-->
+          <!--            :limit="5"-->
+          <!--          />-->
         </el-form-item>
       </template>
 
@@ -274,7 +273,7 @@
           <el-link
             type="primary"
             :underline="false"
-            @click.native="handleMethod(scope.row,scope.$index)"
+            @click.native="handleMethod(scope.row, scope.$index)"
           >
             设置分批时间
           </el-link>
@@ -304,6 +303,17 @@
           </el-select>
         </el-form-item>
       </template>
+      <template v-slot:provenance="scope">
+        <el-form-item :prop="'datasource.' + scope.$index + '.provenance'">
+          <DictSelection
+            dictName="产地"
+            clearable
+            v-model="scope.row.provenance"
+            multiple
+          >
+          </DictSelection>
+        </el-form-item>
+      </template>
 
       <template v-slot:headerProductName="{ column }">
         <span class="is-required">{{ column.label }}</span>
@@ -344,465 +354,502 @@
     ></product-list>
     <head-list ref="headRef" @changeParent="changeAnswer"></head-list>
     <timeDialog @chooseTime="chooseTime" ref="timeDialogRef"></timeDialog>
-    <taskinstance-dialog ref="taskinstanceDialogRef" v-if="taskinstanceDialogFlag" @saveTaskInstance="saveTaskInstance" :visible.sync="taskinstanceDialogFlag"></taskinstance-dialog>
+    <taskinstance-dialog
+      ref="taskinstanceDialogRef"
+      v-if="taskinstanceDialogFlag"
+      @saveTaskInstance="saveTaskInstance"
+      :visible.sync="taskinstanceDialogFlag"
+    ></taskinstance-dialog>
   </el-form>
 </template>
 <script>
-import {numberReg} from 'ele-admin';
-import productList from '@/BIZComponents/product-list.vue';
-import cBomList from '@/BIZComponents/cBom-list.vue';
-import dictMixins from '@/mixins/dictMixins';
-import fileUpload from '@/components/upload/fileUpload';
-import headList from '@/BIZComponents/user-select/user-select.vue';
-import timeDialog from '@/components/timeDialog/index.vue';
-import {copyObj} from '@/utils/util';
-import {getInventoryTotalAPI} from "@/api/wms";
-import {getByCode} from "@/api/system/dictionary-data";
-import fileMain from "@/components/addDoc/index.vue";
-import taskinstanceDialog from '@/BIZComponents/procedure/taskinstanceDialog.vue'
-export default {
-  mixins: [dictMixins],
-  components: {
-    fileMain,
-    productList,
-    cBomList,
-    fileUpload,
-    headList,
-    timeDialog,
-    taskinstanceDialog
-  },
-  data() {
-    const defaultForm = {
-      key: null,
-      endTime: '',
-      isFirst: 0,
-      name: ''
-    };
-    return {
-      numberReg,
-      defaultForm,
-      arrivalWayList: [
-        {label: '一次性到货', value: 1},
-        {label: '分批到货', value: 2}
-      ],
-      form: {
-        datasource: []
-      },
-      rules: {},
-      dictList: {},
-      taskinstanceDialogFlag:false,
-      columns: [
-        {
-          width: 45,
-          type: 'index',
-          columnKey: 'index',
-          align: 'center'
-        },
-        {
-          width: 120,
-          prop: 'productCategoryName',
-          label: '分类',
-          slot: 'productCategoryName',
-          align: "center"
-        },
-        {
-          width: 140,
-          prop: 'productCode',
-          label: '编码',
-          slot: 'productCode',
-          align: "center"
-        },
-        {
-          minWidth: 240,
-          prop: 'productName',
-          label: '名称',
-          slot: 'productName',
-          headerSlot: 'headerProductName',
-          align: "center"
-        },
-        {
-          width: 80,
-          prop: 'totalCount',
-          label: '数量',
-          slot: 'totalCount',
-          headerSlot: 'headerTotalCount',
-          align: "center"
-        },
-        {
-          width: 80,
-          prop: 'availableCountBase',
-          label: '库存数量',
-          slot: 'availableCountBase',
-          align: "center"
-        },
-        {
-          width: 160,
-          prop: 'arrivalWay',
-          label: '到货方式',
-          slot: 'arrivalWay',
-          headerSlot: 'headerArrivalWay',
-          align: "center"
-        },
-        {
-          width: 170,
-          prop: 'expectReceiveDate',
-          label: '到货日期',
-          slot: 'expectReceiveDate',
-          headerSlot: 'headerExpectReceiveDate',
-          align: "center"
-        },
-        {
-          minWidth: 240,
-          prop: 'taskName',
-          label: '工序',
-          slot: 'taskName',
-          align: "center"
-        },
-        {
-          width: 110,
-          prop: 'batchNo',
-          label: '批次号',
-          slot: 'batchNo',
-          align: "center",
-        },
-        {
-          width: 150,
-          prop: 'productBrand',
-          label: '牌号',
-          slot: 'productBrand',
-          align: "center"
-        },
-        {
-          width: 130,
-          prop: 'modelType',
-          label: '型号',
-          slot: 'modelType',
-          align: "center"
+  import { numberReg } from 'ele-admin';
+  import productList from '@/BIZComponents/product-list.vue';
+  import cBomList from '@/BIZComponents/cBom-list.vue';
+  import dictMixins from '@/mixins/dictMixins';
+  import fileUpload from '@/components/upload/fileUpload';
+  import headList from '@/BIZComponents/user-select/user-select.vue';
+  import timeDialog from '@/components/timeDialog/index.vue';
+  import { copyObj } from '@/utils/util';
+  import { getInventoryTotalAPI } from '@/api/wms';
+  import { getByCode } from '@/api/system/dictionary-data';
+  import fileMain from '@/components/addDoc/index.vue';
+  import taskinstanceDialog from '@/BIZComponents/procedure/taskinstanceDialog.vue';
+  export default {
+    mixins: [dictMixins],
+    components: {
+      fileMain,
+      productList,
+      cBomList,
+      fileUpload,
+      headList,
+      timeDialog,
+      taskinstanceDialog
+    },
+    data() {
+      const defaultForm = {
+        key: null,
+        endTime: '',
+        isFirst: 0,
+        name: ''
+      };
+      return {
+        numberReg,
+        defaultForm,
+        arrivalWayList: [
+          { label: '一次性到货', value: 1 },
+          { label: '分批到货', value: 2 }
+        ],
+        form: {
+          datasource: []
         },
+        rules: {},
+        dictList: {},
+        taskinstanceDialogFlag: false,
+        columns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'productCategoryName',
+            label: '分类',
+            slot: 'productCategoryName',
+            align: 'center'
+          },
+          {
+            width: 140,
+            prop: 'productCode',
+            label: '编码',
+            slot: 'productCode',
+            align: 'center'
+          },
+          {
+            minWidth: 240,
+            prop: 'productName',
+            label: '名称',
+            slot: 'productName',
+            headerSlot: 'headerProductName',
+            align: 'center'
+          },
+          {
+            width: 80,
+            prop: 'totalCount',
+            label: '数量',
+            slot: 'totalCount',
+            headerSlot: 'headerTotalCount',
+            align: 'center'
+          },
+          {
+            width: 80,
+            prop: 'availableCountBase',
+            label: '库存数量',
+            slot: 'availableCountBase',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'arrivalWay',
+            label: '到货方式',
+            slot: 'arrivalWay',
+            headerSlot: 'headerArrivalWay',
+            align: 'center'
+          },
+          {
+            width: 170,
+            prop: 'expectReceiveDate',
+            label: '到货日期',
+            slot: 'expectReceiveDate',
+            headerSlot: 'headerExpectReceiveDate',
+            align: 'center'
+          },
+          {
+            minWidth: 240,
+            prop: 'taskName',
+            label: '工序',
+            slot: 'taskName',
+            align: 'center'
+          },
+          {
+            width: 110,
+            prop: 'batchNo',
+            label: '批次号',
+            slot: 'batchNo',
+            align: 'center'
+          },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
 
-        {
-          width: 120,
-          prop: 'specification',
-          label: '规格',
-          slot: 'specification',
-          align: "center"
-        },
-        {
-          width: 120,
-          prop: 'imgCode',
-          align: 'center',
-          label: '图号/件号',
-          showOverflowTooltip: true
-        },
-        {
-          width: 120,
-          prop: 'produceType',
-          align: 'center',
-          label: '生产类型',
-          showOverflowTooltip: true,
-          formatter: (row, column) => {
-            return row.produceType&&row.produceType.length ? row.produceType.map(item => this.getDictV('productionType', item+'')).join(',') : ''
-          }
-        },
-        {
-          width: 120,
-          prop: 'approvalNumber',
-          align: 'center',
-          label: '批准文号',
-          showOverflowTooltip: true
-        },
-        {
-          width: 120,
-          prop: 'packingSpecification',
-          align: 'center',
-          label: '包装规格',
-          showOverflowTooltip: true
-        },
+          {
+            width: 150,
+            prop: 'productBrand',
+            label: '牌号',
+            slot: 'productBrand',
+            align: 'center'
+          },
+          {
+            width: 130,
+            prop: 'modelType',
+            label: '型号',
+            slot: 'modelType',
+            align: 'center'
+          },
 
-        {
-          width: 100,
-          prop: 'measuringUnit',
-          label: '单位',
-          slot: 'measuringUnit',
-          align: "center"
-        },
+          {
+            width: 120,
+            prop: 'specification',
+            label: '规格',
+            slot: 'specification',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'imgCode',
+            align: 'center',
+            label: '图号/件号',
+            showOverflowTooltip: true
+          },
+          {
+            width: 120,
+            prop: 'produceType',
+            align: 'center',
+            label: '生产类型',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.produceType && row.produceType.length
+                ? row.produceType
+                    .map((item) => this.getDictV('productionType', item + ''))
+                    .join(',')
+                : '';
+            }
+          },
+          {
+            width: 120,
+            prop: 'approvalNumber',
+            align: 'center',
+            label: '批准文号',
+            showOverflowTooltip: true
+          },
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
 
-        {
-          width: 130,
-          prop: 'brand',
-          label: '品牌',
-          slot: 'brand',
-          align: "center"
-        },
+          {
+            width: 100,
+            prop: 'measuringUnit',
+            label: '单位',
+            slot: 'measuringUnit',
+            align: 'center'
+          },
 
-        {
-          width: 160,
-          prop: 'technicalDrawings',
-          label: '图纸附件',
-          slot: 'technicalDrawings'
-        },
-        {
-          width: 160,
-          prop: 'files',
-          label: '附件',
-          slot: 'files'
-        },
-        {
-          width: 220,
-          prop: 'remark',
-          label: '备注',
-          slot: 'remark',
-          align: "center"
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 120,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          fixed: 'right',
-          showOverflowTooltip: true
-        }
-      ]
-    };
-  },
-  created() {
-    this.getDictList('productionType')
-  },
-  methods: {
-    getDictV(code, val) {
-      if (!this.dictList[code]) return '';
-      return this.dictList[code].find(item => item.value == val)?.label
-    },
-    async getDictList(code) {
-      let {data: res} = await getByCode(code)
-      this.dictList[code] = res.map(item => {
-        let values = Object.keys(item)
-        return {
-          value: values[0],
-          label: item[values[0]]
-        }
-      })
-    },
-    // 返回列表数据
-    getTableValue() {
-      let comitDatasource = this.form.datasource;
-      if (comitDatasource.length === 0) return [];
-      comitDatasource.forEach((v) => {
-        v.totalPrice = (v.totalCount * v.singlePrice)?.toFixed(2) || 0;
-        v.files = v.files || [];
-        v.technicalDrawings = v.technicalDrawings || [];
-        v.arrivalBatch = v.arrivalBatch || [];
-      });
-      return comitDatasource;
-    },
-    //修改回显
-    async putTableValue(data) {
-      if (data && data?.length) {
-        this.form.datasource = data;
-        //获取仓库库存
-        let codeList = this.form.datasource.map(item => item.productCode)
-        if(codeList.length){
-          let inventoryTotalList = await getInventoryTotalAPI(codeList);
-          this.form.datasource.forEach((item) => {
-            let find =
-              inventoryTotalList.find((key) => key.code == item.productCode) || {};
-            item.availableCountBase = find.availableCountBase;
-          });
-        }
-        this.$refs.table.reload()
-      }
-    },
-    handleMethod(row,index) {
-      this.$refs.timeDialogRef.open(row,index);
-    },
-    chooseTime({arrivalBatch,index}) {
-      this.$set(this.form.datasource[index], 'arrivalBatch',  copyObj(arrivalBatch));
-    },
-    //cbom新增
-    handCBom(row, index) {
-      this.$refs.cBomRef.open(this.form.datasource, index);
-    },
-    getSelectionCbom(obj, idx = -1) {
-      obj.forEach((item, index) => {
-        let i = idx == -1 ? index : idx;
-        let row = JSON.parse(JSON.stringify(this.defaultForm));
-        row.key = this.form.datasource.length + 1;
-        let parasm = idx == -1 ? row : this.form.datasource[i];
-        this.$set(parasm, 'productId', item.id);
-        // this.$set(parasm, 'id', item.id);
-        this.$set(parasm, 'categoryName', item.name);
-        this.$set(parasm, 'productCategoryId', item.categoryLevelId);
-        this.$set(parasm, 'productBrand', item.brandNum);
-        this.$set(parasm, 'productCategoryName', item.category.categoryLevelPath);
-        this.$set(parasm, 'totalCount', item.dosage);
-        this.$set(parasm, 'productCode', item.code);
-        this.$set(parasm, 'productName', item.name);
-        this.$set(parasm, 'availableCountBase', item.availableCountBase);
-        this.$set(parasm, 'modelType', item.modelType);
-        this.$set(parasm, 'weightUnit', item.unit);
-        this.$set(parasm, 'measuringUnit', item.unit);
-        this.$set(parasm, 'specification', item.specification);
-        this.$set(parasm, 'remark', '');
-        this.$set(parasm, 'imgCode', item.imgCode);
-        this.$set(parasm, 'produceType', item.produceType);
-        this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
-        this.$set(parasm, 'packingSpecification', item.extField?.packingSpecification);
-
-        if (idx == -1) {
-          this.form.datasource.push(row);
-        }
-      })
-    },
-    //选择产品
-    handParent(row, index) {
-      // let item = {
-      //   id: row.productCode
-      // };
+          {
+            width: 130,
+            prop: 'brand',
+            label: '品牌',
+            slot: 'brand',
+            align: 'center'
+          },
 
-      this.$refs.productListRef.open(this.form.datasource, 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
+          {
+            width: 160,
+            prop: 'technicalDrawings',
+            label: '图纸附件',
+            slot: 'technicalDrawings'
+          },
+          {
+            width: 160,
+            prop: 'files',
+            label: '附件',
+            slot: 'files'
+          },
+          {
+            width: 220,
+            prop: 'remark',
+            label: '备注',
+            slot: 'remark',
+            align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 120,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right',
+            showOverflowTooltip: true
+          }
+        ]
       };
-      this.$refs.headRef.open(item, index);
-    },
-    //选择产品回调
-    changeParent(obj = [], idx) {
-
-      // if (
-      //   obj.code &&
-      //   this.form.datasource
-      //     .map((item) => item.productCode)
-      //     .includes(obj.code)
-      // ) {
-      //   this.$message.warning('不能选择重复的产品');
-      //   return;
-      // }
-      obj.forEach((item, index) => {
-        let i = idx == -1 ? index : idx;
-        let row = JSON.parse(JSON.stringify(this.defaultForm));
-        row.key = this.form.datasource.length + 1;
-        let parasm = idx == -1 ? row : this.form.datasource[i];
-        this.$set(parasm, 'productId', item.id);
-        // this.$set(parasm, 'id', item.id);
-        this.$set(parasm, 'categoryName', item.name);
-        this.$set(parasm, 'productCategoryId', item.categoryLevelId);
-        this.$set(parasm, 'productBrand', item.brandNum);
-        this.$set(parasm, 'productCategoryName', item.categoryLevelPath);
-        this.$set(parasm, 'productCode', item.code);
-        this.$set(parasm, 'productName', item.name);
-        this.$set(parasm, 'availableCountBase', item.availableCountBase);
-        this.$set(parasm, 'modelType', item.modelType);
-        this.$set(parasm, 'weightUnit', item.weightUnit);
-        this.$set(parasm, 'measuringUnit', item.measuringUnit);
-        this.$set(parasm, 'specification', item.specification);
-        this.$set(parasm, 'remark', '');
-        this.$set(parasm, 'imgCode', item.imgCode);
-        this.$set(parasm, 'produceType', item.produceType);
-        this.$set(parasm, 'approvalNumber', item.extField.approvalNumber);
-        this.$set(parasm, 'packingSpecification', item.extField.packingSpecification);
-        if (idx == -1) {
-          this.form.datasource.push(row);
-        }
-      })
-    },
-    handleTaskinstance(row,index){
-      this.taskinstanceDialogFlag = true;
-      this.$nextTick(()=>{
-        this.$refs.taskinstanceDialogRef.open(row,index)
-      })
-
     },
-    saveTaskInstance(row={}){
-      this.$set(this.form.datasource[row.index], 'taskId', row.id);
-      this.$set(this.form.datasource[row.index], 'taskName', row.name);
-      this.$set(this.form.datasource[row.index], 'routingId', row.produceRoutingId);
-    },
-    remove(i) {
-      this.form.datasource.splice(i, 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);
+    created() {
+      this.getDictList('productionType');
     },
+    methods: {
+      getDictV(code, val) {
+        if (!this.dictList[code]) return '';
+        return this.dictList[code].find((item) => item.value == val)?.label;
+      },
+      async getDictList(code) {
+        let { data: res } = await getByCode(code);
+        this.dictList[code] = res.map((item) => {
+          let values = Object.keys(item);
+          return {
+            value: values[0],
+            label: item[values[0]]
+          };
+        });
+      },
+      // 返回列表数据
+      getTableValue() {
+        let comitDatasource = this.form.datasource;
+        if (comitDatasource.length === 0) return [];
+        comitDatasource.forEach((v) => {
+          v.totalPrice = (v.totalCount * v.singlePrice)?.toFixed(2) || 0;
+          v.files = v.files || [];
+          v.technicalDrawings = v.technicalDrawings || [];
+          v.arrivalBatch = v.arrivalBatch || [];
+        });
+        return comitDatasource;
+      },
+      //修改回显
+      async putTableValue(data) {
+        if (data && data?.length) {
+          this.form.datasource = data;
+          //获取仓库库存
+          let codeList = this.form.datasource.filter((item) => item.productCode).map((item) => item.productCode);
+          if (codeList.length) {
+            let inventoryTotalList = await getInventoryTotalAPI(codeList);
+            this.form.datasource.filter((item) => item.productCode).forEach((item) => {
+              let find =
+                inventoryTotalList.find(
+                  (key) => key.code == item.productCode
+                ) || {};
+              item.availableCountBase = find.availableCountBase;
+            });
+          }
+          this.$refs.table.reload();
+        }
+      },
+      handleMethod(row, index) {
+        this.$refs.timeDialogRef.open(row, index);
+      },
+      chooseTime({ arrivalBatch, index }) {
+        this.$set(
+          this.form.datasource[index],
+          'arrivalBatch',
+          copyObj(arrivalBatch)
+        );
+      },
+      //cbom新增
+      handCBom(row, index) {
+        this.$refs.cBomRef.open(this.form.datasource, index);
+      },
+      getSelectionCbom(obj, idx = -1) {
+        obj.forEach((item, index) => {
+          let i = idx == -1 ? index : idx;
+          let row = JSON.parse(JSON.stringify(this.defaultForm));
+          row.key = this.form.datasource.length + 1;
+          let parasm = idx == -1 ? row : this.form.datasource[i];
+          this.$set(parasm, 'productId', item.id);
+          // this.$set(parasm, 'id', item.id);
+          this.$set(parasm, 'categoryName', item.name);
+          this.$set(parasm, 'productCategoryId', item.categoryLevelId);
+          this.$set(parasm, 'productBrand', item.brandNum);
+          this.$set(
+            parasm,
+            'productCategoryName',
+            item.category.categoryLevelPath
+          );
+          this.$set(parasm, 'totalCount', item.dosage);
+          this.$set(parasm, 'productCode', item.code);
+          this.$set(parasm, 'productName', item.name);
+          this.$set(parasm, 'availableCountBase', item.availableCountBase);
+          this.$set(parasm, 'modelType', item.modelType);
+          this.$set(parasm, 'weightUnit', item.unit);
+          this.$set(parasm, 'measuringUnit', item.unit);
+          this.$set(parasm, 'specification', item.specification);
+          this.$set(parasm, 'remark', '');
+          this.$set(parasm, 'imgCode', item.imgCode);
+          this.$set(parasm, 'produceType', item.produceType);
+          this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
+          this.$set(
+            parasm,
+            'packingSpecification',
+            item.extField?.packingSpecification
+          );
+          this.$set(parasm, 'provenance', item.purchaseOrigins || []);
 
-    validateForm(callback) {
-      //开始表单校验
-      this.$refs.form.validate((valid,obj) => {
-        if(obj){
-          let messages= Object.keys(obj).map(key=>obj[key][0])
-          if(messages.length>0){
-            this.$message.warning(messages[0].message);
+          if (idx == -1) {
+            this.form.datasource.push(row);
+          }
+        });
+      },
+      //选择产品
+      handParent(row, index) {
+        // let item = {
+        //   id: row.productCode
+        // };
 
+        this.$refs.productListRef.open(this.form.datasource, 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) {
+        // if (
+        //   obj.code &&
+        //   this.form.datasource
+        //     .map((item) => item.productCode)
+        //     .includes(obj.code)
+        // ) {
+        //   this.$message.warning('不能选择重复的产品');
+        //   return;
+        // }
+        obj.forEach((item, index) => {
+          let i = idx == -1 ? index : idx;
+          let row = JSON.parse(JSON.stringify(this.defaultForm));
+          row.key = this.form.datasource.length + 1;
+          let parasm = idx == -1 ? row : this.form.datasource[i];
+          this.$set(parasm, 'productId', item.id);
+          // this.$set(parasm, 'id', item.id);
+          this.$set(parasm, 'categoryName', item.name);
+          this.$set(parasm, 'productCategoryId', item.categoryLevelId);
+          this.$set(parasm, 'productBrand', item.brandNum);
+          this.$set(parasm, 'productCategoryName', item.categoryLevelPath);
+          this.$set(parasm, 'productCode', item.code);
+          this.$set(parasm, 'productName', item.name);
+          this.$set(parasm, 'availableCountBase', item.availableCountBase);
+          this.$set(parasm, 'modelType', item.modelType);
+          this.$set(parasm, 'weightUnit', item.weightUnit);
+          this.$set(parasm, 'measuringUnit', item.measuringUnit);
+          this.$set(parasm, 'specification', item.specification);
+          this.$set(parasm, 'remark', '');
+          this.$set(parasm, 'imgCode', item.imgCode);
+          this.$set(parasm, 'produceType', item.produceType);
+          this.$set(parasm, 'approvalNumber', item.extField.approvalNumber);
+          this.$set(
+            parasm,
+            'packingSpecification',
+            item.extField.packingSpecification
+          );
+          if (idx == -1) {
+            this.form.datasource.push(row);
           }
+        });
+      },
+      handleTaskinstance(row, index) {
+        this.taskinstanceDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.taskinstanceDialogRef.open(row, index);
+        });
+      },
+      saveTaskInstance(row = {}) {
+        this.$set(this.form.datasource[row.index], 'taskId', row.id);
+        this.$set(this.form.datasource[row.index], 'taskName', row.name);
+        this.$set(
+          this.form.datasource[row.index],
+          'routingId',
+          row.produceRoutingId
+        );
+      },
+      remove(i) {
+        this.form.datasource.splice(i, 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);
+      },
 
+      validateForm(callback) {
+        //开始表单校验
+        this.$refs.form.validate((valid, obj) => {
+          if (obj) {
+            let messages = Object.keys(obj).map((key) => obj[key][0]);
+            if (messages.length > 0) {
+              this.$message.warning(messages[0].message);
+            }
           }
-        callback(valid);
-      });
+          callback(valid);
+        });
+      }
     }
-  }
-};
+  };
 </script>
 <style lang="scss" scoped>
-.headbox {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
+  .headbox {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
 
-  .amount {
-    font-size: 14px;
-    font-weight: bold;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+    }
   }
-}
 
-.time-form .el-form-item {
-  margin-bottom: 0 !important;
-}
+  .time-form .el-form-item {
+    margin-bottom: 0 !important;
+  }
 
-::v-deep .period {
-  display: flex;
+  ::v-deep .period {
+    display: flex;
 
-  .borderleftnone {
-    .el-input--medium .el-input__inner {
-      border-top-right-radius: 0;
-      border-bottom-right-radius: 0;
+    .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;
+    .borderrightnone {
+      .el-input--medium .el-input__inner {
+        border-top-left-radius: 0;
+        border-bottom-left-radius: 0;
+      }
     }
   }
-}
 
-::v-deep .time-form tbody > tr:hover > td {
-  background-color: transparent !important;
-}
+  ::v-deep .time-form tbody > tr:hover > td {
+    background-color: transparent !important;
+  }
 
-::v-deep .time-form .el-table tr {
-  background-color: #ffffff;
-}
+  ::v-deep .time-form .el-table tr {
+    background-color: #ffffff;
+  }
 </style>

+ 31 - 9
src/views/purchasingManage/purchaseOrder/components/addDialog.vue

@@ -510,7 +510,11 @@
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
   import personSelect from '@/components/CommomSelect/person-select.vue';
   import parentList from '@/views/purchasingManage/supplierManage/components/parentList.vue';
-  import { enterprisePage, getDetail,updateContractStatus } from '@/api/contractManage/contractBook';
+  import {
+    enterprisePage,
+    getDetail,
+    updateContractStatus
+  } from '@/api/contractManage/contractBook';
   import supplierGoodsListDialog from '@/views/purchasingManage/purchaseOrder/components/supplierGoodsListDialog.vue';
   import {
     addInformation,
@@ -539,7 +543,7 @@
     contactDetail,
     updateRelationStatus
   } from '@/api/saleManage/contact';
-  
+
   export default {
     mixins: [dictMixins],
     components: {
@@ -785,14 +789,18 @@
           },
           productList: info.productList || []
         };
-        const codeList = form.productList.map((item) => item.productCode);
+        const codeList = form.productList
+          .filter((item) => item.productCode)
+          .map((item) => item.productCode);
         let inventoryTotalList = await getInventoryTotalAPI(codeList);
-        form.productList.forEach((item) => {
-          let find =
-            inventoryTotalList.find((key) => key.code == item.productCode) ||
-            {};
-          item.availableCountBase = find.availableCountBase;
-        });
+        form.productList
+          .filter((item) => item.productCode)
+          .forEach((item) => {
+            let find =
+              inventoryTotalList.find((key) => key.code == item.productCode) ||
+              {};
+            item.availableCountBase = find.availableCountBase;
+          });
         this.$refs.inventoryTable &&
           this.$refs.inventoryTable.putTableValue(form.productList);
       },
@@ -1416,6 +1424,7 @@
           await this.getValidate();
           // 表单验证通过,执行保存操作
           this.loading = true;
+          let isTemporary = [];
 
           if (!this.isUpdate) {
             delete this.form.id;
@@ -1436,6 +1445,9 @@
               this.$refs.inventoryTable.getTableValue()) ||
             [];
           tabList.forEach((v, i) => {
+            if (!v.productCode) {
+              isTemporary.push(v.productName);
+            }
             tabList.forEach((v2, j) => {
               if (
                 v.productCode == v2.productCode &&
@@ -1447,6 +1459,16 @@
               }
             });
           });
+
+          if (isTemporary.length > 0) {
+            this.$message.error(
+              isTemporary.toString() +
+                '是临时产品,无法创建订单,请先去主数据维护!'
+            );
+
+            return;
+          }
+
           if (is) {
             this.$message.error('同产品,工序、批次号不能完全一致!');
             return;

+ 73 - 38
src/views/purchasingManage/purchaseOrder/components/detailDialog.vue

@@ -165,16 +165,16 @@
               ></el-input>
             </el-form-item>
             <el-form-item
-            prop="remark"
-            label="是否首工序"
-            v-if="['3', '4', '5', '6','7'].includes(form.sourceType)"
-          >
-            <el-radio-group v-model="form.isFirstProcess" disabled>
-              <el-radio v-for="item in processList" :label="item.value">{{
-                item.label
-              }}</el-radio>
-            </el-radio-group>
-          </el-form-item>
+              prop="remark"
+              label="是否首工序"
+              v-if="['3', '4', '5', '6', '7'].includes(form.sourceType)"
+            >
+              <el-radio-group v-model="form.isFirstProcess" disabled>
+                <el-radio v-for="item in processList" :label="item.value">{{
+                  item.label
+                }}</el-radio>
+              </el-radio-group>
+            </el-form-item>
             <el-form-item label="需求人:" prop="requireUserName">
               <el-input v-model="form.requireUserName" disabled></el-input>
             </el-form-item>
@@ -196,28 +196,28 @@
             </el-form-item> -->
           </el-col>
           <el-col :span="8">
-          <el-form-item label="订单总金额" prop="orderTotalPrice">
-            <el-input v-model="form.orderTotalPrice" disabled />
-          </el-form-item>
-          <el-form-item label="发货总金额" prop="sendTotalPrice">
-            <el-input v-model="form.sendTotalPrice" disabled />
-          </el-form-item>
-          <el-form-item label="发货总数量" prop="sendTotalCount">
-            <el-input v-model="form.sendTotalCount" disabled />
-          </el-form-item>
-          <el-form-item label="收货总金额" prop="receiveTotalPrice">
-            <el-input v-model="form.receiveTotalPrice" disabled />
-          </el-form-item>
-          <el-form-item label="收货总数量" prop="receiveTotalCount">
-            <el-input v-model="form.receiveTotalCount" disabled />
-          </el-form-item>
-          <el-form-item label="退货总金额" prop="returnTotalPrice">
-            <el-input v-model="form.returnTotalPrice" disabled />
-          </el-form-item>
-          <el-form-item label="退货总数量" prop="returnTotalCount">
-            <el-input v-model="form.returnTotalCount" disabled />
-          </el-form-item>
-        </el-col>
+            <el-form-item label="订单总金额" prop="orderTotalPrice">
+              <el-input v-model="form.orderTotalPrice" disabled />
+            </el-form-item>
+            <el-form-item label="发货总金额" prop="sendTotalPrice">
+              <el-input v-model="form.sendTotalPrice" disabled />
+            </el-form-item>
+            <el-form-item label="发货总数量" prop="sendTotalCount">
+              <el-input v-model="form.sendTotalCount" disabled />
+            </el-form-item>
+            <el-form-item label="收货总金额" prop="receiveTotalPrice">
+              <el-input v-model="form.receiveTotalPrice" disabled />
+            </el-form-item>
+            <el-form-item label="收货总数量" prop="receiveTotalCount">
+              <el-input v-model="form.receiveTotalCount" disabled />
+            </el-form-item>
+            <el-form-item label="退货总金额" prop="returnTotalPrice">
+              <el-input v-model="form.returnTotalPrice" disabled />
+            </el-form-item>
+            <el-form-item label="退货总数量" prop="returnTotalCount">
+              <el-input v-model="form.returnTotalCount" disabled />
+            </el-form-item>
+          </el-col>
         </el-row>
         <headerTitle title="基本信息"></headerTitle>
         <el-row>
@@ -367,7 +367,7 @@
         <el-tab-pane
           label="带料清单"
           name="2"
-          v-if="['3', '4', '5', '6','7'].includes(form.sourceType)"
+          v-if="['3', '4', '5', '6', '7'].includes(form.sourceType)"
         >
           <ele-pro-table
             ref="table"
@@ -385,7 +385,7 @@
         <el-tab-pane
           label="产出清单"
           name="3"
-          v-if="['3', '4', '5', '6','7'].includes(form.sourceType)"
+          v-if="['3', '4', '5', '6', '7'].includes(form.sourceType)"
         >
           <ele-pro-table
             ref="table"
@@ -694,8 +694,11 @@
             slot: 'pricingWay',
             align: 'center',
             formatter: (row, column) => {
-              return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
-
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
             }
           },
           {
@@ -710,7 +713,7 @@
             prop: 'taxRate',
             label: '税率',
             slot: 'taxRate',
-            align: 'center',
+            align: 'center'
           },
           {
             width: 160,
@@ -746,6 +749,21 @@
             slot: 'batchNo',
             align: 'center'
           },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item))
+                    .join(',')
+                : '';
+            }
+          },
           {
             width: 120,
             prop: 'deliveryDays',
@@ -953,7 +971,6 @@
             slot: 'weightUnit',
             align: 'center'
           },
-          
 
           {
             width: 110,
@@ -962,6 +979,21 @@
             slot: 'batchNo',
             align: 'center'
           },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item))
+                    .join(',')
+                : '';
+            }
+          },
           {
             width: 120,
             prop: 'deliveryDays',
@@ -1030,6 +1062,9 @@
         ]
       };
     },
+    created() {
+      this.requestDict('产地');
+    },
     methods: {
       async open(row) {
         this.activeName = '1';

+ 27 - 13
src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue

@@ -409,6 +409,17 @@
             </el-date-picker>
           </el-form-item>
         </template>
+        <template v-slot:provenance="scope">
+        <el-form-item :prop="'datasource.' + scope.$index + '.provenance'">
+          <DictSelection
+            dictName="产地"
+            clearable
+            v-model="scope.row.provenance"
+            multiple
+          >
+          </DictSelection>
+        </el-form-item>
+      </template>
         <template v-slot:headerDeadline="{ column }">
           <span class="is-required">{{ column.label }}</span>
         </template>
@@ -448,15 +459,15 @@
           </el-popconfirm>
         </template>
         <template v-slot:pricingWay="scope">
-        <el-form-item :prop="'datasource.' + scope.$index + '.pricingWay'">
-          <el-select
-            v-model="scope.row.pricingWay"
-            placeholder="请选择"
-            :rules="{
+        <el-form-item :prop="'datasource.' + scope.$index + '.pricingWay'"    :rules="{
               required: true,
               message: '请选择计价方式',
               trigger: 'change'
-            }"
+            }">
+          <el-select
+            v-model="scope.row.pricingWay"
+            placeholder="请选择"
+         
           >
             <el-option
               v-for="item in pricingWayList"
@@ -821,12 +832,15 @@
             slot: 'batchNo',
             align: 'center'
           },
-          // {
-          //   width: 80,
-          //   prop: 'deliveryDays',
-          //   label: '交期(天)',
-          //   slot: 'deliveryDays'
-          // },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+
           {
             width: 160,
             prop: 'deliveryDeadline',
@@ -1175,7 +1189,7 @@
           );
           this.$set(parasm, 'supplierMark', this.supplierMark);
           this.$set(parasm, 'batchNo', await getCode('1900101420390125570'));
-
+          this.$set(parasm, 'provenance', item.purchaseOrigins || []);
           if (idx == -1) {
             this.form.datasource.push(row);
           }

+ 18 - 1
src/views/purchasingManage/purchaseOrder/invoice/components/detailDialog.vue

@@ -420,7 +420,21 @@
             slot: 'discountTotalPrice',
             align: 'center'
           },
-
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item))
+                    .join(',')
+                : '';
+            }
+          },
           {
             width: 80,
             prop: 'deliveryDays',
@@ -480,6 +494,9 @@
         ]
       };
     },
+    created(){
+      this.requestDict('产地');
+    },
     methods: {
       async open(row) {
         this.form = row;

+ 17 - 0
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -468,6 +468,21 @@
             slot: 'discountTotalPrice',
             align: 'center'
           },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item))
+                    .join(',')
+                : '';
+            }
+          },
           {
             width: 80,
             prop: 'deliveryDays',
@@ -543,10 +558,12 @@
       };
     },
     created() {
+      this.requestDict('产地');
       getWarehouseList().then((res) => {
         this.warehouseList = res;
       });
     },
+
     computed: {},
     methods: {
       downloadFile(file) {

+ 362 - 339
src/views/purchasingManage/purchaseOrder/outSourceSend/components/detailDialog.vue

@@ -10,8 +10,11 @@
     :fullscreen="fullscreen"
     @close="cancel"
   >
-  <template slot="title">
-     <modalTitle :title="title" @setFullscreen="fullscreen=!fullscreen"></modalTitle>
+    <template slot="title">
+      <modalTitle
+        :title="title"
+        @setFullscreen="fullscreen = !fullscreen"
+      ></modalTitle>
     </template>
     <div class="switch">
       <div class="switch_left">
@@ -20,37 +23,41 @@
             v-for="item in tabOptions"
             :key="item.key"
             :class="{ active: activeComp == item.key }"
-            @click="activeComp = item.key">
+            @click="activeComp = item.key"
+          >
             {{ item.name }}
           </li>
         </ul>
       </div>
     </div>
-    <div v-if="activeComp==='main'">
-      <el-form ref="form" :model="form" :rules="rules" class="el-form-box" label-width="120px">
+    <div v-if="activeComp === 'main'">
+      <el-form
+        ref="form"
+        :model="form"
+        :rules="rules"
+        class="el-form-box"
+        label-width="120px"
+      >
         <headerTitle title="发货信息"></headerTitle>
         <el-row :gutter="20">
           <el-col :span="12">
             <el-form-item
               label="委外发货单编码:"
               prop="code"
-              class="form_item_label">
+              class="form_item_label"
+            >
               <el-input v-model="form.code" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item
-              label="采购订单编码:"
-              prop="orderNo">
+            <el-form-item label="采购订单编码:" prop="orderNo">
               <el-input v-model="form.orderNo" disabled></el-input>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row :gutter="20">
           <el-col :span="12">
-            <el-form-item
-              label="外协单位:"
-              prop="contactName">
+            <el-form-item label="外协单位:" prop="contactName">
               <el-input v-model="form.supplierName" disabled></el-input>
             </el-form-item>
           </el-col>
@@ -59,12 +66,12 @@
             <el-form-item
               label="外协单位联系人:"
               prop="linkName"
-              class="form_item_label">
+              class="form_item_label"
+            >
               <el-input v-model="form.linkName" disabled></el-input>
             </el-form-item>
           </el-col>
-      
-  
+
           <!-- <el-col :span="12">
             <el-form-item
               label="计价方式:">
@@ -75,60 +82,49 @@
             </el-form-item>
           </el-col> -->
           <el-col :span="12">
-            <el-form-item
-              label="外协单位电话:"
-              prop="linkPhone">
+            <el-form-item label="外协单位电话:" prop="linkPhone">
               <el-input v-model="form.linkPhone" disabled></el-input>
             </el-form-item>
           </el-col>
-     
-    
+
           <el-col :span="12">
-            <el-form-item
-              label="发货日期:"
-              prop="sendDate">
+            <el-form-item label="发货日期:" prop="sendDate">
               <el-input v-model="form.sendDate" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item
-              label="发货单号:"
-              prop="sendNoteNo">
+            <el-form-item label="发货单号:" prop="sendNoteNo">
               <el-input v-model="form.sendNoteNo" disabled></el-input>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row :gutter="20">
           <el-col :span="12">
-            <el-form-item
-              label="订单类型:"
-              prop="sourceTypeName">
+            <el-form-item label="订单类型:" prop="sourceTypeName">
               <el-input v-model="form.sourceTypeName" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="车辆号:" prop="carNo" >
+            <el-form-item label="车辆号:" prop="carNo">
               <el-input v-model="form.carNo" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item prop="files" label="附件:">
               <fileMain v-model="form.files" type="view"></fileMain>
-<!--              <div v-if="row.files && row.files?.length">-->
-<!--                <el-link-->
-<!--                  v-for="link in row.files"-->
-<!--                  :key="link.id"-->
-<!--                  type="primary"-->
-<!--                  :underline="false"-->
-<!--                  @click="downloadFile(link)">-->
-<!--                  {{ link.name }}-->
-<!--                </el-link>-->
-<!--              </div>-->
+              <!--              <div v-if="row.files && row.files?.length">-->
+              <!--                <el-link-->
+              <!--                  v-for="link in row.files"-->
+              <!--                  :key="link.id"-->
+              <!--                  type="primary"-->
+              <!--                  :underline="false"-->
+              <!--                  @click="downloadFile(link)">-->
+              <!--                  {{ link.name }}-->
+              <!--                </el-link>-->
+              <!--              </div>-->
             </el-form-item>
           </el-col>
-          <el-col :span="12">
-
-          </el-col>
+          <el-col :span="12"> </el-col>
         </el-row>
       </el-form>
 
@@ -149,23 +145,26 @@
         </template> -->
         <template v-slot:technicalDrawings="{ row }">
           <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
-<!--          <div v-if="row.technicalDrawings && row.technicalDrawings?.length">-->
-<!--            <el-link-->
-<!--              v-for="link in row.technicalDrawings"-->
-<!--              :key="link.id"-->
-<!--              type="primary"-->
-<!--              :underline="false"-->
-<!--              @click="downloadFile(link)"-->
-<!--            >-->
-<!--              {{ link.name }}-->
-<!--            </el-link-->
-<!--            >-->
-<!--          </div>-->
+          <!--          <div v-if="row.technicalDrawings && row.technicalDrawings?.length">-->
+          <!--            <el-link-->
+          <!--              v-for="link in row.technicalDrawings"-->
+          <!--              :key="link.id"-->
+          <!--              type="primary"-->
+          <!--              :underline="false"-->
+          <!--              @click="downloadFile(link)"-->
+          <!--            >-->
+          <!--              {{ link.name }}-->
+          <!--            </el-link-->
+          <!--            >-->
+          <!--          </div>-->
         </template>
       </ele-pro-table>
     </div>
 
-    <bpmDetail v-if="activeComp==='bpm'&&form.processInstanceId" :id="form.processInstanceId"></bpmDetail>
+    <bpmDetail
+      v-if="activeComp === 'bpm' && form.processInstanceId"
+      :id="form.processInstanceId"
+    ></bpmDetail>
 
     <div slot="footer" class="footer">
       <el-button @click="cancel">返回</el-button>
@@ -174,170 +173,172 @@
 </template>
 
 <script>
-import {getFile} from '@/api/system/file';
-import dictMixins from '@/mixins/dictMixins';
-import {reviewStatusEnum} from '@/enum/dict';
-import {copyObj} from '@/utils/util';
-import {
-  getPurchaseOutSourceSendDetailAPI,
-} from '@/api/purchasingManage/outSourceSend';
-import bpmDetail from '@/views/bpm/processInstance/detail.vue';
-import fileUpload from "@/components/upload/fileUpload.vue";
-import fileMain from "@/components/addDoc/index.vue";
-import modalTitle from '@/BIZComponents/modalTitle.vue';
+  import { getFile } from '@/api/system/file';
+  import dictMixins from '@/mixins/dictMixins';
+  import { reviewStatusEnum } from '@/enum/dict';
+  import { copyObj } from '@/utils/util';
+  import { getPurchaseOutSourceSendDetailAPI } from '@/api/purchasingManage/outSourceSend';
+  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+  import fileUpload from '@/components/upload/fileUpload.vue';
+  import fileMain from '@/components/addDoc/index.vue';
+  import modalTitle from '@/BIZComponents/modalTitle.vue';
 
-export default {
-  mixins: [dictMixins],
-  components: {
-    fileMain,
-    fileUpload,
-    bpmDetail,modalTitle
-  },
-  props: {
-    detailDialogFlag: Boolean
-  },
-  data() {
-    return {
-      activeComp: 'main',
-      tabOptions: [
-        {key: 'main', name: '发货单详情'},
-        {key: 'bpm', name: '流程详情'}
-      ],
-      fullscreen:false,
-      reviewStatusEnum,
-      detailId: '',
-      title: '详情',
-      row: {},
-      activeName: 'base',
-      form: {
-        orderFiles: [{name: '222'}]
-      },
-      rules: {},
-      detailData: {},
-
-      competAnalysisListcolumns: [
-        {
-          width: 45,
-          type: 'index',
-          columnKey: 'index',
-          align: 'center',
-          fixed: 'left'
-        },
-        {
-          minWidth: 140,
-          prop: 'productName',
-          label: '名称',
-          slot: 'productName',
-          align: "center"
-        },
-        {
-          minWidth: 120,
-          prop: 'productCode',
-          label: '编码',
-          slot: 'productCode',
-          align: "center"
-        },
-        {
-          minWidth: 100,
-          prop: 'productCategoryName',
-          label: '类型',
-          slot: 'productCategoryName',
-          align: "center"
-        },
-        {
-          width: 160,
-          prop: 'productBrand',
-          label: '牌号',
-          slot: 'productBrand',
-          align: "center"
-        },
-        {
-          width: 120,
-          prop: 'modelType',
-          label: '型号',
-          slot: 'modelType',
-          align: "center"
-        },
-        {
-          width: 120,
-          prop: 'specification',
-          label: '规格',
-          slot: 'specification',
-          align: "center"
-        },
-        {
-          width: 200,
-          prop: 'supplierMark',
-          label: '客户代号',
-          slot: 'supplierMark',
-          align: "center"
-        },
-        {
-          width: 200,
-          prop: 'warehouseName',
-          label: '仓库名称',
-          slot: 'warehouseName',
-          align: "center"
+  export default {
+    mixins: [dictMixins],
+    components: {
+      fileMain,
+      fileUpload,
+      bpmDetail,
+      modalTitle
+    },
+    props: {
+      detailDialogFlag: Boolean
+    },
+    data() {
+      return {
+        activeComp: 'main',
+        tabOptions: [
+          { key: 'main', name: '发货单详情' },
+          { key: 'bpm', name: '流程详情' }
+        ],
+        fullscreen: false,
+        reviewStatusEnum,
+        detailId: '',
+        title: '详情',
+        row: {},
+        activeName: 'base',
+        form: {
+          orderFiles: [{ name: '222' }]
         },
+        rules: {},
+        detailData: {},
 
-        {
-          width: 120,
-          prop: 'totalCount',
-          label: '发货数量',
-          slot: 'totalCount',
-          align: "center"
-        },
-        {
-          minWidth: 120,
-          prop: 'taskName',
-          label: '工序',
-          slot: 'taskName',
-          align: "center"
-        },
-        {
-          width: 110,
-          prop: 'batchNo',
-          label: '批次号',
-          slot: 'batchNo',
-          align: "center",
-        },
-        {
-          width: 120,
-          prop: 'measuringUnit',
-          label: '计量单位',
-          slot: 'measuringUnit',
-          align: "center"
-        },
-        {
-          width: 120,
-          prop: 'singleWeight',
-          label: '单重',
-          slot: 'singleWeight',
-          align: "center"
-        },
-        {
-          width: 100,
-          prop: 'sendTotalWeight',
-          label: '发货总重',
-          slot: 'sendTotalWeight',
-          align: "center"
-        },
-        {
-          width: 100,
-          prop: 'weightUnit',
-          label: '重量单位',
-          slot: 'weightUnit',
-          align: "center"
-        },
-        {
+        competAnalysisListcolumns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            minWidth: 140,
+            prop: 'productName',
+            label: '名称',
+            slot: 'productName',
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'productCode',
+            label: '编码',
+            slot: 'productCode',
+            align: 'center'
+          },
+          {
+            minWidth: 100,
+            prop: 'productCategoryName',
+            label: '类型',
+            slot: 'productCategoryName',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'productBrand',
+            label: '牌号',
+            slot: 'productBrand',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'modelType',
+            label: '型号',
+            slot: 'modelType',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'specification',
+            label: '规格',
+            slot: 'specification',
+            align: 'center'
+          },
+          {
+            width: 200,
+            prop: 'supplierMark',
+            label: '客户代号',
+            slot: 'supplierMark',
+            align: 'center'
+          },
+          {
+            width: 200,
+            prop: 'warehouseName',
+            label: '仓库名称',
+            slot: 'warehouseName',
+            align: 'center'
+          },
+
+          {
+            width: 120,
+            prop: 'totalCount',
+            label: '发货数量',
+            slot: 'totalCount',
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'taskName',
+            label: '工序',
+            slot: 'taskName',
+            align: 'center'
+          },
+          {
+            width: 110,
+            prop: 'batchNo',
+            label: '批次号',
+            slot: 'batchNo',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            slot: 'measuringUnit',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'singleWeight',
+            label: '单重',
+            slot: 'singleWeight',
+            align: 'center'
+          },
+          {
+            width: 100,
+            prop: 'sendTotalWeight',
+            label: '发货总重',
+            slot: 'sendTotalWeight',
+            align: 'center'
+          },
+          {
+            width: 100,
+            prop: 'weightUnit',
+            label: '重量单位',
+            slot: 'weightUnit',
+            align: 'center'
+          },
+          {
             width: 160,
             prop: 'pricingWay',
             label: '计价方式',
             slot: 'pricingWay',
             align: 'center',
             formatter: (row, column) => {
-              return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
-
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
             }
           },
           {
@@ -345,149 +346,171 @@ export default {
             prop: 'taxRate',
             label: '税率',
             slot: 'taxRate',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'singlePrice',
+            label: '单价',
+            slot: 'singlePrice',
+            align: 'center'
+          },
+          {
+            width: 100,
+            prop: 'discountSinglePrice',
+            label: '折让单价',
+            slot: 'discountSinglePrice',
             align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              return _row.discountSinglePrice
+                ? Number(_row.discountSinglePrice).toFixed(2)
+                : '';
+            }
           },
-        {
-          width: 160,
-          prop: 'singlePrice',
-          label: '单价',
-          slot: 'singlePrice',
-          align: "center"
-        },
-        {
-          width: 100,
-          prop: 'discountSinglePrice',
-          label: '折让单价',
-          slot: 'discountSinglePrice',
-          align: "center",
-          formatter: (_row, _column, cellValue) => {
-            return _row.discountSinglePrice
-              ? Number(_row.discountSinglePrice).toFixed(2)
-              : '';
-          }
-        },
 
-        {
-          width: 120,
-          prop: 'totalPrice',
-          label: '合计',
-          slot: 'totalPrice',
-          formatter: (_row, _column, cellValue) => {
-            return _row.totalPrice + '元';
+          {
+            width: 120,
+            prop: 'totalPrice',
+            label: '合计',
+            slot: 'totalPrice',
+            formatter: (_row, _column, cellValue) => {
+              return _row.totalPrice + '元';
+            },
+            align: 'center'
           },
-          align: "center"
-        },
-        {
-          width: 100,
-          prop: 'discountTotalPrice',
-          label: '折让合计',
-          slot: 'discountTotalPrice',
-          align: "center",
-          formatter: (_row, _column, cellValue) => {
-            return _row.discountTotalPrice
-              ? Number(_row.discountTotalPrice).toFixed(2)
-              : '';
-          }
-        },
-        {
-          width: 120,
-          prop: 'deliveryDays',
-          label: '交期(天)',
-          slot: 'deliveryDays',
-          align: "center"
-        },
-        {
-          width: 200,
-          prop: 'guaranteePeriod',
-          label: '质保期',
-          slot: 'guaranteePeriod',
-          formatter: (_row, _column, cellValue) => {
-            return (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName;
+          {
+            width: 100,
+            prop: 'discountTotalPrice',
+            label: '折让合计',
+            slot: 'discountTotalPrice',
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              return _row.discountTotalPrice
+                ? Number(_row.discountTotalPrice).toFixed(2)
+                : '';
+            }
           },
-          align: "center"
-        },
-        // {
-        //   width: 120,
-        //   prop: 'guaranteePeriodUnitCode',
-        //   label: '',
-        //   slot: 'guaranteePeriodUnitCode'
-        // },
-        {
-          width: 120,
-          prop: 'technicalAnswerName',
-          label: '技术答疑人',
-          slot: 'technicalAnswerName',
-          align: "center"
-        },
-        {
-          width: 220,
-          prop: 'technicalParams',
-          label: '技术参数',
-          slot: 'technicalParams',
-          align: "center"
-        },
-        {
-          width: 240,
-          prop: 'technicalDrawings',
-          label: '技术图纸',
-          slot: 'technicalDrawings',
-          formatter: (_row, _column, cellValue) => {
-            return (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName;
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item))
+                    .join(',')
+                : '';
+            }
           },
-          align: "center"
-        },
-        {
-          width: 220,
-          prop: 'remark',
-          label: '备注',
-          slot: 'remark',
-          align: "center"
-        }
-      ]
-    };
-  },
-  methods: {
-    async open(row) {
-      this.form = row;
-      this.getDetailData(row.id);
-      this.detailId = row.id;
-    },
-    //关闭弹窗
-    cancel() {
-      this.$emit('update:detailDialogFlag', false)
+          {
+            width: 120,
+            prop: 'deliveryDays',
+            label: '交期(天)',
+            slot: 'deliveryDays',
+            align: 'center'
+          },
+          {
+            width: 200,
+            prop: 'guaranteePeriod',
+            label: '质保期',
+            slot: 'guaranteePeriod',
+            formatter: (_row, _column, cellValue) => {
+              return (
+                (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
+              );
+            },
+            align: 'center'
+          },
+          // {
+          //   width: 120,
+          //   prop: 'guaranteePeriodUnitCode',
+          //   label: '',
+          //   slot: 'guaranteePeriodUnitCode'
+          // },
+          {
+            width: 120,
+            prop: 'technicalAnswerName',
+            label: '技术答疑人',
+            slot: 'technicalAnswerName',
+            align: 'center'
+          },
+          {
+            width: 220,
+            prop: 'technicalParams',
+            label: '技术参数',
+            slot: 'technicalParams',
+            align: 'center'
+          },
+          {
+            width: 240,
+            prop: 'technicalDrawings',
+            label: '技术图纸',
+            slot: 'technicalDrawings',
+            formatter: (_row, _column, cellValue) => {
+              return (
+                (_row.guaranteePeriod || '') + _row.guaranteePeriodUnitName
+              );
+            },
+            align: 'center'
+          },
+          {
+            width: 220,
+            prop: 'remark',
+            label: '备注',
+            slot: 'remark',
+            align: 'center'
+          }
+        ]
+      };
     },
-    downloadFile(file) {
-      getFile({objectName: file.storePath}, file.name);
+    created() {
+      this.requestDict('产地');
     },
-    async getDetailData(id) {
-      this.loading = true;
-      const data = await getPurchaseOutSourceSendDetailAPI(id);
-      this.loading = false;
-      if (data) {
-        this.form = data;
-        this.detailData = data;
+    methods: {
+      async open(row) {
+        this.form = row;
+        this.getDetailData(row.id);
+        this.detailId = row.id;
+      },
+      //关闭弹窗
+      cancel() {
+        this.$emit('update:detailDialogFlag', false);
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
+      async getDetailData(id) {
+        this.loading = true;
+        const data = await getPurchaseOutSourceSendDetailAPI(id);
+        this.loading = false;
+        if (data) {
+          this.form = data;
+          this.detailData = data;
+        }
       }
     }
-  }
-};
+  };
 </script>
 
 <style scoped lang="scss">
-.ele-dialog-form {
-  .el-form-item {
-    margin-bottom: 10px;
+  .ele-dialog-form {
+    .el-form-item {
+      margin-bottom: 10px;
+    }
   }
-}
 
-.headbox {
-  display: flex;
-  justify-content: flex-start;
-  align-items: center;
+  .headbox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
 
-  .amount {
-    font-size: 14px;
-    font-weight: bold;
-    margin-right: 20px;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      margin-right: 20px;
+    }
   }
-}
 </style>

+ 16 - 0
src/views/purchasingManage/purchaseOrder/outSourceSend/components/inventoryTable.vue

@@ -464,6 +464,21 @@ export default {
         //   slot: 'deliveryDeadline',
         //   show: this.isDeliveryDeadline
         // },
+        {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item))
+                    .join(',')
+                : '';
+            }
+          },
         {
           minWidth: 140,
           prop: 'customerExpectDeliveryDeadline',
@@ -558,6 +573,7 @@ export default {
     };
   },
   created() {
+    this.requestDict('产地');
     getWarehouseList().then((res) => {
       this.warehouseList = res;
     });

+ 19 - 1
src/views/purchasingManage/purchaseOrder/returnGoods/components/detailDialog.vue

@@ -411,6 +411,21 @@
             slot: 'discountTotalPrice',
             align: 'center'
           },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item))
+                    .join(',')
+                : '';
+            }
+          },
           {
             width: 200,
             prop: 'returnReason',
@@ -466,7 +481,10 @@
         ]
       };
     },
-    created() {},
+    created() {
+      this.requestDict('产地');
+
+    },
     methods: {
       async getcode(code) {
         const res = await getByCode(code);

+ 17 - 4
src/views/purchasingManage/purchaseOrder/returnGoods/components/inventoryTable.vue

@@ -504,7 +504,21 @@
             slot: 'discountTotalPrice',
             align: 'center'
           },
-
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item))
+                    .join(',')
+                : '';
+            }
+          },
           {
             width: 200,
             prop: 'returnReason',
@@ -576,9 +590,8 @@
       }
     },
     created() {
-      // getWarehouseList().then((res) => {
-      //   this.warehouseList = res;
-      // });
+      this.requestDict('产地');
+
     },
     methods: {
       changeNumSinglePrice(val, index) {

+ 19 - 0
src/views/purchasingManage/purchasePlanManage/components/detailDialog.vue

@@ -328,6 +328,22 @@
             slot: 'batchNo',
             align: 'center'
           },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            minWidth: 200,
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+       
+              return row.provenance && row.provenance.length
+                ? row.provenance
+                    .map((item) => this.getDictValue('产地', item ))
+                    .join(',')
+                : '';
+            }
+          },
           {
             width: 150,
             prop: 'taskName',
@@ -459,6 +475,9 @@
         ]
       };
     },
+    created() {
+      this.requestDict('产地');
+    },
     methods: {
       // //导出
       // async exportTable() {

+ 20 - 1
src/views/purchasingManage/purchasePlanManage/components/inventoryTable.vue

@@ -338,7 +338,17 @@
           ></el-input>
         </el-form-item>
       </template>
-
+      <template v-slot:provenance="scope">
+        <el-form-item :prop="'datasource.' + scope.$index + '.provenance'">
+          <DictSelection
+            dictName="产地"
+            clearable
+            v-model="scope.row.provenance"
+            multiple
+          >
+          </DictSelection>
+        </el-form-item>
+      </template>
       <template v-slot:headerProductName="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
@@ -508,6 +518,14 @@ export default {
           slot: 'batchNo',
           align: 'center'
         },
+        {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
         {
           width: 90,
           prop: 'totalCount',
@@ -848,6 +866,7 @@ export default {
           'packingSpecification',
           item.extField.packingSpecification
         );
+        this.$set(parasm, 'provenance', item.purchaseOrigins || []);
         if (idx == -1) {
           this.form.datasource.push(row);
         }

+ 33 - 17
src/views/saleManage/contact/components/addContactDialog.vue

@@ -698,27 +698,34 @@
             <el-button type="primary" @click="handSelectSupply">新增</el-button>
           </template>
           <template v-slot:purchasingCycle="scope">
-              <el-input
-                v-model="scope.row.purchasingCycle"
-                placeholder="请输入"
-              >
-                <template slot="append">天</template>
-              </el-input>
+            <el-input v-model="scope.row.purchasingCycle" placeholder="请输入">
+              <template slot="append">天</template>
+            </el-input>
           </template>
           <template v-slot:purchaseMultiplier="scope">
-              <el-input
-                v-model="scope.row.purchaseMultiplier"
-                placeholder="请输入"
-              >
-              </el-input>
+            <el-input
+              v-model="scope.row.purchaseMultiplier"
+              placeholder="请输入"
+            >
+            </el-input>
           </template>
           <template v-slot:minimumOrderQuantity="scope">
-              <el-input
-                v-model="scope.row.minimumOrderQuantity"
-                placeholder="请输入"
-              >
-              </el-input>
+            <el-input
+              v-model="scope.row.minimumOrderQuantity"
+              placeholder="请输入"
+            >
+            </el-input>
           </template>
+          <template v-slot:provenance="scope">
+            <DictSelection
+              dictName="产地"
+              clearable
+              v-model="scope.row.provenance"
+              multiple
+            >
+            </DictSelection>
+          </template>
+
           <!-- 操作栏 -->
           <template v-slot:action="scope">
             <el-popconfirm
@@ -966,7 +973,7 @@
           },
           {
             prop: 'purchasingCycle',
-            label: '周期',
+            label: '采购周期',
             align: 'center',
             slot: 'purchasingCycle',
             showOverflowTooltip: true,
@@ -988,6 +995,14 @@
             showOverflowTooltip: true,
             minWidth: 150
           },
+          {
+            prop: 'provenance',
+            label: '产地',
+            slot: 'provenance',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
 
           {
             prop: 'imgCode',
@@ -1810,6 +1825,7 @@
           this.$set(params, 'produceType', item.produceType);
           this.$set(params, 'approvalNumber', item.approvalNumber);
           this.$set(params, 'packingSpecification', item.packingSpecification);
+          this.$set(params, 'provenance', item.purchaseOrigins||[]);
           this.supplyList.push(params);
         });
       },

+ 1 - 1
src/views/saleManage/contact/components/darwerComponents/contactInfo.vue

@@ -12,7 +12,7 @@
         </el-form-item>
       </el-col>
       <el-col :span="8">
-        <el-form-item label="业务员:" prop="salesmanId">
+        <el-form-item label="销售员:" prop="salesmanId">
           <el-input v-model="form.salesmanName" disabled></el-input>
         </el-form-item>
       </el-col>