Explorar el Código

解决售后服务选择发货单和客户和销售订单选择物品类型bug

hezhanp hace 7 meses
padre
commit
955372e211

+ 11 - 0
src/api/wms/index.js

@@ -176,6 +176,17 @@ export async function getInfoBySourceBizNoAll(sourceBizNo, data = {}) {
   }
   return Promise.resolve({});
 }
+
+export async function getByIdSplit(sourceBizNo, data = {}) {
+  const res = await request.get(
+    `/eom/saleordersendrecord/getByIdSplit/${sourceBizNo}`, {params: data}
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.resolve({});
+}
+
 // 仓库树
 export async function getWarehouseTrees(data) {
   const res = await request.get('/wms/warehouse/getTrees', {

+ 26 - 20
src/views/salesServiceManagement/components/info.vue

@@ -455,7 +455,7 @@
       ref="sparePartsRef"
       :type="type"
       :source="source"
-      obtain="仓库"
+      obtain="售后"
       :is-after-sales="true"
       v-if="isPurchaseNeed"
     />
@@ -1181,21 +1181,21 @@ export default {
           slot: 'expand'
         },
         {
-          prop: 'componentAttribute',
+          prop: 'productCategoryName',
           label: '类型',
           align: 'center',
           showOverflowTooltip: true,
-          width: 200,
-          formatter: (_row, _column, cellValue) => {
-            if (!Array.isArray(cellValue) || cellValue.length === 0) {
-              return '';
-            }
-            return cellValue
-              .map((value) => {
-                return this.sxtValueLabelMap[value] || value;
-              })
-              .join(', ');
-          }
+          width: 200
+          // formatter: (_row, _column, cellValue) => {
+          //   if (!Array.isArray(cellValue) || cellValue.length === 0) {
+          //     return '';
+          //   }
+          //   return cellValue
+          //     .map((value) => {
+          //       return this.sxtValueLabelMap[value] || value;
+          //     })
+          //     .join(', ');
+          // }
         },
         {
           prop: 'categoryCode',
@@ -1686,10 +1686,11 @@ export default {
       this.$set(
         this.form,
         'isCreatePurchaseOrder',
-        res.isCreatePurchaseOrder !== undefined ? Number(res.isCreatePurchaseOrder) : 0
+        res.isCreatePurchaseOrder !== undefined
+          ? Number(res.isCreatePurchaseOrder)
+          : 0
       );
 
-      
       this.$set(this.form, 'remark', res.remark || '');
       this.$set(this.form, 'involveDeptId', res.involveDeptId ?? '');
       this.$set(this.form, 'involveDeptName', res.involveDeptName ?? '');
@@ -1933,15 +1934,20 @@ export default {
     customersDialogOpen() {
       this.$refs.productDialogRef.open();
     },
+    // 主组件的productChange方法
     productChange(data) {
       this.$set(this.form, 'faultDetailList', []);
       this.$set(this.form, 'orderCode', data.orderCode);
       this.$set(this.form, 'orderId', data.orderId);
-      let list = JSON.parse(JSON.stringify(data.tableList));
-      list.map(
-        (el) =>
-          (el.measureQuantity = el.measureQuantity ? el.measureQuantity : 1)
-      );
+
+      let list = JSON.parse(JSON.stringify(data.tableList)).map((item) => {
+        return {
+          ...item,
+          measureQuantity: item.measureQuantity || 1,
+          productCategoryName: item.categoryLevelPath || ''
+        };
+      });
+
       this.$set(this.form, 'tableList', list);
     },
     addFaults() {

+ 326 - 359
src/views/salesServiceManagement/components/invoiceDialog.vue

@@ -107,11 +107,6 @@
         :selection.sync="selection"
         height="400px"
       >
-        <template v-slot:componentAttribute="{ row }">
-          <div>
-            {{ getDictValueFn(row.componentAttribute) }}
-          </div>
-        </template>
       </ele-pro-table>
     </div>
     <div slot="footer" class="footer">
@@ -122,375 +117,347 @@
 </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';
-  const dayjs = require('dayjs');
+import { parameterGetByCode } from '@/api/main';
+import {
+  getSendTableList,
+  getSendSaleOrderrecordDetailSplit
+  // 引入新接口
+} from '@/api/saleManage/saleordersendrecord';
+import { reviewStatus } from '@/enum/dict';
+import { lbjtList } from '@/enum/dict.js';
+import { getByIdSplit } from '@/api/wms';
+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: '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: '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 ? '是' : '否';
           }
-        ],
-        columnsPro: [
-          {
-            width: 45,
-            type: 'selection',
-            columnKey: 'selection',
-            align: 'center'
-          },
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            slot: 'componentAttribute',
-            prop: 'componentAttribute',
-            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: 'reviewStatus',
+          label: '状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120,
+          formatter: (_row, _column, cellValue) => {
+            return reviewStatus[_row.reviewStatus];
           }
-        ],
-        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];
+        },
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
         }
-        delete data.time;
-        this.reload(data);
-      },
-      reset() {
-        this.searchForm = {
-          docNo: '',
-          orderNo: '',
-          contactName: '',
-          time: []
-        };
-        this.reload({});
-      },
-      reload(where) {
-        where = {
-          ...where,
-          // contractId: this.contractId,
-          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 {
-          this._getInfo(row.docNo);
+      ],
+      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
         }
-      },
-      handleClose() {
-        this.addRepairNotesDialog = false;
-      },
-      submitAdd() {
-        if (!this.selection.length) {
-          return this.$message.warning('请至少选择一条数据');
+      ],
+      contactId: '',
+      goodsShow: false,
+      searchForm: {},
+      sxtList: [
+        {
+          label: '自制件',
+          value: 1
+        },
+        {
+          label: '采购件',
+          value: 2
+        },
+        {
+          label: '外协件',
+          value: 3
+        },
+        {
+          label: '受托件',
+          value: 4
         }
-        // if (this.selection.length > 1) {
-        //   return this.$message.warning('只能选择一条物品明细数据');
-        // }
-        this.$emit('changeParent', {
-          orderCode: this.rowClickData.docNo,
-          orderId: this.rowClickData.id,
-          tableList: this.selection
-        });
-        this.handleClose();
-      },
+      ]
+    };
+  },
+  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));
 
