yusheng hai 6 meses
pai
achega
812da0ac40

+ 11 - 2
src/views/salesServiceManagement/accessory/components/spareInfo.vue

@@ -265,7 +265,7 @@
       confirmChoose(data) {
         data.map((item) => {
           item.singlePrice = item.unitPrice;
-          item.measureUnit=item.measureUnit||item.measuringUnit
+          item.measureUnit = item.measureUnit || item.measuringUnit;
           delete item.id;
           return {
             ...item
@@ -274,12 +274,21 @@
         this.tableList = JSON.parse(JSON.stringify(data));
       },
       getSpareData() {
+        let is = true;
         if (this.title == '配件回收清单') {
           let warehouseIdS = this.tableList.filter((item) => item.warehouseId);
-          if (warehouseIdS.length!=this.tableList.length) {
+          if (warehouseIdS.length != this.tableList.length) {
             return this.$mssage.warning('请选择仓库');
           }
         }
+        this.tableList.forEach((item) => {
+          if (!item.totalCount) {
+            is = false;
+          }
+        });
+        if (!is) {
+          return this.$mssage.warning('请填写数量');
+        }
         return this.tableList;
       }
     }

+ 313 - 306
src/views/salesServiceManagement/components/invoiceDialog.vue

@@ -117,296 +117,296 @@
 </template>
 
 <script>
-import { parameterGetByCode } from '@/api/main';
-import {
-  getSendTableList,
-  getSendSaleOrderrecordDetailSplit
-  // 引入新接口
-} from '@/api/saleManage/saleordersendrecord';
-import { reviewStatus } from '@/enum/dict';
-import { lbjtList } from '@/enum/dict.js';
-import { getInfoBySourceBizNoAll } from '@/api/wms';
+  import { parameterGetByCode } from '@/api/main';
+  import {
+    getSendTableList,
+    getSendSaleOrderrecordDetailSplit
+    // 引入新接口
+  } from '@/api/saleManage/saleordersendrecord';
+  import { reviewStatus } from '@/enum/dict';
+  import { lbjtList } from '@/enum/dict.js';
+  import { getInfoBySourceBizNoAll } from '@/api/wms';
 
-const dayjs = require('dayjs');
+  const dayjs = require('dayjs');
 
-export default {
-  props: {
-    contractBookType: {
-      // 合同类型 1销售 2采购
-      type: [String, Number],
-      default: 1
-    }
-  },
-  components: {},
+  export default {
+    props: {
+      contractBookType: {
+        // 合同类型 1销售 2采购
+        type: [String, Number],
+        default: 1
+      }
+    },
+    components: {},
 
-  data() {
-    return {
-      addRepairNotesDialog: false,
-      rowClickData: {},
-      selection: [],
-      packingList: [],
-      columns: [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true
-        },
+    data() {
+      return {
+        addRepairNotesDialog: false,
+        rowClickData: {},
+        selection: [],
+        packingList: [],
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true
+          },
 
-        {
-          prop: 'docNo',
-          label: '发货单编码',
-          sortable: true,
-          align: 'center',
-          slot: 'docNo',
-          showOverflowTooltip: true,
-          minWidth: 120
-        },
+          {
+            prop: 'docNo',
+            label: '发货单编码',
+            sortable: true,
+            align: 'center',
+            slot: 'docNo',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
 
-        {
-          prop: 'orderNo',
-          label: '销售订单编码',
-          sortable: true,
-          align: 'center',
-          slot: 'orderNo',
-          showOverflowTooltip: true,
-          minWidth: 120
-        },
-        {
-          prop: 'contactName',
-          label: '客户名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 120
-        },
-        {
-          prop: 'replied',
-          label: '是否回执',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 120,
-          formatter: (_row, _column, cellValue) => {
-            return _row.replied == 1 ? '是' : '否';
+          {
+            prop: 'orderNo',
+            label: '销售订单编码',
+            sortable: true,
+            align: 'center',
+            slot: 'orderNo',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'contactName',
+            label: '客户名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'replied',
+            label: '是否回执',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: (_row, _column, cellValue) => {
+              return _row.replied == 1 ? '是' : '否';
+            }
+          },
+          {
+            prop: 'reviewStatus',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: (_row, _column, cellValue) => {
+              return reviewStatus[_row.reviewStatus];
+            }
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
           }
-        },
-        {
-          prop: 'reviewStatus',
-          label: '状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 120,
-          formatter: (_row, _column, cellValue) => {
-            return reviewStatus[_row.reviewStatus];
+        ],
+        columnsPro: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            slot: 'productCategoryName',
+            prop: 'productCategoryName',
+            label: '类型',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryCode',
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryName',
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productBrand',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryModel',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'packingSpecification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'measureQuantity',
+            label: '计量数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'singlePrice',
+            label: '单价(元)',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'barcodes',
+            label: '发货条码/车架号',
+            align: 'center',
+            showOverflowTooltip: true
           }
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 120
+        ],
+        contactId: '',
+        goodsShow: false,
+        searchForm: {},
+        sxtList: [
+          {
+            label: '自制件',
+            value: 1
+          },
+          {
+            label: '采购件',
+            value: 2
+          },
+          {
+            label: '外协件',
+            value: 3
+          },
+          {
+            label: '受托件',
+            value: 4
+          }
+        ]
+      };
+    },
+    created() {},
+    methods: {
+      // 初始化数据(父组件调用)
+      open(data, obj) {
+        this.contactId = data;
+        this.addRepairNotesDialog = true;
+        // 数据回显
+        this.rowClickData.id = obj.orderId;
+        this.rowClickData.docNo = obj.orderCode;
+        this.packingList = JSON.parse(JSON.stringify(obj.tableList));
+
+        this.$nextTick(() => {
+          this.packingList.forEach((row) => {
+            this.$refs.tableRef3.toggleRowSelection(row);
+          });
+          this.reload();
+        });
+      },
+
+      datasource({ page, limit, where, order }) {
+        return getSendTableList({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+      },
+      onSearch() {
+        let data = JSON.parse(JSON.stringify(this.searchForm));
+        if (data.time?.length > 0) {
+          data.createTimeStart = data.time[0];
+          data.createTimeEnd = data.time[1];
         }
-      ],
-      columnsPro: [
-        {
-          width: 45,
-          type: 'selection',
-          columnKey: 'selection',
-          align: 'center'
-        },
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          slot: 'productCategoryName',
-          prop: 'productCategoryName',
-          label: '类型',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'categoryCode',
-          label: '编码',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'categoryName',
-          label: '名称',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'productBrand',
-          label: '牌号',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'categoryModel',
-          label: '型号',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'packingSpecification',
-          label: '规格',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'batchNo',
-          label: '批次号',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'measureQuantity',
-          label: '计量数量',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'singlePrice',
-          label: '单价(元)',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'barcodes',
-          label: '发货条码/车架号',
-          align: 'center',
-          showOverflowTooltip: true
+        delete data.time;
+        this.reload(data);
+      },
+      reset() {
+        this.searchForm = {
+          docNo: '',
+          orderNo: '',
+          contactName: '',
+          time: []
+        };
+        this.reload({});
+      },
+      reload(where) {
+        where = {
+          ...where,
+          contactId: this.contactId,
+          reviewStatus: 2
+        };
+        this.$refs.tableRef2.reload({ page: 1, where });
+      },
+      async rowClick(row) {
+        this.rowClickData = row;
+        let params = {
+          code: 'after_sales_product_list_source'
+        };
+        const res = await parameterGetByCode(params);
+        if (res.value == '1') {
+          this.getInfo(row);
+        } else {
+          // 调用修改后的接口,传入id参数
+          this._getInfo(row.docNo);
         }
-      ],
-      contactId: '',
-      goodsShow: false,
-      searchForm: {},
-      sxtList: [
-        {
-          label: '自制件',
-          value: 1
-        },
-        {
-          label: '采购件',
-          value: 2
-        },
-        {
-          label: '外协件',
-          value: 3
-        },
-        {
-          label: '受托件',
-          value: 4
+      },
+      handleClose() {
+        this.addRepairNotesDialog = false;
+      },
+      submitAdd() {
+        if (!this.selection.length) {
+          return this.$message.warning('请至少选择一条数据');
         }
-      ]
-    };
-  },
-  created() {},
-  methods: {
-    // 初始化数据(父组件调用)
-    open(data, obj) {
-      this.contactId = data;
-      this.addRepairNotesDialog = true;
-      // 数据回显
-      this.rowClickData.id = obj.orderId;
-      this.rowClickData.docNo = obj.orderCode;
-      this.packingList = JSON.parse(JSON.stringify(obj.tableList));
-
-      this.$nextTick(() => {
-        this.packingList.forEach((row) => {
-          this.$refs.tableRef3.toggleRowSelection(row);
+        this.$emit('changeParent', {
+          orderCode: this.rowClickData.docNo,
+          orderId: this.rowClickData.id,
+          tableList: this.selection
         });
-        this.reload();
-      });
-    },
-
-    datasource({ page, limit, where, order }) {
-      return getSendTableList({
-        pageNum: page,
-        size: limit,
-        ...where
-      });
-    },
-    onSearch() {
-      let data = JSON.parse(JSON.stringify(this.searchForm));
-      if (data.time?.length > 0) {
-        data.createTimeStart = data.time[0];
-        data.createTimeEnd = data.time[1];
-      }
-      delete data.time;
-      this.reload(data);
-    },
-    reset() {
-      this.searchForm = {
-        docNo: '',
-        orderNo: '',
-        contactName: '',
-        time: []
-      };
-      this.reload({});
-    },
-    reload(where) {
-      where = {
-        ...where,
-        contactId: this.contactId,
-        reviewStatus: 2
-      };
-      this.$refs.tableRef2.reload({ page: 1, where });
-    },
-    async rowClick(row) {
-      this.rowClickData = row;
-      let params = {
-        code: 'after_sales_product_list_source'
-      };
-      const res = await parameterGetByCode(params);
-      if (res.value == '1') {
-        this.getInfo(row);
-      } else {
-        // 调用修改后的接口,传入id参数
-       this._getInfo(row.docNo);
-      }
-    },
-    handleClose() {
-      this.addRepairNotesDialog = false;
-    },
-    submitAdd() {
-      if (!this.selection.length) {
-        return this.$message.warning('请至少选择一条数据');
-      }
-      this.$emit('changeParent', {
-        orderCode: this.rowClickData.docNo,
-        orderId: this.rowClickData.id,
-        tableList: this.selection
-      });
-      this.handleClose();
-    },
+        this.handleClose();
+      },
 
-    async getInfo(row) {
-      const res = await getSendSaleOrderrecordDetailSplit(row.id);
-      let list = res.productList.map((el) => {
-        el.categoryCode = el.productCode;
-        el.categoryName = el.productName;
-        el.categoryModel = el.modelType;
-        el.measureQuantity = el.totalCount;
-        el.barcodes = el.carCode;
-        el.packingSpecification = el.specification;
-        el.shipmentDate = row.createTime || null;
-        (el.guaranteePeriodDeadline = this.getTime(row.createTime)[0]),
-          (el.warrantyStatus = this.getTime(row.createTime)[1]);
-        return el;
-      });
-      this.packingList = list;
-    },
+      async getInfo(row) {
+        const res = await getSendSaleOrderrecordDetailSplit(row.id);
+        let list = res.productList.map((el) => {
+          el.categoryCode = el.productCode;
+          el.categoryName = el.productName;
+          el.categoryModel = el.modelType;
+          el.measureQuantity = el.totalCount;
+          el.barcodes = el.carCode;
+          el.packingSpecification = el.specification;
+          el.shipmentDate = row.createTime || null;
+          (el.guaranteePeriodDeadline = this.getTime(row.createTime)[0]),
+            (el.warrantyStatus = this.getTime(row.createTime)[1]);
+          return el;
+        });
+        this.packingList = list;
+      },
 
-       async _getInfo(sourceBizNo) {
+      async _getInfo(sourceBizNo) {
         console.log('zzz');
         const dataArray = await getInfoBySourceBizNoAll(sourceBizNo);
         let res = {};
@@ -428,12 +428,14 @@ export default {
             console.log(productItem);
             return {
               ...productItem,
+              productCategoryName: productItem.categoryLevelPath,
+              productBrand: productItem.brandNum,
               outInDetailRecordRequestList:
                 productItem.outInDetailRecordRequestList.map((packingItem) => {
                   return {
                     ...packingItem,
                     componentAttribute: productItem.componentAttribute,
-                    productCategoryName:packingItem.categoryLevelName,
+                    productCategoryName: productItem.categoryLevelPath,
                     singlePrice: productItem.singlePrice,
                     categoryName: productItem.categoryName,
                     categoryCode: productItem.categoryCode,
@@ -452,40 +454,45 @@ export default {
         // 获取包装维度数据
         const arr = [];
         for (const key in this.productList) {
-          for (const k in this.productList[key].outInDetailRecordRequestList) {
-            arr.push({
-              ...this.productList[key].outInDetailRecordRequestList[k]
-            });
+          if (this.productList[key].outInDetailRecordRequestList.length) {
+            for (const k in this.productList[key]
+              .outInDetailRecordRequestList) {
+              arr.push({
+                ...this.productList[key].outInDetailRecordRequestList[k]
+              });
+            }
+          } else {
+            arr.push(this.productList[key]);
           }
         }
         this.packingList = arr;
       },
 
-    getTime(createTime) {
-      if (!createTime) return ['', 1];
-      let date = new Date(createTime);
-      date.setMonth(date.getMonth() + 13); // 月份加13月
-      let time = dayjs(date).format('YYYY-MM-DD HH:mm:ss');
-      let warrantyStatus =
-        new Date(time).getTime() > new Date().getTime() ? 0 : 1;
-      return [time, warrantyStatus];
-    },
-    findFn(e) {
-      return this.sxtList.find((item) => item.value == Number(e));
-    },
-    getDictValueFn(e) {
-      if (e && e.length) {
-        let arr = [];
-        e.map((v) => {
-          arr.push(this.findFn(v)?.label);
-        });
-        return arr.join(',');
-      } else {
-        return '';
+      getTime(createTime) {
+        if (!createTime) return ['', 1];
+        let date = new Date(createTime);
+        date.setMonth(date.getMonth() + 13); // 月份加13月
+        let time = dayjs(date).format('YYYY-MM-DD HH:mm:ss');
+        let warrantyStatus =
+          new Date(time).getTime() > new Date().getTime() ? 0 : 1;
+        return [time, warrantyStatus];
+      },
+      findFn(e) {
+        return this.sxtList.find((item) => item.value == Number(e));
+      },
+      getDictValueFn(e) {
+        if (e && e.length) {
+          let arr = [];
+          e.map((v) => {
+            arr.push(this.findFn(v)?.label);
+          });
+          return arr.join(',');
+        } else {
+          return '';
+        }
       }
     }
-  }
-};
+  };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped></style>

+ 1 - 1
src/views/salesServiceManagement/cost/index.vue

@@ -172,7 +172,7 @@ export default {
         },
         {
           prop: 'workOrderName',
-          label: '工单名称',
+          label: '计划名称',
           align: 'center',
           showOverflowTooltip: true
         },