Explorar o código

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-eom into dev

liujt hai 7 meses
pai
achega
89f38339dc

+ 6 - 7
src/BIZComponents/inventoryTable.vue

@@ -266,7 +266,6 @@
         </el-form-item>
       </template>
 
-      <!-- 新增字段:运输费(未税) -->
       <template v-slot:transportationFeeWithoutTax="{ row, $index }">
         <el-form-item
           :prop="'datasource.' + $index + '.transportationFeeWithoutTax'"
@@ -280,8 +279,8 @@
           </el-input>
         </el-form-item>
       </template>
-      <template v-slot:subtotalWithoutTax="{ row, $index }">
-        <el-form-item :prop="'datasource.' + $index + '.subtotalWithoutTax'">
+      <template v-slot:quotationSubtotalBeforeTax="{ row, $index }">
+        <el-form-item :prop="'datasource.' + $index + '.quotationSubtotalBeforeTax'">
           {{ calculateSubtotal(row).toFixed(2) }}元
         </el-form-item>
       </template>
@@ -1111,9 +1110,9 @@ export default {
         },
         {
           width: 150,
-          prop: 'subtotalWithoutTax',
+          prop: 'quotationSubtotalBeforeTax',
           label: '报价小计(未税)',
-          slot: 'subtotalWithoutTax',
+          slot: 'quotationSubtotalBeforeTax',
           align: 'center'
         },
         {
@@ -1511,9 +1510,9 @@ export default {
   },
   methods: {
     updateSubtotal(row, index) {
-      // this.$set(row, 'subtotalWithoutTax', this.calculateSubtotal(row));
+      // this.$set(row, 'quotationSubtotalBeforeTax', this.calculateSubtotal(row));
       // 触发表格重新渲染
-      this.$set(row, 'subtotalWithoutTax', this.calculateSubtotal(row));
+      this.$set(row, 'quotationSubtotalBeforeTax', this.calculateSubtotal(row));
     },
     calculateSubtotal(row) {
       const processingFee = Number(row.processingFeeBeforeTax) || 0;

+ 148 - 37
src/BIZComponents/inventoryTableDetails.vue

@@ -11,6 +11,7 @@
       @columns-change="handleColumnChange"
       :cache-key="cacheKeyUrl"
     >
+      <!-- 原有插槽 -->
       <template v-slot:technicalDrawings="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -41,7 +42,7 @@
       <template v-slot:otherFiles="scope">
         <el-form-item
           style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '. otherFiles'"
+          :prop="'datasource.' + scope.$index + '.otherFiles'"
         >
           <fileMain v-model="scope.row.otherFiles" type="view"></fileMain>
         </el-form-item>
@@ -78,6 +79,79 @@
         </el-form-item>
       </template>
 
+      <!-- 新增字段插槽 -->
+      <template v-slot:thickNess="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.thickNess'"
+        >
+          {{ scope.row.thickNess }} mm
+        </el-form-item>
+      </template>
+
+      <template v-slot:squareNumber="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.squareNumber'"
+        >
+          {{ scope.row.squareNumber }} cm²
+        </el-form-item>
+      </template>
+
+      <template v-slot:processingFeeBeforeTax="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.processingFeeBeforeTax'"
+        >
+          {{ scope.row.processingFeeBeforeTax || 0 }} 元
+        </el-form-item>
+      </template>
+
+      <template v-slot:packagingFeeNotTaxed="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.packagingFeeNotTaxed'"
+        >
+          {{ scope.row.packagingFeeNotTaxed || 0 }} 元
+        </el-form-item>
+      </template>
+
+      <template v-slot:transportationFeeWithoutTax="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.transportationFeeWithoutTax'"
+        >
+          {{ scope.row.transportationFeeWithoutTax || 0 }} 元
+        </el-form-item>
+      </template>
+
+      <template v-slot:quotationSubtotalBeforeTax="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.quotationSubtotalBeforeTax'"
+        >
+          {{ (Number(scope.row.processingFeeBeforeTax) + Number(scope.row.packagingFeeNotTaxed) + Number(scope.row.transportationFeeWithoutTax)).toFixed(2) }} 元
+        </el-form-item>
+      </template>
+
+      <template v-slot:modelKey="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.modelKey'"
+        >
+          {{ scope.row.modelKey ? (Array.isArray(scope.row.modelKey) ? scope.row.modelKey.join(',') : scope.row.modelKey) : '' }}
+        </el-form-item>
+      </template>
+
+      <template v-slot:colorKey="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.colorKey'"
+        >
+          {{ scope.row.colorKey ? (Array.isArray(scope.row.colorKey) ? scope.row.colorKey.join(',') : scope.row.colorKey) : '' }}
+        </el-form-item>
+      </template>
+
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
         <div class="headbox">
@@ -95,8 +169,6 @@
 </template>
 <script>
   import dictMixins from '@/mixins/dictMixins';
-
-  // import fileMain from '@/components/addDoc/index.vue';
   import { lbjtList } from '@/enum/dict.js';
   import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
   import timeDialog from '@/components/timeDialog/index.vue';
@@ -109,7 +181,6 @@
   export default {
     mixins: [dictMixins, tabMixins],
     components: {
-      // fileMain,
       timeDialog
     },
     props: {
@@ -253,6 +324,53 @@
             slot: 'specification',
             align: 'center'
           },
+          // 新增字段:厚度
+          {
+            width: 150,
+            prop: 'thickNess',
+            label: '厚度',
+            slot: 'thickNess',
+            align: 'center'
+          },
+          // 新增字段:平方数
+          {
+            width: 150,
+            prop: 'squareNumber',
+            label: '平方数',
+            slot: 'squareNumber',
+            align: 'center'
+          },
+          // 新增字段:加工费(未税)
+          {
+            width: 150,
+            prop: 'processingFeeBeforeTax',
+            label: '加工费(未税)',
+            slot: 'processingFeeBeforeTax',
+            align: 'center'
+          },
+          // 新增字段:包装费(未税)
+          {
+            width: 150,
+            prop: 'packagingFeeNotTaxed',
+            label: '包装费(未税)',
+            slot: 'packagingFeeNotTaxed',
+            align: 'center'
+          },
+          // 新增字段:运输费(未税)
+          {
+            width: 150,
+            prop: 'transportationFeeWithoutTax',
+            label: '运输费(未税)',
+            slot: 'transportationFeeWithoutTax',
+            align: 'center'
+          },
+          {
+            width: 150,
+            prop: 'quotationSubtotalBeforeTax',
+            label: '报价小计(未税)',
+            slot: 'quotationSubtotalBeforeTax',
+            align: 'center'
+          },
           {
             width: 200,
             prop: 'customerMark',
@@ -260,7 +378,6 @@
             slot: 'customerMark',
             headerSlot: 'headerCustomerMark',
             align: 'center'
-            // show: this.contractBookType == 1
           },
           {
             minWidth: 240,
@@ -380,20 +497,6 @@
             align: 'center'
           },
 
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
           {
             width: 160,
             prop: 'goodsPriceType',
@@ -502,12 +605,14 @@
             minWidth: 120,
             prop: 'modelKey',
             label: '机型',
+            slot: 'modelKey',
             showOverflowTooltip: true,
             align: 'center'
           },
           {
             minWidth: 120,
             prop: 'colorKey',
+            slot: 'colorKey',
             showOverflowTooltip: true,
             label: '颜色',
             align: 'center'
@@ -524,7 +629,6 @@
             label: '产地',
             slot: 'provenance',
             align: 'center',
-            // show:this.contractBookType==2,
             minWidth: 200,
             showOverflowTooltip: true,
             formatter: (row, column) => {
@@ -551,20 +655,6 @@
               }
             }
           },
-          // {
-          //   width: 120,
-          //   prop: 'approvalNumber',
-          //   align: 'center',
-          //   label: '批准文号',
-          //   showOverflowTooltip: true
-          // },
-          // {
-          //   width: 120,
-          //   prop: 'packingSpecification',
-          //   align: 'center',
-          //   label: '包装规格',
-          //   showOverflowTooltip: true
-          // },
           this.isArrivalWay
             ? {
                 width: 160,
@@ -607,7 +697,6 @@
             prop: 'guaranteePeriod',
             label: '有效期',
             slot: 'guaranteePeriod',
-
             align: 'center',
             formatter: (_row, _column, cellValue) => {
               return (
@@ -742,6 +831,12 @@
           v.customerReqFiles = v.customerReqFiles || [];
           v.industryArtFiles = v.industryArtFiles || [];
           v.otherFiles = v.otherFiles || [];
+          // 处理新增字段
+          v.thickNess = v.thickNess || '';
+          v.squareNumber = v.squareNumber || '';
+          v.processingFeeBeforeTax = v.processingFeeBeforeTax || '';
+          v.packagingFeeNotTaxed = v.packagingFeeNotTaxed || '';
+          v.transportationFeeWithoutTax = v.transportationFeeWithoutTax || '';
         });
         return comitDatasource;
       },
@@ -762,7 +857,6 @@
               ? this.setDay(item.guaranteePeriod, guaranteePeriodUnitName)
               : ''
           );
-          // }
         });
       },
       guaranteePeriodUnit(code) {
@@ -791,6 +885,23 @@
               data.detailList)) ||
           [];
         if (productList) {
+          // 处理新增字段
+          productList.forEach(item => {
+            item.thickNess = item.thickNess || '';
+            item.squareNumber = item.squareNumber || '';
+            item.processingFeeBeforeTax = item.processingFeeBeforeTax || '';
+            item.packagingFeeNotTaxed = item.packagingFeeNotTaxed || '';
+            item.transportationFeeWithoutTax = item.transportationFeeWithoutTax || '';
+            
+            // 处理机型/颜色
+            if (item.modelKey && typeof item.modelKey === 'string') {
+              item.modelKey = item.modelKey.split(',');
+            }
+            if (item.colorKey && typeof item.colorKey === 'string') {
+              item.colorKey = item.colorKey.split(',');
+            }
+          });
+          
           this.form.datasource = productList;
           this.allPrice =
             data.totalAmount || data.totalPrice || data?.contractVO?.totalPrice;
@@ -881,4 +992,4 @@
     align-items: center;
     font-weight: bold;
   }