-      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.$nextTick(() => {
+        this.packingList.forEach((row) => {
+          this.$refs.tableRef3.toggleRowSelection(row);
         });
-        this.packingList = list;
-      },
+        this.reload();
+      });
+    },
 
-      async _getInfo(sourceBizNo) {
-        console.log('zzz');
-        const dataArray = await getInfoBySourceBizNoAll(sourceBizNo);
-        let res = {};
-        if (dataArray && dataArray.length > 0) {
-          res = JSON.parse(JSON.stringify(dataArray[0]));
-          res['outInDetailList'] = [];
-          dataArray.forEach((item) => {
-            item.outInDetailList.forEach((val) => {
-              res['outInDetailList'].push(val);
-            });
-          });
-        }
-        this.init(res);
-      },
-      init(res) {
-        this.infoData = res;
-        this.productList = res?.outInDetailList?.map(
-          (productItem, productIndex) => {
-            console.log(productItem);
-            return {
-              ...productItem,
-              outInDetailRecordRequestList:
-                productItem.outInDetailRecordRequestList.map((packingItem) => {
-                  return {
-                    ...packingItem,
-                    componentAttribute: productItem.componentAttribute,
-                    singlePrice: productItem.singlePrice,
-                    categoryName: productItem.categoryName,
-                    categoryCode: productItem.categoryCode,
-                    productBrand: productItem.brandNum,
-                    categoryModel: productItem.categoryModel,
-                    packingSpecification: productItem.specification,
-                    produceTime: packingItem.produceTime || null,
-                    shipmentDate: res.createTime || null,
-                    guaranteePeriodDeadline: this.getTime(res.createTime)[0],
-                    warrantyStatus: this.getTime(res.createTime)[1]
-                  };
-                })
-            };
-          }
-        );
-        // 获取包装维度数据
-        const arr = [];
-        for (const key in this.productList) {
-          for (const k in this.productList[key].outInDetailRecordRequestList) {
-            arr.push({
-              ...this.productList[key].outInDetailRecordRequestList[k]
-            });
-          }
-        }
-        this.packingList = arr;
-      },
+    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.id);
+      }
+    },
+    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();
+    },
 
