Просмотр исходного кода

提交需求工单选择弹窗

hezhanp 8 месяцев назад
Родитель
Сommit
4724951183

+ 51 - 9
src/views/financialManage/components/feeRelatedInfoTable.vue

@@ -176,9 +176,15 @@
       @changeParent="getOrderData"
     ></purchase-order-list-dialog>
     <!-- 选择售后工单 -->
-    <SHGDListDialog 
+    <SHGDListDialog
       ref="SHGDListDialogRef"
-      @changeParent="getSHGDData"></SHGDListDialog>
+      @changeParent="getSHGDData"
+    ></SHGDListDialog>
+    <!-- 选择运输工单 -->
+    <YSGDListDialog
+      ref="YSGDListDialogRef"
+      @changeParent="getYSGDData"
+    ></YSGDListDialog>
     <!--商机-->
     <opportunity-dialog
       ref="opportunityDialogRef"
@@ -219,6 +225,11 @@
     <CGDDdetailDialog ref="CGDDdetailDialogRef"></CGDDdetailDialog>
     <declarationDialog ref="declarationDialogRef"></declarationDialog>
     <KHdrawer ref="KHdrawerRef"></KHdrawer>
+    <feeInfoDialog
+      ref="feeInfoDialogRef"
+      v-if="feeInfoDialogFlag"
+      :fee-info-dialog-flag.sync="feeInfoDialogFlag"
+    ></feeInfoDialog>
   </div>
 </template>
 
@@ -228,6 +239,7 @@ import customerListDialog from '@/views/financialManage/components/customerListD
 import saleOrderListDialog from '@/views/saleManage/saleOrder/invoice/components/orderListDialog.vue';
 import purchaseOrderListDialog from '@/views/purchasingManage/purchaseOrder/invoice/components/orderListDialog.vue';
 import SHGDListDialog from '@/views/salesServiceManagement/workOrder/components/drawer.vue';
+import YSGDListDialog from '@/views/transportManager/shipManage/taskWorkManage/components/drawer.vue';
 import opportunityDialog from '@/views/financialManage/components/opportunityDialog.vue';
 import accountStatementDialog from '@/views/financialManage/components/accountstatementDialog.vue';
 import planDialog from '@/views/financialManage/components/planDialog.vue';
@@ -246,6 +258,7 @@ import ContactDetailDialog from '@/views/purchasingManage/producerManage/compone
 import CGJHdetailDialog from '@/views/purchasingManage/purchasePlanManage/components/detailDialog.vue';
 import CGDDdetailDialog from '@/views/purchasingManage/purchaseOrder/components/detailDialog.vue';
 import declarationDialog from '@/views/salesServiceManagement/workOrder/components/declarationDialog.vue';