-</style>
+</style>

+ 13 - 15
src/api/saleManage/quotation.js

@@ -58,26 +58,22 @@ export async function deleteInformation(data) {
 /**
  * 导出报价单
  */
-export async function getExport(id) {
-  const res = await request.get(
+export async function exportByPathId(id) {
+  const res = await request.post(
     `/eom/quote/export/${id}`,
-    {
-      responseType: 'blob'
-    },
-
+    {},
+    { responseType: 'blob' }
   );
-
   download(res.data, '报价单.xlsx');
 }
-
 /**
  * 产品分类
  */
 
-export async function getProduceTreeByPid(type=1) {
+export async function getProduceTreeByPid(type = 1) {
   const res = await request.get(
     //`/main/categoryLevel/getTreeByPid/9`,
-    `/main/categoryLevel/getProduceTreeByPid?type=`+type,
+    `/main/categoryLevel/getProduceTreeByPid?type=` + type,
     {}
   );
   if (res.data.code == 0) {
@@ -129,22 +125,24 @@ export async function isHasGeneratedContractAPI(id) {
   if (res.data.code == 0) {
     return res.data.data;
   }
-  return  Promise.resolve(0);
+  return Promise.resolve(0);
 }
 /**
  * 修改启用状态
  */
 export async function quoteUpdateStatus(params) {
-  const res = await request.get(`/eom/quote/updateStatus`,{params});
+  const res = await request.get(`/eom/quote/updateStatus`, { params });
   if (res.data.code == 0) {
     return res.data.data;
   }
-  return  Promise.resolve(0);
+  return Promise.resolve(0);
 }
 
 //获取合同上一次销售的产品
-export async function queryLastContractProductList (type) {
-  const res = await request.get(`/eom/contract/queryLastContractProductList/${type}`);
+export async function queryLastContractProductList(type) {
+  const res = await request.get(
+    `/eom/contract/queryLastContractProductList/${type}`
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 3 - 2
src/views/saleManage/quotation/index.vue

@@ -200,7 +200,7 @@ import {
   deleteInformation,
   submit,
   quoteUpdateStatus,
-  getExport,
+  exportByPathId,
   updateProductPrice
 } from '@/api/saleManage/quotation';
 
@@ -445,7 +445,8 @@ export default {
         this.$message.warning('只能选择一条数据进行导出');
         return;
       }
-      getExport(ids);
+
+      exportByPathId(ids);
     },
     updatePrice() {
       const ids = this.selection.map((row) => row.id);

+ 233 - 222
src/views/salesServiceManagement/accessory/index.vue

@@ -42,21 +42,29 @@
           >
           <el-link
             type="primary"
-            v-if="row.approvalStatus == 2&&$hasPermission('eom:aftersalessparepartsreturnapply:save')"
+            v-if="
+              row.approvalStatus == 2 &&
+              $hasPermission('eom:aftersalessparepartsreturnapply:save')
+            "
             :underline="false"
             @click="returnAdd(row)"
             >归还入库</el-link
           >
           <el-link
             type="primary"
-            v-if="row.source == 0"
+            v-if="
+              row.source == 0 &&
+              !(row.approvalStatus === 1 || row.approvalStatus === 2)
+            "
             :underline="false"
             @click="openProcess(row)"
             >发起流程</el-link
           >
           <el-popconfirm
             v-if="
-              row.source == 0 && $hasPermission('eom:sparepartsapply:delete')
+              row.source == 0 &&
+              $hasPermission('eom:sparepartsapply:delete') &&
+              !(row.approvalStatus === 1 || row.approvalStatus === 2)
             "
             class="ele-action"
             title="确定要删除此配件记录吗?"
@@ -80,239 +88,242 @@
     ></process-submit-dialog>
     <!-- 新建或编辑弹窗 -->
     <accessoryDialog ref="accessoryDialog" @refresh="reload" />
-    <returnAddDiaLog ref="returnAddDiaLogRef" @refresh="reload"></returnAddDiaLog>
+    <returnAddDiaLog
+      ref="returnAddDiaLogRef"
+      @refresh="reload"
+    ></returnAddDiaLog>
   </div>
 </template>
 
 <script>
-  import search from './components/search.vue';
-  import accessoryDialog from './components/accessoryDialog.vue';
-  import returnAddDiaLog from '@/views/salesServiceManagement/return/component/recycleDialog.vue';
+import search from './components/search.vue';
+import accessoryDialog from './components/accessoryDialog.vue';
+import returnAddDiaLog from '@/views/salesServiceManagement/return/component/recycleDialog.vue';
 
-  import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
+import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
 
-  import {
-    accessoryPage,
-    accessoryDelete
-    // accessoryUpdate
-  } from '@/api/salesServiceManagement/index';
-  // import dictMixins from '@/mixins/dictMixins';
-  export default {
-    //   mixins: [dictMixins],
-    components: {
-      search,
-      accessoryDialog,
-      returnAddDiaLog,
-      processSubmitDialog
+import {
+  accessoryPage,
+  accessoryDelete
+  // accessoryUpdate
+} from '@/api/salesServiceManagement/index';
+// import dictMixins from '@/mixins/dictMixins';
+export default {
+  //   mixins: [dictMixins],
+  components: {
+    search,
+    accessoryDialog,
+    returnAddDiaLog,
+    processSubmitDialog
+  },
+  data() {
+    return {
+      // 加载状态
+      loading: false,
+      processSubmitDialogFlag: false, // 加载状态 弹窗
+      outboundDetailsDialogFlag: false //
+    };
+  },
+  computed: {
+    columns() {
+      return [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          slot: 'code',
+          prop: 'code',
+          label: '编码',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'demandCode',
+          label: '售后需求编码',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'orderCode',
+          label: '工单编码',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'approvalStatus',
+          label: '审核状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (_row, _column, cellValue) => {
+            return cellValue == 0
+              ? '未提交'
+              : cellValue == 1
+              ? '审核中'
+              : cellValue == 2
+              ? '审核通过'
+              : cellValue == 3
+              ? '审核不通过'
+              : '';
+          }
+        },
+        {
+          prop: 'categoryLevelName',
+          label: '物品分类',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            if (!row.details) return '';
+            let str = '';
+            row.details.map((el, idx) => {
+              if (idx + 1 == row.details.length) {
+                str += el.categoryLevelName;
+              } else {
+                str = el.categoryLevelName
+                  ? str + '' + el.categoryLevelName + ','
+                  : str + '';
+              }
+            });
+            return str;
+          }
+        },
+        // + +关键字
+        {
+          prop: 'categoryName',
+          label: '物品名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            if (!row.details) return '';
+            let str = '';
+            row.details.map((el, idx) => {
+              if (idx + 1 == row.details.length) {
+                str += el.categoryName;
+              } else {
+                str = str + '' + el.categoryName + ',';
+              }
+            });
+            return str;
+          }
+        },
+        {
+          prop: 'receivingDeptName',
+          label: '领用部门',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        // + + 时间选择
+        {
+          prop: 'recipientName',
+          label: '领用人',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'contactName',
+          label: '客户名称',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          label: '设备名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            if (!row.deviceDetails) return '';
+            let str = '';
+            row.deviceDetails.map((el, idx) => {
+              if (idx + 1 == row.deviceDetails.length) {
+                str += el.categoryName;
+              } else {
+                str = str + '' + el.categoryName + ',';
+              }
+            });
+            return str;
+          }
+        },
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'usageTime',
+          label: '使用时间',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          columnKey: 'action',
+          slot: 'action',
+          label: '操作',
+          align: 'center',
+          width: 180,
+          resizable: false,
+          showOverflowTooltip: true
+        }
+      ];
+    }
+  },
+  created() {},
+  methods: {
+    /* 表格数据源 */
+    datasource({ page, limit, where, order }) {
+      return accessoryPage({ pageNum: page, size: limit, ...where });
     },
-    data() {
-      return {
-        // 加载状态
-        loading: false,
-        processSubmitDialogFlag: false, // 加载状态 弹窗
-        outboundDetailsDialogFlag: false //
-      };
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ page: 1, where });
     },
-    computed: {
-      columns() {
-        return [
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            slot: 'code',
-            prop: 'code',
-            label: '编码',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'demandCode',
-            label: '售后需求编码',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'orderCode',
-            label: '工单编码',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'approvalStatus',
-            label: '审核状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (_row, _column, cellValue) => {
-              return cellValue == 0
-                ? '未提交'
-                : cellValue == 1
-                ? '审核中'
-                : cellValue == 2
-                ? '审核通过'
-                : cellValue == 3
-                ? '审核不通过'
-                : '';
-            }
-          },
-          {
-            prop: 'categoryLevelName',
-            label: '物品分类',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              if (!row.details) return '';
-              let str = '';
-              row.details.map((el, idx) => {
-                if (idx + 1 == row.details.length) {
-                  str += el.categoryLevelName;
-                } else {
-                  str = el.categoryLevelName
-                    ? str + '' + el.categoryLevelName + ','
-                    : str + '';
-                }
-              });
-              return str;
-            }
-          },
-          // + +关键字
-          {
-            prop: 'categoryName',
-            label: '物品名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              if (!row.details) return '';
-              let str = '';
-              row.details.map((el, idx) => {
-                if (idx + 1 == row.details.length) {
-                  str += el.categoryName;
-                } else {
-                  str = str + '' + el.categoryName + ',';
-                }
-              });
-              return str;
-            }
-          },
-          {
-            prop: 'receivingDeptName',
-            label: '领用部门',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          // + + 时间选择
-          {
-            prop: 'recipientName',
-            label: '领用人',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'contactName',
-            label: '客户名称',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            label: '设备名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              if (!row.deviceDetails) return '';
-              let str = '';
-              row.deviceDetails.map((el, idx) => {
-                if (idx + 1 == row.deviceDetails.length) {
-                  str += el.categoryName;
-                } else {
-                  str = str + '' + el.categoryName + ',';
-                }
-              });
-              return str;
-            }
-          },
-          {
-            prop: 'createTime',
-            label: '创建时间',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'usageTime',
-            label: '使用时间',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            columnKey: 'action',
-            slot: 'action',
-            label: '操作',
-            align: 'center',
-            width: 180,
-            resizable: false,
-            showOverflowTooltip: true
-          }
-        ];
-      }
+
+    openEdit(row, type) {
+      this.$refs.accessoryDialog.init(row, type);
+    },
+    handleRemove(row) {
+      accessoryDelete([row.id]).then((res) => {
+        if (res) {
+          this.$message.success('操作成功!');
+          this.reload();
+        }
+      });
+    },
+    returnAdd(row) {
+      this.$refs.returnAddDiaLogRef.init(row, 'add', 'accessory');
     },
-    created() {},
-    methods: {
-      /* 表格数据源 */
-      datasource({ page, limit, where, order }) {
-        return accessoryPage({ pageNum: page, size: limit, ...where });
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ page: 1, where });
-      },
 
-      openEdit(row, type) {
-        this.$refs.accessoryDialog.init(row, type);
-      },
-      handleRemove(row) {
-        accessoryDelete([row.id]).then((res) => {
-          if (res) {
-            this.$message.success('操作成功!');
-            this.reload();
+    openProcess(data) {
+      this.processSubmitDialogFlag = true;
+      this.$nextTick(() => {
+        let params = {
+          businessId: data.id,
+          businessKey: 'eom_sh_bpbj',
+          formCreateUserId: data.createUserId,
+          variables: {
+            businessCode: data.code,
+            businessName: data.receivingDeptName,
+            businessType: '申请备品备件'
           }
-        });
-      },
-      returnAdd(row) {
-        this.$refs.returnAddDiaLogRef.init(row,'add','accessory');
-      },
-
-      openProcess(data) {
-        this.processSubmitDialogFlag = true;
-        this.$nextTick(() => {
-          let params = {
-            businessId: data.id,
-            businessKey: 'eom_sh_bpbj',
-            formCreateUserId: data.createUserId,
-            variables: {
-              businessCode: data.code,
-              businessName: data.receivingDeptName,
-              businessType: '申请备品备件'
-            }
-          };
-          this.$refs.processSubmitDialogRef.init(params);
-        });
-      }
+        };
+        this.$refs.processSubmitDialogRef.init(params);
+      });
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  ::v-deep .el-input__inner::placeholder {
-    font-size: 13px;
-  }
-  ::v-deep .seep-search {
-    .el-input__inner {
-      padding: 0 5px 0 10px;
-    }
+::v-deep .el-input__inner::placeholder {
+  font-size: 13px;
+}
+::v-deep .seep-search {
+  .el-input__inner {
+    padding: 0 5px 0 10px;
   }
+}
 </style>

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

@@ -470,6 +470,7 @@ export default {
         const formValue = await this.generateFormValid();
         this.form.valueJson = formValue;
 
+        console.log(this.form.valueJson)
         const workOrderId = this.form.valueJson.manage_workorder.id;
         if (!workOrderId) {
           this.$message.warning('请先选择关联工单');

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

@@ -29,7 +29,7 @@
         <el-col :span="12">
           <el-form-item
             label="计划名称"
-            prop="name"
+            prop="planName"
             :rules="{
               required: true,
               message: '请输入计划名称',
@@ -37,7 +37,7 @@
             }"
           >
             <el-input
-              v-model="addForm.name"
+              v-model="addForm.planName"
               size="small"
               placeholder="请输入"
             ></el-input>
@@ -175,7 +175,7 @@ export default {
       addForm: {
         executeUserId: '',
         executeGroupId: '',
-        name: '',
+        planName: '',
         isSyncBill: 1,
         durationUnit: '1',
         remark: ''
@@ -275,6 +275,7 @@ export default {
           }
           let data = {
             ...submitData,
+            planName: this.addForm.planName, 
             submitSource: this.submitSource,
             workOrderExecuteUserId: this.addForm.executeUserId || '',
             workOrderExecuteUserName: this.addForm.executeUserName || '',

+ 45 - 21
src/views/salesServiceManagement/vehiclerecord/index.vue

@@ -25,6 +25,8 @@
 import search from './components/search.vue';
 import { pageByDispatchRecord } from '@/api/salesServiceManagement/index';
 import dictMixins from '@/mixins/dictMixins';
+// 导入获取用户列表的接口(与第二个组件保持一致)
+import { getUserPage } from '@/api/system/organization';
 
 export default {
   mixins: [dictMixins],
@@ -37,21 +39,12 @@ export default {
       deptResList: [], // 部门
       deptIdToNameMap: {},
       statusList: [
-        {
-          value: 1,
-          label: '处理中'
-        },
-
-        {
-          value: 2,
-          label: '通过'
-        },
-
-        {
-          value: 3,
-          label: '不通过'
-        }
+        { value: 1, label: '处理中' },
+        { value: 2, label: '通过' },
+        { value: 3, label: '不通过' }
       ],
+      // 新增:用户列表(用于匹配用车人名称)
+      userList: [],
       // 加载状态
       loading: false
     };
@@ -151,12 +144,13 @@ export default {
           formatter: (row) => row.valueJson?.car_number || ''
         },
         {
-          prop: 'createUserName',
+          prop: 'vehicle_user',
           label: '用车人',
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 200,
-          // formatter: (row) => row.valueJson?.vehicle_user || ''
+          // 关键修改:通过vehicle_user(用户ID)匹配用户名
+          formatter: (row) => this.getVehicleUserName(row.valueJson?.vehicle_user)
         },
         {
           prop: 'vehicle_mileage',
@@ -181,10 +175,10 @@ export default {
           showOverflowTooltip: true,
           minWidth: 200,
           formatter: (row) => {
-          const currentStatus = row.status;
-          const matchedItem = this.statusList.find(item => item.value === currentStatus);
-          return matchedItem ? matchedItem.label : '';
-        }
+            const currentStatus = row.status;
+            const matchedItem = this.statusList.find(item => item.value === currentStatus);
+            return matchedItem ? matchedItem.label : '';
+          }
         },
         {
           prop: 'createTime',
@@ -196,7 +190,33 @@ export default {
       ];
     }
   },
+  created() {
+    // 初始化时获取用户列表(用于匹配用车人名称)
+    this.getUserList();
+  },
   methods: {
+    // 新增:获取用户列表(与第二个组件逻辑一致)
+    async getUserList() {
+      try {
+        const res = await getUserPage({
+          pageNum: 1,
+          pageSize: -1 // 获取全部用户
+        });
+        this.userList = res?.list || [];
+      } catch (error) {
+        console.error('获取用户列表失败:', error);
+        this.$message.error('获取用户列表失败');
+      }
+    },
+
+    // 新增:通过vehicle_user(用户ID)获取用户名
+    getVehicleUserName(vehicleUserId) {
+      if (!vehicleUserId) return '';
+      // 在用户列表中匹配ID对应的用户名称
+      const matchedUser = this.userList.find(user => user.id === vehicleUserId);
+      return matchedUser ? matchedUser.name : vehicleUserId; // 未匹配到则显示原始ID
+    },
+
     getDeptNames(deptIdArr) {
       if (!deptIdArr || !Array.isArray(deptIdArr) || deptIdArr.length === 0) {
         return '-';
@@ -206,6 +226,7 @@ export default {
       );
       return deptNames.join('、');
     },
+
     getPieTypeLabel(value) {
       if (!value) return '';
       const target = this.pietypeList.find(
@@ -213,6 +234,7 @@ export default {
       );
       return target ? target.label : value;
     },
+
     handlePietypeList(list, deptRes) {
       this.pietypeList = list;
       this.deptResList = deptRes;
@@ -221,6 +243,7 @@ export default {
         return map;
       }, {});
     },
+
     datasource({ page, limit, where }) {
       const dataPromise = pageByDispatchRecord({
         pageNum: page,
@@ -232,9 +255,10 @@ export default {
         .catch((error) => console.error('获取数据失败:', error));
       return dataPromise;
     },
+
     /* 刷新表格 */
     reload(where) {
-      this.$refs.table.reload({ page: 1, where });
+      this.$refs.table.reload({ page: 1, ...where });
     }
   }
 };