-      getTime(createTime) {
-        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.length) {
-          let arr = [];
-          e.map((v) => {
-            arr.push(this.findFn(v)?.label);
-          });
+    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;
+    },
 
-          return arr.join(',');
-        } else {
-          return '';
-        }
+    // 修改后的接口调用方法,使用getByIdSplit并传入id
+    async _getInfo(id) {
+      console.log('调用getByIdSplit接口,id:', id);
+      // 调用新接口,传入id参数
+      const res = await getByIdSplit(id);
+
+      // 处理返回数据,使其格式与第二个页面一致
+      let list = res.productList.map((el) => {
+        return {
+          categoryCode: el.productCode || el.categoryCode,
+          categoryName: el.productName || el.categoryName,
+          categoryModel: el.modelType || el.categoryModel,
+          measureQuantity: el.totalCount || el.measureQuantity,
+          barcodes: el.carCode || el.barcodes,
+          packingSpecification: el.specification || el.packingSpecification,
+          productBrand: el.brandNum || el.productBrand,
+          batchNo: el.batchNo,
+          singlePrice: el.singlePrice,
+          productCategoryName: el.productCategoryName,
+          shipmentDate: res.createTime || null,
+          guaranteePeriodDeadline: this.getTime(res.createTime)[0],
+          warrantyStatus: this.getTime(res.createTime)[1]
+        };
+      });
+
+      this.packingList = list;
+    },
+
+    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>

+ 143 - 140
src/views/salesServiceManagement/components/productDialog.vue

@@ -106,149 +106,152 @@
 </template>
 
 <script>