+import feeInfoDialog from '@/views/transportManager/shipManage/taskWorkManage/components/feeInfoDialog.vue';
 // import fileMain from '@/components/addDoc/index.vue';
 
 export default {
@@ -255,6 +268,7 @@ export default {
     fileUpload,
     purchaseOrderListDialog,
     SHGDListDialog,
+    YSGDListDialog,
     saleOrderListDialog,
     customerListDialog,
     contractListDialog,
@@ -269,7 +283,8 @@ export default {
     CGJHdetailDialog,
     CGDDdetailDialog,
     declarationDialog,
-    KHdrawer
+    KHdrawer,
+    feeInfoDialog
   },
   props: {
     link: {
@@ -312,7 +327,9 @@ export default {
         datasource: []
       },
       rowList: [],
-      xsdDialogFlag: false
+      xsdDialogFlag: false,
+
+      feeInfoDialogFlag: false
     };
   },
   computed: {
@@ -453,7 +470,7 @@ export default {
         row.linkCode = '';
         return;
       }
-      console.log(row.linkType)
+      console.log(row.linkType);
       switch (row.linkType) {
         case '100': //客户
           this.handleSelectContact(row);
@@ -490,7 +507,11 @@ export default {
           this.handleSelectAccount(row);
           break;
         case '1010': //售后工单
-        this.handleSelectSHGDListDialog(row);
+          this.handleSelectSHGDListDialog(row);
+          break;
+
+        case '1020': //运输工单
+          this.handleSelectYSGDListDialog(row);
           break;
       }
     },
@@ -653,6 +674,10 @@ export default {
     handleSelectSHGDListDialog(val) {
       this.$refs.SHGDListDialogRef.open();
     },
+    //选择运输工单
+    handleSelectYSGDListDialog(val) {
+      this.$refs.YSGDListDialogRef.open();
+    },
     //获取采购/销售订单数据
     getOrderData(params) {
       let row = {
@@ -664,9 +689,20 @@ export default {
       this.setSelectData(row);
     },
     //获取售后工单数据
-    getSHGDData(params){
-      console.log(params)
-      
+    getSHGDData(params) {
+      let row = {
+        ...params,
+        id: params.id,
+        name: params.code,
+        code: params.code,
+        amount: params.payAmount
+      };
+      this.setSelectData(row);
+    },
+    //获取运输工单数据
+    getYSGDData(params) {
+      console.log(params);
+
       let row = {
         ...params,
         id: params.id,
@@ -721,6 +757,12 @@ export default {
         case '1010': //售后工单
           this.$refs.declarationDialogRef.open(rowL);
           break;
+        case '1020': //运输工单
+          this.feeInfoDialogFlag = true;
+          this.$nextTick(() => {
+            this.$refs.feeInfoDialogRef.init(rowL, 'view');
+          });
+          break;
         case '900': //项目
           //this.handleSelectPurchaseOrder(row);
           break;

+ 360 - 0
src/views/transportManager/shipManage/taskWorkManage/components/drawer.vue

@@ -0,0 +1,360 @@
+<template>
+  <ele-modal
+    :title="'运输工单'"
+    custom-class="ele-dialog-form long-dialog-form"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+    :maxable="true"
+    :resizable="true"
+  >
+    <el-card shadow="never" v-loading="loading">
+      <work-search
+        class="seep-search"
+        ref="workSearch"
+        :levelList="levelList"
+        @search="reload"
+        label-width="130px"
+      ></work-search>
+
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="id"
+        height="calc(100vh - 430px)"
+        full-height="calc(100vh - 116px)"
+        tool-class="ele-toolbar-form"
+        :page-size="20"
+        @columns-change="handleColumnChange"
+        :cache-key="cacheKeyUrl"
+        class="dict-table"
+      >
+        <template v-slot:toolbar>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="handleAddOrEdit('', 'add')"
+          >
+            新建
+          </el-button>
+        </template>
+
+        <!-- 自定义单选列 -->
+        <template v-slot:selection="{ row }">
+          <div class="radio-container">
+            <el-radio
+              v-model="selectedRowId"
+              :label="row.id"
+              @change="() => selectedRow = row"
+            ><span></span></el-radio>
+          </div>
+        </template>
+      </ele-pro-table>
+    </el-card>
+
+    <div class="btns" slot="footer">
+      <el-button
+        type="primary"
+        size="small"
+        :disabled="!selectedRow"
+        @click="handleConfirm"
+      >
+        确认
+      </el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+import workSearch from '@/views/transportManager/shipManage/taskWorkManage/pageSearchTable.vue';
+import { getByCode } from '@/api/system/dictionary-data';
+import dictMixins from '@/mixins/dictMixins';
+import tabMixins from '@/mixins/tableColumnsMixin';
+import { logistictraklistnotePageListAPI } from '@/api/transportManager/shipManage/taskWork';
+import addOrEditDialog from '@/views/transportManager/shipManage/taskWorkManage/components/addOrEditDialog.vue';
+
+export default {
+  mixins: [dictMixins, tabMixins],
+  components: {
+    workSearch,
+    addOrEditDialog
+  },
+  data() {
+    return {
+      visible: false,
+      loading: false,
+      levelData: {},
+      levelList: [],
+      workOrderType: 'afterSales',
+      // 单选相关变量(替换原selection多选数组)
+      selectedRowId: null,    // 存储选中行的唯一标识(与row-key="id"对应)
+      selectedRow: null,      // 存储选中行的完整数据
+      statusList: [
+        { value: 0, label: '待接收' },
+        { value: 1, label: '执行中' },
+        { value: 2, label: '已完成' }
+      ],
+      cacheKeyUrl: 'eos-02b17ed5-shipManage-taskWorkManage',
+      columnsVersion: 1,
+      addOrEditDialogFlag: false
+    };
+  },
+  created() {
+    this.getLevelCode('fault_level');
+  },
+  computed: {
+    columns() {
+      const version = this.columnsVersion;
+      return [
+        // 单选列(替换原type: 'selection'多选列)
+        {
+          columnKey: 'selection',
+          label: '选择',
+          slot: 'selection',
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left',
+          width: 60
+        },
+        // 序号列
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        // 工单单号列
+        {
+          prop: 'code',
+          label: '工单单号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 150
+        },
+        // 状态列
+        {
+          prop: 'status',
+          label: '状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120,
+          formatter: (row) => this.statusList.find(item => item.value === row.status)?.label || ''
+        },
+        // 计划编号列
+        {
+          prop: 'planCode',
+          label: '计划编号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 150
+        },
+        // 计划名称列
+        {
+          prop: 'planName',
+          label: '计划名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        // 预计开始时间列
+        {
+          prop: 'planTimeStart',
+          label: '预计开始时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 160
+        },
+        // 预计结束时间列
+        {
+          prop: 'planTimeEnd',
+          label: '预计结束时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 160
+        },
+        // 开始时间列
+        {
+          prop: 'realStartTime',
+          label: '开始时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 160
+        },
+        // 完成时间列
+        {
+          prop: 'realEndTime',
+          label: '完成时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 160
+        },
+        // 负责部门列
+        {
+          prop: 'responsibleDeptName',
+          label: '负责部门',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        // 负责人列
+        {
+          prop: 'responsiblePersonName',
+          label: '负责人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        // 车牌号列
+        {
+          prop: 'trakNumber',
+          label: '车牌号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        // 司机列
+        {
+          prop: 'driverName',
+          label: '司机',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        // 司机电话列
+        {
+          prop: 'phone',
+          label: '司机电话',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        // 创建时间列
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        }
+      ];
+    }
+  },
+  methods: {
+    // 打开弹窗方法
+    open(type = 'afterSales') {
+      this.workOrderType = type;
+      this.visible = true;
+      this.reload();
+    },
+    // 获取故障等级字典方法
+    async getLevelCode(code) {
+      const res = await getByCode(code);
+      if (res?.code === '0') {
+        this.levelData = res.data.reduce((obj, el) => {
+          const key = Object.keys(el)[0];
+          obj[key] = Object.values(el)[0];
+          return obj;
+        }, {});
+        this.levelList = res.data.map((el) => ({
+          label: Object.values(el)[0],
+          value: Object.keys(el)[0]
+        }));
+      }
+    },
+    // 确认选中方法(传递单选数据)
+    handleConfirm() {
+      if (this.selectedRow) {
+        console.log('选中的运输工单数据:', this.selectedRow);
+        this.$emit('changeParent', this.selectedRow);
+        this.handleClose();
+      }
+    },
+    // 关闭弹窗方法(重置单选状态)
+    handleClose() {
+      this.visible = false;
+      // 重置单选状态,避免下次打开残留选中
+      this.selectedRowId = null;
+      this.selectedRow = null;
+      this.$refs.table?.reload({ pageNum: 1 });
+      this.addOrEditDialogFlag = false;
+    },
+    // 表格数据源方法
+    datasource({ page, limit, where }) {
+      this.loading = true;
+      return logistictraklistnotePageListAPI({
+        pageNum: page,
+        size: limit,
+        ...where
+      }).finally(() => {
+        this.loading = false;
+      });
+    },
+    // 表格刷新方法
+    reload(where = {}) {
+      this.$nextTick(() => {
+        this.$refs.table?.reload({ pageNum: 1, where });
+      });
+    },
+    // 新增/编辑弹窗方法
+    handleAddOrEdit(row = {}, type) {
+      this.addOrEditDialogFlag = true;
+      this.$nextTick(() => {
+        this.$refs.addOrEditDialogRef.init(row, type);
+      });
+    },
+    // 表格列变更方法
+    handleColumnChange() {
+      this.columnsVersion += 1;
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+// 搜索框样式
+.seep-search {
+  margin-bottom: 16px;
+  ::v-deep .el-input__inner {
+    padding: 0 5px 0 10px;
+  }
+}
+
+// 底部按钮样式
+.btns {
+  text-align: center;
+  padding: 10px 0;
+  button:first-child {
+    margin-right: 8px;
+  }
+}
+
+// 表格样式
+::v-deep .ele-pro-table {
+  margin-top: 8px;
+}
+
+// 表格工具栏样式
+::v-deep .ele-toolbar-form {
+  margin-bottom: 8px;
+}
+
+// 单选框居中样式
+.radio-container {
+  text-align: center;
+  line-height: 1;
+}
+::v-deep .radio-container .el-radio {
+  display: inline-block;
+  vertical-align: middle;
+}
+</style>

+ 17 - 10
src/views/transportManager/shipManage/taskWorkManage/components/feeInfoDialog.vue

@@ -1,15 +1,15 @@
 <template>
   <ele-modal
-    custom-class="ele-dialog-form long-dialog-form"
-    :centered="true"
-    :visible.sync="feeInfoDialogFlag"
-    title="报工信息"
-    :append-to-body="false"
-    :close-on-click-modal="false"
-    :maxable="true"
-    :resizable="true"
-    width="60%"
-    :before-close="cancel">
+  custom-class="ele-dialog-form long-dialog-form"
+  :centered="true"
+  :visible.sync="feeInfoDialogFlag"
+  title="报工信息"
+  :append-to-body="true" 
+  :close-on-click-modal="false"
+  :maxable="true"
+  :resizable="true"
+  width="60%"
+  :before-close="cancel">
     <el-form v-if="dialogType=='view'" ref="form" :rules="rules" :model="form" label-width="120px">
       <headerTitle title="基础信息"></headerTitle>
       <el-row>
@@ -387,4 +387,11 @@ export default {
 :deep(.el-form-item) {
   margin-bottom: 20px;
 }
+:deep(.ele-dialog-form .el-dialog) {
+  z-index: 3000 !important;  /* 数值需大于遮罩层z-index(通常1000-2000) */
+}
+/* 若遮罩层层级异常,也可调整遮罩层z-index(可选) */
+:deep(.el-dialog__wrapper) {
+  z-index: 2999 !important;  /* 确保遮罩层低于弹窗 */
+}
 </style>