-  import AssetTree from './assetTree.vue';
-  import { getProductList } from '@/api/saleManage/quotation';
-  import order from '@/store/modules/order';
-  import { mapGetters } from 'vuex';
-  export default {
-    components: { AssetTree },
-    computed: {
-      ...mapGetters(['getDictValue']),
-      // 是否开启响应式布局
-      styleResponsive() {
-        return this.$store.state.theme.styleResponsive;
-      }
-    },
-    data() {
-      return {
-        visible1: false,
-        searchForm: {
-          // code: '',
-          // name: '',
-          categoryLevelId: '',
-          pageNum: 1,
-          size: 10
-        },
+import AssetTree from './assetTree.vue';
+import { getProductList } from '@/api/saleManage/quotation';
+import order from '@/store/modules/order';
+import { mapGetters } from 'vuex';
+export default {
+  components: { AssetTree },
+  computed: {
+    ...mapGetters(['getDictValue']),
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  data() {
+    return {
+      visible1: false,
+      searchForm: {
+        // code: '',
+        // name: '',
         categoryLevelId: '',
-        columns: [
-          {
-            columnKey: 'selection',
-            type: 'selection',
-            width: 45,
-            align: 'center',
-            fixed: 'left'
-          },
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            fixed: 'left'
-          },
-          {
-            prop: 'categoryCode',
-            label: '编码',
-            align: 'center'
-          },
-          {
-            prop: 'categoryName',
-            label: '名称',
-            align: 'center'
-          },
-          {
-            prop: 'categoryModel',
-            label: '型号',
-            align: 'center'
-          },
-          {
-            prop: 'specification',
-            label: '规格',
-            align: 'center'
-          },
-          {
-            prop: 'level',
-            label: '级别',
-            align: 'center'
-          },
-          {
-            prop: 'weight',
-            label: '重量',
-            align: 'center'
-          },
-          {
-            prop: 'weightUnit',
-            label: '重量单位',
-            align: 'center'
-          }
-        ],
-        tableData: [],
-        selection: [],
-        total: 0
-      };
-    },
-
-    methods: {
-      open() {
-        this.visible1 = true;
-        // this.warehouseData();
-        this.$nextTick(() => {
-          this.$refs.treeList.getTreeData().then((data) => {
-            this.handleNodeClick(data);
-          });
-        });
-      },
-      close() {
-        this.visible1 = false;
-      },
-      handleNodeClick(data) {
-        this.categoryLevelId = data.id;
-        this.searchForm.categoryLevelId = data.id;
-        this.doSearch();
+        pageNum: 1,
+        size: 10
       },
-      doSearch() {
-        this.searchForm.pageNum = 1;
-        this.warehouseData();
-      },
-      //
-      confirm() {
-        if (this.selection.length == 0) {
-          this.$message.warning('请选择一条数据');
-          return;
+      categoryLevelId: '',
+      columns: [
+        {
+          columnKey: 'selection',
+          type: 'selection',
+          width: 45,
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          prop: 'categoryCode',
+          label: '编码',
+          align: 'center'
+        },
+        {
+          prop: 'categoryName',
+          label: '名称',
+          align: 'center'
+        },
+        {
+          prop: 'categoryModel',
+          label: '型号',
+          align: 'center'
+        },
+        {
+          prop: 'specification',
+          label: '规格',
+          align: 'center'
+        },
+        {
+          prop: 'level',
+          label: '级别',
+          align: 'center'
+        },
+        {
+          prop: 'weight',
+          label: '重量',
+          align: 'center'
+        },
+        {
+          prop: 'weightUnit',
+          label: '重量单位',
+          align: 'center'
         }
+      ],
+      tableData: [],
+      selection: [],
+      total: 0
+    };
+  },
 
-        if (this.selection.length > 1) {
-          this.$message.warning('只能选择一条数据');
-          return;
-        }
-        this.$emit('changeParent', {
-          // orderCode: this.rowClickData.orderNo,
-          // orderId: this.selection.id,
-          orderCode: this.selection[0].categoryCode,
-          orderId: this.selection[0].id,
-          tableList: this.selection
-        });
-        this.close();
-      },
-      handleSizeChange() {
-        this.searchForm.pageNum = 1;
-        this.warehouseData();
-      },
-      handleCurrentChange() {
-        this.warehouseData();
-      },
-      async warehouseData() {
-        const res = await getProductList(this.searchForm);
-        let list = res.list.map((el) => {
-          el.categoryModel = el.modelType;
-          el.categoryName = el.name;
-          el.categoryCode = el.code;
-          return el;
+  methods: {
+    open() {
+      this.visible1 = true;
+      // this.warehouseData();
+      this.$nextTick(() => {
+        this.$refs.treeList.getTreeData().then((data) => {
+          this.handleNodeClick(data);
         });
-        this.tableData = list;
-        this.total = res.count;
-      },
-      reset() {}
-    }
-  };
+      });
+    },
+    close() {
+      this.visible1 = false;
+    },
+    handleNodeClick(data) {
+      this.categoryLevelId = data.id;
+      this.searchForm.categoryLevelId = data.id;
+      this.doSearch();
+    },
+    doSearch() {
+      this.searchForm.pageNum = 1;
+      this.warehouseData();
+    },
+    //
+    confirm() {
+      if (this.selection.length == 0) {
+        this.$message.warning('请选择一条数据');
+        return;
+      }
+
+      if (this.selection.length > 1) {
+        this.$message.warning('只能选择一条数据');
+        return;
+      }
+      this.$emit('changeParent', {
+        // orderCode: this.rowClickData.orderNo,
+        // orderId: this.selection.id,
+        orderCode: this.selection[0].categoryCode,
+        orderId: this.selection[0].id,
+        tableList: this.selection
+      });
+      this.close();
+    },
+    handleSizeChange() {
+      this.searchForm.pageNum = 1;
+      this.warehouseData();
+    },
+    handleCurrentChange() {
+      this.warehouseData();
+    },
+    async warehouseData() {
+      const res = await getProductList(this.searchForm);
+      let list = res.list.map((el) => {
+        return {
+          categoryModel: el.modelType,
+          categoryName: el.name,
+          categoryCode: el.code,
+          categoryLevelPath: el.categoryLevelPath,
+          id: el.id
+        };
+      });
+      this.tableData = list;
+      this.total = res.count;
+    },
+    reset() {}
+  }
+};
 </script>

+ 0 - 1
src/views/salesServiceManagement/components/saleorderDialog.vue

@@ -375,7 +375,6 @@ export default {
         el.barcodes = el.carCode;
         el.packingSpecification = el.specification;
         el.shipmentDate = row.createTime || null;
-        el.componentAttribute = el.productCategoryName; 
         (el.guaranteePeriodDeadline = this.getTime(row.createTime)[0]),
           (el.warrantyStatus = this.getTime(row.createTime)[1]);
         return el;

+ 1 - 1
src/views/salesServiceManagement/components/sparePartsList.vue

@@ -754,4 +754,4 @@ export default {
 .toobar_r {
   justify-content: flex-end;
 }
-</style>
+</style>

+ 18 - 10
src/views/salesServiceManagement/demandList/components/addDialog.vue

@@ -175,25 +175,32 @@ export default {
           submitSource: this.type === 'add' ? 1 : 2
         };
 
-        const res = await demandSubmit(submitParams);
-        if (!res) return; 
-
-        const businessId = res; 
-        console.log(businessId)
+        const businessId = await demandSubmit(submitParams);
         if (!businessId) {
-          console.log("未获取到id")
+          console.log('未获取到id');
+          return;
+        }
+
+        const detailRes = await getSalesDemandById(businessId);
+        if (!detailRes) {
+          this.$message.error('获取详情失败');
           return;
         }
 
         const currentAftertype =
           this.$refs.infoRef?.form?.aftertype || this.form.aftertype;
         if (currentAftertype === '3') {
+          console.log(detailRes)
           const processParams = {
-            businessId: businessId, 
-            businessKey: 'after_sale_fee_payable',
-            formCreateUserId: getCurrentUser().id
+            businessId: businessId,
+            businessKey: 'after_sale_quality_issues_feedback',
+            formCreateUserId: getCurrentUser().id,
+            variables: {
+              businessCode: detailRes.code,
+              businessName: detailRes.name, 
+              businessType: '质量问题反馈'
+            }
           };
-          // 打开流程弹窗并初始化
           this.processSubmitDialogFlag = true;
           this.$nextTick(() => {
             this.$refs.processSubmitDialogRef.init(processParams);
@@ -203,6 +210,7 @@ export default {
           this.savExit();
         }
       } catch (error) {
+        this.$message.error('提交失败:' + (error.message || '未知错误'));
       } finally {
         this.loading = false;
       }

+ 3 - 16
src/views/salesServiceManagement/demandList/components/dispatchDialog.vue

@@ -43,18 +43,6 @@
             ></el-input>
           </el-form-item>
         </el-col>
-        <el-col :span="12">
-          <el-form-item label="自动派单" prop="isSyncBill">
-            <el-select
-              v-model="addForm.isSyncBill"
-              size="small"
-              style="width: 100%"
-            >
-              <el-option :value="1" label="是"></el-option>
-              <el-option :value="0" label="否"></el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
         <el-col :span="12">
           <el-form-item label="预计售后时长" prop="duration">
             <div style="display: flex">
@@ -80,8 +68,6 @@
             </div>
           </el-form-item>
         </el-col>
-      </el-row>
-      <el-row>
         <el-col :span="12">
           <el-form-item
             label="部门"
@@ -98,6 +84,9 @@
             />
           </el-form-item>
         </el-col>
+      </el-row>
+      <el-row>
+        
         <el-col :span="12">
           <el-form-item
             label="工单执行人"
@@ -176,7 +165,6 @@ export default {
         executeUserId: '',
         executeGroupId: '',
         planName: '',
-        isSyncBill: 1,
         durationUnit: '1',
         remark: ''
       },
@@ -289,7 +277,6 @@ export default {
             workOrderRemark: this.addForm.remark || '',
             duration: durationInHours,
             name: this.addForm.name,
-            isSyncBill: this.addForm.isSyncBill,
             code: this.addForm.code
           };
 

+ 2 - 2
src/views/salesServiceManagement/workOrder/components/planDialog.vue

@@ -49,12 +49,12 @@
     <el-row>
       <el-col :span="6">
         <el-form-item label="部门">
-          <el-input v-model="dataForm.executeGroupName" size="small" placeholder="请输入" disabled></el-input>
+          <el-input v-model="dataForm.planExecuteGroupName" size="small" placeholder="请输入" disabled></el-input>
         </el-form-item>
       </el-col>
       <el-col :span="6">
         <el-form-item label="执行人">
-          <el-input v-model="dataForm.executeUserName" size="small" placeholder="请输入" disabled></el-input>
+          <el-input v-model="dataForm.planExecuteUserName" size="small" placeholder="请输入" disabled></el-input>
         </el-form-item>
       </el-col>
       <el-col :span="6">