Browse Source

解决售后需求相关bug,费用管理新增弹窗根据关联类型显示不同类型详情

hezhanp 1 year ago
parent
commit
06edcecde7

+ 162 - 161
src/views/contractManage/contractBook/components/detailDialog.vue

@@ -33,7 +33,7 @@
           <el-col :span="12">
             <el-form-item label="合同类型:" prop="type">
               <el-input v-model="form.categoryName" disabled>
-                <template slot="prepend">{{ form.typeName }}</template>
+                <template slot="prepend">{{ form.typeName}}</template>
               </el-input>
             </el-form-item>
 
@@ -286,177 +286,178 @@
 </template>
 
 <script>
-  import { getDetail, getExport } from '@/api/contractManage/contractBook';
-  import { getFile } from '@/api/system/file';
-  import dictMixins from '@/mixins/dictMixins';
-  import { copyObj } from '@/utils/util';
-  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
-  import inventoryTabledetail from '@/BIZComponents/inventoryTableDetails.vue';
-  import changeList from './changeList.vue';
-  import paymentList from './paymentList.vue';
+import { getDetail, getExport } from '@/api/contractManage/contractBook';
+import { getFile } from '@/api/system/file';
+import dictMixins from '@/mixins/dictMixins';
+import { copyObj } from '@/utils/util';
+import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+import inventoryTabledetail from '@/BIZComponents/inventoryTableDetails.vue';
+import changeList from './changeList.vue';
+import paymentList from './paymentList.vue';
 
-  export default {
-    mixins: [dictMixins],
-    components: {
-      inventoryTabledetail,
-      bpmDetail,
-      changeList,
-      paymentList
+export default {
+  mixins: [dictMixins],
+  components: {
+    inventoryTabledetail,
+    bpmDetail,
+    changeList,
+    paymentList
+  },
+  data() {
+    return {
+      fullscreen: false,
+      cacheKeyUrl: 'eos-contractManage-contractBook-inventoryTableDetails',
+      activeName: '1',
+      activeComp: 'main',
+      tabOptions: [
+        { key: 'main', name: '合同详情' },
+        { key: 'bpm', name: '流程详情' },
+        { key: 'changeList', name: '历史版本' }
+        // { key: 'oldMain', name: '变更记录' },
+      ],
+      visible: false,
+      detailId: '',
+      title: '详情',
+      row: {},
+      form: {},
+      rules: {},
+      detailData: {},
+      sourceTypeList: [
+        {
+          code: 1,
+          name: '报价单',
+          parentId: '1'
+        },
+        {
+          code: 2,
+          name: '核价单',
+          parentId: '2'
+        },
+        {
+          code: 3,
+          name: '采购计划',
+          parentId: '2'
+        },
+        {
+          code: 4,
+          name: '商机',
+          parentId: '1'
+        },
+        {
+          code: 5,
+          name: '退货单',
+          parentId: '1'
+        },
+        {
+          code: 6,
+          name: '客户',
+          parentId: '1'
+        },
+        {
+          code: 7,
+          name: '销售订单',
+          parentId: '1'
+        }
+      ]
+    };
+  },
+  methods: {
+    //导出
+    async exportTable() {
+      this.loading = true;
+      const response = await getExport(this.detailId);
     },
-    data() {
-      return {
-        fullscreen: false,
-        cacheKeyUrl: 'eos-contractManage-contractBook-inventoryTableDetails',
-        activeName: '1',
-        activeComp: 'main',
-        tabOptions: [
-          { key: 'main', name: '合同详情' },
-          { key: 'bpm', name: '流程详情' },
-          { key: 'changeList', name: '历史版本' }
-          // { key: 'oldMain', name: '变更记录' },
-        ],
-        visible: false,
-        detailId: '',
-        title: '详情',
-        row: {},
-        form: {},
-        rules: {},
-        detailData: {},
-        sourceTypeList: [
-          {
-            code: 1,
-            name: '报价单',
-            parentId: '1'
-          },
-          {
-            code: 2,
-            name: '核价单',
-            parentId: '2'
-          },
-          {
-            code: 3,
-            name: '采购计划',
-            parentId: '2'
-          },
-          {
-            code: 4,
-            name: '商机',
-            parentId: '1'
-          },
-          {
-            code: 5,
-            name: '退货单',
-            parentId: '1'
-          },
-          {
-            code: 6,
-            name: '客户',
-            parentId: '1'
-          },
-          {
-            code: 7,
-            name: '销售订单',
-            parentId: '1'
-          }
-        ]
-      };
+    async open(row) {
+      console.log(row);
+      this.form = row;
+      this.activeComp = 'main';
+      this.visible = true;
+      this.activeName = '1';
+      this.getDetailData(row.id);
+      this.detailId = row.id;
     },
-    methods: {
-      //导出
-      async exportTable() {
-        this.loading = true;
-        const response = await getExport(this.detailId);
-      },
-      async open(row) {
-        this.form = row;
-        this.activeComp = 'main';
-        this.visible = true;
-        this.activeName = '1';
-        this.getDetailData(row.id);
-        this.detailId = row.id;
-      },
-      changeK(key) {
-        this.activeComp = key;
-        if (key == 'main') {
-          this.$nextTick(() => {
-            this.$refs.inventoryTabledetailRef &&
-              this.$refs.inventoryTabledetailRef.putTableValue({
-                ...this.detailData,
-                ...this.detailData.contractVO
-              });
-            this.$refs.rawDetailListRef &&
-              this.$refs.rawDetailListRef.putTableValueNew(this.form.rawList); //原料
-            this.$refs.outputDetailListRef &&
-              this.$refs.outputDetailListRef.putTableValueNew(
-                this.form.outputList
-              );
-          });
-        }
-        if (key == 'changeList') {
-          this.$nextTick(() => {
-            this.$refs.changeList.init(this.form.id);
-          });
-        }
-      },
-      cancel() {
+    changeK(key) {
+      this.activeComp = key;
+      if (key == 'main') {
         this.$nextTick(() => {
-          // 关闭后,销毁所有的表单数据
-          (this.form = copyObj(this.formDef)),
-            (this.otherForm = copyObj(this.otherFormDef)),
-            (this.tableBankData = []);
-          this.tableLinkData = [];
-          this.visible = false;
+          this.$refs.inventoryTabledetailRef &&
+            this.$refs.inventoryTabledetailRef.putTableValue({
+              ...this.detailData,
+              ...this.detailData.contractVO
+            });
+          this.$refs.rawDetailListRef &&
+            this.$refs.rawDetailListRef.putTableValueNew(this.form.rawList); //原料
+          this.$refs.outputDetailListRef &&
+            this.$refs.outputDetailListRef.putTableValueNew(
+              this.form.outputList
+            );
+        });
+      }
+      if (key == 'changeList') {
+        this.$nextTick(() => {
+          this.$refs.changeList.init(this.form.id);
+        });
+      }
+    },
+    cancel() {
+      this.$nextTick(() => {
+        // 关闭后,销毁所有的表单数据
+        (this.form = copyObj(this.formDef)),
+          (this.otherForm = copyObj(this.otherFormDef)),
+          (this.tableBankData = []);
+        this.tableLinkData = [];
+        this.visible = false;
+      });
+    },
+    downloadFile(file) {
+      getFile({ objectName: file.storePath }, file.name);
+    },
+    async getDetailData(id) {
+      this.loading = true;
+      const data = await getDetail(id);
+      this.loading = false;
+      if (data) {
+        data.productList.forEach((item) => {
+          item['pricingWay'] = item.pricingWay || data.contractVO?.pricingWay;
+        });
+        this.detailData = data;
+        this.form = data.contractVO;
+        this.$refs.paymentListTable &&
+          this.$refs.paymentListTable.putTableValue(data.receiptPaymentList);
+        this.$nextTick(() => {
+          this.$refs.inventoryTabledetailRef &&
+            this.$refs.inventoryTabledetailRef.putTableValue({
+              ...data,
+              ...data.contractVO
+            });
+          this.$refs.rawDetailListRef &&
+            this.$refs.rawDetailListRef.putTableValueNew(this.form.rawList); //原料
+          this.$refs.outputDetailListRef &&
+            this.$refs.outputDetailListRef.putTableValueNew(
+              this.form.outputList
+            );
         });
-      },
-      downloadFile(file) {
-        getFile({ objectName: file.storePath }, file.name);
-      },
-      async getDetailData(id) {
-        this.loading = true;
-        const data = await getDetail(id);
-        this.loading = false;
-        if (data) {
-          data.productList.forEach((item) => {
-            item['pricingWay'] = item.pricingWay || data.contractVO?.pricingWay;
-          });
-          this.detailData = data;
-          this.form = data.contractVO;
-          this.$refs.paymentListTable &&
-            this.$refs.paymentListTable.putTableValue(data.receiptPaymentList);
-          this.$nextTick(() => {
-            this.$refs.inventoryTabledetailRef &&
-              this.$refs.inventoryTabledetailRef.putTableValue({
-                ...data,
-                ...data.contractVO
-              });
-            this.$refs.rawDetailListRef &&
-              this.$refs.rawDetailListRef.putTableValueNew(this.form.rawList); //原料
-            this.$refs.outputDetailListRef &&
-              this.$refs.outputDetailListRef.putTableValueNew(
-                this.form.outputList
-              );
-          });
-        }
       }
     }
-  };
+  }
+};
 </script>
 
 <style scoped lang="scss">
-  .ele-dialog-form {
-    .el-form-item {
-      margin-bottom: 10px;
-    }
+.ele-dialog-form {
+  .el-form-item {
+    margin-bottom: 10px;
   }
+}
 
-  .headbox {
-    display: flex;
-    justify-content: flex-start;
-    align-items: center;
-    .amount {
-      font-size: 14px;
-      font-weight: bold;
-      margin-right: 20px;
-    }
+.headbox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+    margin-right: 20px;
   }
+}
 </style>

+ 521 - 442
src/views/financialManage/components/feeRelatedInfoTable.vue

@@ -75,7 +75,6 @@
           v-if="dialogType !== 'view'"
         >
           <el-form-item :prop="'datasource.' + $index + '.linkType'">
-          
             <el-select
               v-model="row.linkType"
               @change="(val) => handleChangeFinLink(val, row, $index)"
@@ -90,16 +89,34 @@
             </el-select>
           </el-form-item>
         </template>
+        <!-- 单据名称插槽:新增详情按钮(选择单据后显示) -->
         <template
           v-slot:linkName="{ row, $index }"
           v-if="dialogType !== 'view'"
         >
           <el-form-item :prop="'datasource.' + $index + '.linkName'">
-            <el-input
-              v-model="row.linkName"
-              @click.native="(val) => handleSelectData(val, row, $index)"
-              clearable
-            ></el-input>
+            <!-- 用flex布局使输入框和详情按钮对齐 -->
+            <div
+              style="display: flex; align-items: center; gap: 8px; width: 100%"
+            >
+              <el-input
+                v-model="row.linkName"
+                @click.native="(val) => handleSelectData(val, row, $index)"
+                clearable
+                style="flex: 1"
+              ></el-input>
+              <!-- 详情按钮:仅当选择单据(linkId存在)时显示 -->
+              <el-button
+                v-if="row.linkId"
+                size="mini"
+                type="text"
+                icon="el-icon-view"
+                @click="handleViewDetail(row)"
+                style="padding: 0"
+              >
+                详情
+              </el-button>
+            </div>
           </el-form-item>
         </template>
         <template v-slot:amount="{ row, $index }" v-if="dialogType !== 'view'">
@@ -124,7 +141,6 @@
         <template v-slot:files="{ row, $index }">
           <el-form-item :prop="'datasource.' + $index + '.files'">
             <fileMain v-model="row.files" :type="dialogType"></fileMain>
-         
           </el-form-item>
         </template>
         <template v-slot:remark="{ row, $index }" v-if="dialogType !== 'view'">
@@ -188,464 +204,527 @@
       :collectionId="collectionId"
     >
     </plan-dialog>
+
+    <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
+    <SJdrawer ref="SJdrawerRef"></SJdrawer>
+    <XSdrawer ref="XSdrawerRef"></XSdrawer>
+    <XSDZDdetailDialog
+      ref="XSDZDdetailDialogRef"
+      :detailDialogFlag.sync="xsdDialogFlag"
+    ></XSDZDdetailDialog>
+    <ContactDetailDialog ref="GYScontactDetailDialogRef"></ContactDetailDialog>
+    <CGJHdetailDialog ref="CGJHdetailDialogRef"></CGJHdetailDialog>
+
+    <CGDDdetailDialog ref="CGDDdetailDialogRef"></CGDDdetailDialog>
+    <KHdrawer ref="KHdrawerRef"></KHdrawer>
   </div>
 </template>
 
 <script>
-  import contractListDialog from '@/views/financialManage/components/contractListDialog.vue';
-  import customerListDialog from '@/views/financialManage/components/customerListDialog.vue';
-  import saleOrderListDialog from '@/views/saleManage/saleOrder/invoice/components/orderListDialog.vue';
-  import purchaseOrderListDialog from '@/views/purchasingManage/purchaseOrder/invoice/components/orderListDialog.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';
-  import { getTreeByPid } from '@/api/classifyManage';
-  import { mapGetters } from 'vuex';
-  import { getByCode } from '@/api/system/dictionary-data';
-  import fileUpload from '@/components/upload/fileUpload.vue';
-  import { getFile } from '@/api/system/file';
-  // import fileMain from '@/components/addDoc/index.vue';
+import contractListDialog from '@/views/financialManage/components/contractListDialog.vue';
+import customerListDialog from '@/views/financialManage/components/customerListDialog.vue';
+import saleOrderListDialog from '@/views/saleManage/saleOrder/invoice/components/orderListDialog.vue';
+import purchaseOrderListDialog from '@/views/purchasingManage/purchaseOrder/invoice/components/orderListDialog.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';
+import { getTreeByPid } from '@/api/classifyManage';
+import { mapGetters } from 'vuex';
+import { getByCode } from '@/api/system/dictionary-data';
+import fileUpload from '@/components/upload/fileUpload.vue';
+import { getFile } from '@/api/system/file';
+import detailDialog from '@/views/contractManage/contractBook/components/detailDialog';
+import SJdrawer from '@/views/saleManage/businessOpportunity/components/drawer.vue';
+import XSdrawer from '@/views/saleManage/saleOrder/components/drawer.vue';
+import KHdrawer from '@/views/saleManage/contact/components/drawer.vue';
+import XSDZDdetailDialog from '@/views/saleManage/saleOrder/accountstatement/components/detailDialog.vue';
+
+import ContactDetailDialog from '@/views/purchasingManage/producerManage/components/contactDetailDialog.vue';
+import CGJHdetailDialog from '@/views/purchasingManage/purchasePlanManage/components/detailDialog.vue';
+import CGDDdetailDialog from '@/views/purchasingManage/purchaseOrder/components/detailDialog.vue';
+// import fileMain from '@/components/addDoc/index.vue';
 
-  export default {
-    name: 'relatedInfoTable',
-    components: {
-      // fileMain,
-      fileUpload,
-      purchaseOrderListDialog,
-      saleOrderListDialog,
-      customerListDialog,
-      contractListDialog,
-      opportunityDialog,
-      accountStatementDialog,
-      planDialog
+export default {
+  name: 'relatedInfoTable',
+  components: {
+    // fileMain,
+    fileUpload,
+    purchaseOrderListDialog,
+    saleOrderListDialog,
+    customerListDialog,
+    contractListDialog,
+    opportunityDialog,
+    accountStatementDialog,
+    planDialog,
+    detailDialog,
+    SJdrawer,
+    XSdrawer,
+    XSDZDdetailDialog,
+    ContactDetailDialog,
+    CGJHdetailDialog,
+    CGDDdetailDialog,
+    KHdrawer
+  },
+  props: {
+    link: {
+      type: Array,
+      default: () => []
+    },
+    documentType: {
+      type: [String, Number],
+      default: ''
     },
-    props: {
-      link: {
-        type: Array,
-        default: () => []
-      },
-      documentType: {
-        type: [String, Number],
-        default: ''
-      },
 
-      dialogType: {
-        type: String,
-        default: ''
-      },
-      collectionId: {
-        type: String,
-        default: ''
-      }
+    dialogType: {
+      type: String,
+      default: ''
     },
-    data() {
-      return {
-        editIndex: undefined, //当前修改数据的下标
-        contractType: undefined, //选择关联类型为合同时区分销售合同和采购合同
-        contractListDialogFlag: false,
-        customerListDialogFlag: false,
-        opportunityDialogFlag: false,
-        accountStatementDialogFlag: false,
-        planDialogFlag: false,
-        accountType: 1,
-        feeTypeList: [],
-        fin_link_type: [],
-        CBToDT: {
-          1: [900, 120, 100, 1000],
-          2: [900, 120, 100, 230, 250, 260, 290],
-          3: [230, 250, 260, 290],
-          4: []
+    collectionId: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      editIndex: undefined, //当前修改数据的下标
+      contractType: undefined, //选择关联类型为合同时区分销售合同和采购合同
+      contractListDialogFlag: false,
+      customerListDialogFlag: false,
+      opportunityDialogFlag: false,
+      accountStatementDialogFlag: false,
+      planDialogFlag: false,
+      accountType: 1,
+      feeTypeList: [],
+      fin_link_type: [],
+      CBToDT: {
+        1: [900, 120, 100, 1000],
+        2: [900, 120, 100, 230, 250, 260, 290],
+        3: [230, 250, 260, 290],
+        4: []
+      },
+      form: {
+        datasource: []
+      },
+      rowList: [],
+      xsdDialogFlag: false
+    };
+  },
+  computed: {
+    columns() {
+      let list = [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'financeCostTypeName',
+          label: '财务费用类型',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 180,
+          slot: 'financeCostType',
+          headerSlot: 'headerGLLXMC'
+        },
+        {
+          prop: 'linkTypeName',
+          label: '关联业务类型',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120,
+          slot: 'linkType'
+        },
+        {
+          prop: 'linkName',
+          label: '单据名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 200,
+          slot: 'linkName'
+        },
+        {
+          prop: 'amount',
+          label: '金额',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120,
+          slot: 'amount',
+          headerSlot: 'headerGLLXMC'
+        },
+        {
+          prop: 'files',
+          label: '附件凭证',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120,
+          slot: 'files'
         },
-        form: {
-          datasource: []
+        {
+          prop: 'remark',
+          label: '备注',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120,
+          slot: 'remark'
         }
+      ];
+      let action = [
+        {
+          columnKey: 'action',
+          slot: 'action',
+          label: '操作',
+          resizable: false,
+          width: 80,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'right'
+        }
+      ];
+      this.dialogType === 'view'
+        ? (list = [...list])
+        : (list = [...list, ...action]);
+      return list;
+    },
+    getLinkTypeList() {
+      if (
+        this.documentType == 4 ||
+        !this.documentType ||
+        !this.CBToDT[this.documentType]
+      )
+        return this.fin_link_type;
+      let data = [];
+      this.CBToDT[this.documentType].forEach((item) => {
+        let find = this.fin_link_type.find((i) => i.value == item) || {};
+        find.value && data.push(find);
+      });
+      return data;
+    }
+  },
+  async mounted() {
+    this.form.datasource = this.link;
+    await this.getClassifyList(25, 'feeTypeList');
+    let { data } = await getByCode('fin_link_type');
+    this.fin_link_type = data.map((item) => {
+      let values = Object.keys(item);
+      return {
+        value: values[0],
+        label: item[values[0]]
       };
+    });
+  },
+  methods: {
+    //获取分类管理中的数据
+    async getClassifyList(id, listName) {
+      let res = await getTreeByPid(id);
+      this[listName] = res.data;
     },
-    computed: {
-      columns() {
-        let list = [
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            prop: 'financeCostTypeName',
-            label: '财务费用类型',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 180,
-            slot: 'financeCostType',
-            headerSlot: 'headerGLLXMC'
-          },
-          // {
-          //   prop: 'YWFYLX',
-          //   label: '业务费用类型',
-          //   align: 'center',
-          //   showOverflowTooltip: true,
-          //   minWidth: 150,
-          //   slot: 'YWFYLX',
-          //   headerSlot: 'headerGLLXMC',
-          // },
-          {
-            prop: 'linkTypeName',
-            label: '关联业务类型',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 120,
-            slot: 'linkType'
-          },
-          {
-            prop: 'linkName',
-            label: '单据名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 130,
-            slot: 'linkName'
-          },
-          {
-            prop: 'amount',
-            label: '金额',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 120,
-            slot: 'amount',
-            headerSlot: 'headerGLLXMC'
-          },
-          {
-            prop: 'files',
-            label: '附件凭证',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 120,
-            slot: 'files'
-          },
-          {
-            prop: 'remark',
-            label: '备注',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 120,
-            slot: 'remark'
-          }
-        ];
-        let action = [
-          {
-            columnKey: 'action',
-            slot: 'action',
-            label: '操作',
-            resizable: false,
-            width: 80,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'right'
-          }
-        ];
-        this.dialogType === 'view'
-          ? (list = [...list])
-          : (list = [...list, ...action]);
-        return list;
-      },
-      getLinkTypeList() {
-        if (
-          this.documentType == 4 ||
-          !this.documentType ||
-          !this.CBToDT[this.documentType]
-        )
-          return this.fin_link_type;
-        let data = [];
-        this.CBToDT[this.documentType].forEach((item) => {
-          let find = this.fin_link_type.find((i) => i.value == item) || {};
-          find.value && data.push(find);
-        });
-        return data;
+    downloadFile(file) {
+      getFile({ objectName: file.storePath }, file.name);
+    },
+    //新增关联信息数据
+    handleAddInfo() {
+      this.form.datasource.push({
+        linkType: '',
+        linkTypeName: '',
+        financeCostTypeName: '',
+        financeCostType: '',
+        linkId: '',
+        linkName: '',
+        linkCode: ''
+      });
+    },
+    //选择单据触发的方法
+    handleSelectData(val, row, index) {
+      this.editIndex = index;
+      this.rowList = val;
+      if (val.target.nodeName == 'I') {
+        row.linkId = '';
+        row.linkName = '';
+        row.linkCode = '';
+        return;
+      }
+      switch (row.linkType) {
+        case '100': //客户
+          this.handleSelectContact(row);
+          break;
+        case '120': //商机
+          this.getOpportunityList(row);
+          break;
+        case '130': //销售合同
+          this.contractType = 1;
+          this.handleSelectContract(row);
+          break;
+        case '140': //销售订单
+          this.handleSelectSaleOrder(row);
+          break;
+        case '190': //销售对账单
+          this.accountType = 1;
+          this.handleSelectAccount(row);
+          break;
+        case '210': //供应商
+          this.handleSelectContact(row);
+          break;
+        case '230': //采购计划
+          this.handleSelectPlan(row);
+          break;
+        case '250': //采购合同
+          this.contractType = 2;
+          this.handleSelectContract(row);
+          break;
+        case '260': //采购订单
+          this.handleSelectPurchaseOrder(row);
+          break;
+        case '290': //采购对账单
+          this.accountType = 2;
+          this.handleSelectAccount(row);
+          break;
+        case '900': //项目
+          //this.handleSelectPurchaseOrder(row);
+          break;
       }
     },
-    async mounted() {
-      this.form.datasource = this.link;
-      await this.getClassifyList(25, 'feeTypeList');
-      let { data } = await getByCode('fin_link_type');
-      this.fin_link_type = data.map((item) => {
-        let values = Object.keys(item);
-        return {
-          value: values[0],
-          label: item[values[0]]
-        };
+    //获取费用类别选中数据
+    changeFeeTypeInfo(val, row, index) {
+      this.editIndex = index;
+      if (!val) {
+        this.$set(
+          this.form.datasource[this.editIndex],
+          'financeCostTypeName',
+          ''
+        );
+        this.$set(this.form.datasource[this.editIndex], 'financeCostType', '');
+      }
+      this.$nextTick(() => {
+        let data =
+          this.$refs['feeTypeTree' + index]?.$refs?.tree?.getCurrentNode() ||
+          {};
+        this.$set(
+          this.form.datasource[this.editIndex],
+          'financeCostTypeName',
+          data.name
+        );
+        this.$set(
+          this.form.datasource[this.editIndex],
+          'financeCostType',
+          data.code
+        );
       });
     },
-    methods: {
-      //获取分类管理中的数据
-      async getClassifyList(id, listName) {
-        let res = await getTreeByPid(id);
-        this[listName] = res.data;
-      },
-      downloadFile(file) {
-        getFile({ objectName: file.storePath }, file.name);
-      },
-      //新增关联信息数据
-      handleAddInfo() {
-        this.form.datasource.push({
-          linkType: '',
-          linkTypeName: '',
-          financeCostTypeName: '',
-          financeCostType: '',
-          linkId: '',
-          linkName: '',
-          linkCode: ''
-        });
-      },
-      //
-      handleSelectData(val, row, index) {
-        this.editIndex = index;
-        if (val.target.nodeName == 'I') {
-          row.linkId = '';
-          row.linkName = '';
-          row.linkCode = '';
-          return;
-        }
-        switch (row.linkType) {
-          case '100': //客户
-            this.handleSelectContact(row);
-            break;
-          case '120': //商机
-            this.getOpportunityList(row);
-            break;
-          case '130': //销售合同
-            this.contractType = 1;
-            this.handleSelectContract(row);
-            break;
-          case '140': //销售订单
-            this.handleSelectSaleOrder(row);
-            break;
-          case '190': //销售对账单
-            this.accountType = 1;
-            this.handleSelectAccount(row);
-            break;
-          case '210': //供应商
-            this.handleSelectContact(row);
-            break;
-          case '230': //采购计划
-            this.handleSelectPlan(row);
-            break;
-          case '250': //采购合同
-            this.contractType = 2;
-            this.handleSelectContract(row);
-            break;
-          case '260': //采购订单
-            this.handleSelectPurchaseOrder(row);
-            break;
-          case '290': //采购对账单
-            this.accountType = 2;
-            this.handleSelectAccount(row);
-            break;
-          case '900': //项目
-            //this.handleSelectPurchaseOrder(row);
-            break;
-        }
 
-        // // 客户/供应商
-        // if (['100', '210'].includes(row.linkType)) {
-        //   this.handleSelectContact(row)
-        // }else if(['130', '250'].includes(row.linkType)){
-        //   handleSelectContract
-        // }
-      },
-      //获取费用类别选中数据
-      changeFeeTypeInfo(val, row, index) {
-        this.editIndex = index;
-        if (!val) {
-          this.$set(
-            this.form.datasource[this.editIndex],
-            'financeCostTypeName',
-            ''
-          );
-          this.$set(
-            this.form.datasource[this.editIndex],
-            'financeCostType',
-            ''
-          );
-        }
-        this.$nextTick(() => {
-          let data =
-            this.$refs['feeTypeTree' + index]?.$refs?.tree?.getCurrentNode() ||
-            {};
-          this.$set(
-            this.form.datasource[this.editIndex],
-            'financeCostTypeName',
-            data.name
-          );
-          this.$set(
-            this.form.datasource[this.editIndex],
-            'financeCostType',
-            data.code
-          );
-        });
-      },
-
-      setSelectData(val) {
-        console.log(val,'val')
-        this.$set(this.form.datasource[this.editIndex], 'linkId', val.id);
-        this.$set(this.form.datasource[this.editIndex], 'linkName', val.name);
-        this.$set(this.form.datasource[this.editIndex], 'linkCode', val.code);
-        this.$set(this.form.datasource[this.editIndex], 'amount', val.amount);
-        this.handleChangeAmount();
+    setSelectData(val) {
+      console.log(val, 'val');
+      this.$set(this.form.datasource[this.editIndex], 'linkId', val.id);
+      this.$set(this.form.datasource[this.editIndex], 'linkName', val.name);
+      this.$set(this.form.datasource[this.editIndex], 'linkCode', val.code);
+      this.$set(this.form.datasource[this.editIndex], 'amount', val.amount);
+      this.handleChangeAmount();
+    },
+    clearData() {
+      this.form.datasource = [];
+    },
+    handleChangeAmount(val, row) {
+      let totalPrice = this.form.datasource.reduce((total, item) => {
+        total += item.amount;
+        return total;
+      }, 0);
+      this.$emit('setTotalPrice', totalPrice);
+    },
+    //删除关联信息数据
+    handleDelInfo(index) {
+      this.form.datasource.splice(index, 1);
+      this.handleChangeAmount();
+    },
+    //修改关联类型
+    handleChangeFinLink(val, row, index) {
+      this.editIndex = index;
+      this.setSelectData({
+        id: '',
+        name: '',
+        code: '',
+        amount: ''
+      });
+      this.$nextTick(() => {
+        this.$refs.form.clearValidate('datasource.' + index + '.linkName');
+      });
+      if (!val) return (row.linkTypeName = '');
+      row.linkTypeName = this.fin_link_type.find(
+        (item) => item.value == val
+      )?.label;
+    },
 
-        
-      },
-      clearData() {
-        this.form.datasource = [];
-      },
-      handleChangeAmount(val, row) {
-        let totalPrice = this.form.datasource.reduce((total, item) => {
-          total += item.amount;
-          return total;
-        }, 0);
-        this.$emit('setTotalPrice', totalPrice);
-      },
-      //删除关联信息数据
-      handleDelInfo(index) {
-        this.form.datasource.splice(index, 1);
-        this.handleChangeAmount();
-      },
-      //修改关联类型
-      handleChangeFinLink(val, row, index) {
-        this.editIndex = index;
-        this.setSelectData({
-          id: '',
-          name: '',
-          code: '',
-          amount:''
-        });
-        this.$nextTick(() => {
-          this.$refs.form.clearValidate('datasource.' + index + '.linkName');
-        });
-        if (!val) return (row.linkTypeName = '');
-        row.linkTypeName = this.fin_link_type.find(
-          (item) => item.value == val
-        )?.label;
+    //选择客户或者供应商
+    handleSelectContact(row) {
+      this.customerListDialogFlag = true;
+      let params = {
+        id: row.contactId,
+        assetTreeId: row.linkType == 210 ? '19' : '17',
+        classType: row.linkType == 210 ? 2 : 1,
+        titleName: row.linkType == 210 ? '选择供应商' : '选择客户'
+      };
+      this.$nextTick(() => {
+        this.$refs.customerListDialogRef.init(params);
+      });
+    },
+    //获取选择 供应商/客户 数据
+    getCustomerData(params) {
+      this.setSelectData(params);
+    },
+    //获取商机
+    async getOpportunityList() {
+      this.opportunityDialogFlag = true;
+    },
+    //获取选择的商机数据
+    getOpportunityData(params) {
+      console.log(params);
+      let row = {
+        id: params.id,
+        name: params.name,
+        code: params.code
+      };
+      this.setSelectData(row);
+    },
+    //对账单
+    async handleSelectAccount() {
+      this.accountStatementDialogFlag = true;
+    },
+    //获取选择的对账单数据
+    getAccountData(params) {
+      let row = {
+        id: params.id,
+        name: params.statementNo,
+        code: params.statementNo
+      };
+      this.setSelectData(row);
+    },
+    //采购计划
+    async handleSelectPlan() {
+      this.planDialogFlag = true;
+    },
+    //获取选择的采购计划数据
+    getPlanData(params) {
+      let row = {
+        id: params.id,
+        name: params.planName,
+        code: params.planCode
+      };
+      this.setSelectData(row);
+    },
+    //选择人员数据
+    changeUserInfo(val, info) {
+      this.form.applyUserName = info.name;
+    },
+    //选择合同
+    handleSelectContract(val) {
+      this.contractListDialogFlag = true;
+      this.$nextTick(() => {
+        this.$refs.contractListDialogRef.init();
+      });
+    },
+    //获取合同数据
+    getContractData(params) {
+      let row = {
+        id: params.id,
+        name: params.contractName,
+        code: params.contractNo,
+        amount: params.discountTotalPrice
+      };
+      this.setSelectData(row);
+    },
+    //选择销售订单
+    handleSelectSaleOrder(val) {
+      this.$refs.saleOrderListDialogRef.open();
+    },
+    //选择采购订单
+    handleSelectPurchaseOrder(val) {
+      this.$refs.purchaseOrderListDialogRef.open();
+    },
+    //获取采购/销售订单数据
+    getOrderData(params) {
+      let row = {
+        id: params.id,
+        name: params.orderNo,
+        code: params.orderNo,
+        amount: params.payAmount
+      };
+      this.setSelectData(row);
+    },
+    handleViewDetail(row) {
+      let rowL = {
+        ...row,
+        id: row.linkId,
+        orderNo: row.linkCode
+      };
+      console.log('完整行数据参考:', rowL);
+      console.log(rowL.linkType);
 
-        // if (val.dictCode == 3) {
-        //   this.getOpportunityList()
-        // }
-      },
+      switch (rowL.linkType) {
+        case '100': //客户
+          this.$refs.KHdrawerRef.open(rowL, 'myList');
+          break;
+        case '120': //商机
+          this.$refs.SJdrawerRef.open(rowL);
+          break;
+        case '130': //销售合同
+          this.$refs.contactDetailDialogRef.open(rowL);
+          break;
+        case '140': //销售订单
+          this.$refs.XSdrawerRef.open(rowL);
+          break;
+        case '190': //销售对账单
+          this.xsdDialogFlag = true;
+          this.$refs.XSDZDdetailDialogRef.open('view', rowL, '1');
+          break;
+        case '210': //供应商
+          this.$refs.GYScontactDetailDialogRef.open(rowL);
+          break;
+        case '230': //采购计划
+          this.$refs.CGJHdetailDialogRef.open(rowL);
+          break;
+        case '250': //采购合同
+          this.$refs.contactDetailDialogRef.open(rowL);
+          break;
+        case '260': //采购订单
+          this.$refs.CGDDdetailDialogRef.open(rowL);
+          break;
+        case '290': //采购对账单
+          this.xsdDialogFlag = true;
+          this.$refs.XSDZDdetailDialogRef.open('view', rowL, '1');
+          break;
+        case '900': //项目
+          //this.handleSelectPurchaseOrder(row);
+          break;
+      }
+    },
 
-      //选择客户或者供应商
-      handleSelectContact(row) {
-        this.customerListDialogFlag = true;
-        let params = {
-          id: row.contactId,
-          assetTreeId: row.linkType == 210 ? '19' : '17',
-          classType: row.linkType == 210 ? 2 : 1,
-          titleName: row.linkType == 210 ? '选择供应商' : '选择客户'
-        };
-        this.$nextTick(() => {
-          this.$refs.customerListDialogRef.init(params);
+    getTableValidate() {
+      return new Promise((resolve, reject) => {
+        if (this.form.datasource.length == 0)
+          return this.$message.warning('请填写关联信息');
+        this.$refs.form.validate((valid) => {
+          if (!valid) return this.$message.warning('请填写完整信息');
+          resolve(this.form.datasource);
         });
-      },
-      //获取选择 供应商/客户 数据
-      getCustomerData(params) {
-        this.setSelectData(params);
-      },
-      //获取商机
-      async getOpportunityList() {
-        this.opportunityDialogFlag = true;
-      },
-      //获取选择的商机数据
-      getOpportunityData(params) {
-        console.log(params);
-        let row = {
-          id: params.id,
-          name: params.name,
-          code: params.code,
-        
-        };
-        this.setSelectData(row);
-      },
-      //对账单
-      async handleSelectAccount() {
-        this.accountStatementDialogFlag = true;
-      },
-      //获取选择的对账单数据
-      getAccountData(params) {
-        let row = {
-          id: params.id,
-          name: params.statementNo,
-          code: params.statementNo
-        };
-        this.setSelectData(row);
-      },
-      //采购计划
-      async handleSelectPlan() {
-        this.planDialogFlag = true;
-      },
-      //获取选择的采购计划数据
-      getPlanData(params) {
-        let row = {
-          id: params.id,
-          name: params.planName,
-          code: params.planCode
-        };
-        this.setSelectData(row);
-      },
-      //选择人员数据
-      changeUserInfo(val, info) {
-        this.form.applyUserName = info.name;
-      },
-      //选择合同
-      handleSelectContract(val) {
-        this.contractListDialogFlag = true;
-        this.$nextTick(() => {
-          this.$refs.contractListDialogRef.init();
-        });
-      },
-      //获取合同数据
-      getContractData(params) {
-        let row = {
-          id: params.id,
-          name: params.contractName,
-          code: params.contractNo,
-          amount:params.discountTotalPrice
-        };
-        this.setSelectData(row);
-      },
-      //选择销售订单
-      handleSelectSaleOrder(val) {
-        this.$refs.saleOrderListDialogRef.open();
-      },
-      //选择采购订单
-      handleSelectPurchaseOrder(val) {
-        this.$refs.purchaseOrderListDialogRef.open();
-      },
-      //获取采购/销售订单数据
-      getOrderData(params) {
-        let row = {
-          id: params.id,
-          name: params.orderNo,
-          code: params.orderNo,
-          amount:params.payAmount
-        };
-        this.setSelectData(row);
-      },
-      getTableValidate() {
-        return new Promise((resolve, reject) => {
-          if (this.form.datasource.length == 0)
-            return this.$message.warning('请填写关联信息');
-          this.$refs.form.validate((valid) => {
-            if (!valid) return this.$message.warning('请填写完整信息');
-            resolve(this.form.datasource);
-          });
-        });
-      }
+      });
     }
-  };
+  }
+};
 </script>
 
 <style scoped lang="scss">
-  :deep(.el-form-item) {
-    margin-bottom: 0;
+:deep(.el-form-item) {
+  margin-bottom: 0;
+}
+
+/* 调整详情按钮 hover 样式(可选) */
+:deep(.el-button--text.el-button--mini) {
+  color: #409eff;
+  &:hover {
+    color: #66b1ff;
+    background-color: rgba(64, 158, 255, 0.05);
   }
-</style>
+}
+</style>

+ 1 - 0
src/views/purchasingManage/supplierManage/components/contactDetailDialog.vue

@@ -1459,6 +1459,7 @@
     // },
     methods: {
       async open(row, curNodeData) {
+        console.log(row)
         this.requestDict('生产类型');
         this.type =
           curNodeData.rootCategoryLevelId == '20250317001' ? '6' : '3';

+ 1 - 0
src/views/saleManage/saleOrder/accountstatement/components/detailDialog.vue

@@ -106,6 +106,7 @@ export default {
   },
   methods: {
     async open(dialogType, row, type = '') {
+      console.log(row)
       this.form = row
       this.dialogType = dialogType
       this.dataForm.type = type

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

@@ -432,7 +432,7 @@
           let flag =
             scope.row.typeId == 2 &&
             scope.row.isApply != 1 &&
-            this.type == 'edit';
+      (this.type == 'edit' || this.type == 'add'); 
           return flag;
         };
       },

+ 26 - 20
src/views/salesServiceManagement/vehiclerecord/index.vue

@@ -36,22 +36,21 @@ export default {
       pietypeList: [],
       deptResList: [], // 部门
       deptIdToNameMap: {},
-      statusList:[
+      statusList: [
         {
-          value:1,
-          label:'处理中'
+          value: 1,
+          label: '处理中'
         },
-        
+
         {
-          value:2,
-          label:'通过'
+          value: 2,
+          label: '通过'
         },
-        
+
         {
-          value:3,
-          label:'不通过'
-        },
-        
+          value: 3,
+          label: '不通过'
+        }
       ],
       // 加载状态
       loading: false
@@ -90,7 +89,7 @@ export default {
           label: '申请人',
           align: 'center',
           showOverflowTooltip: true,
-          minWidth: 200,
+          minWidth: 200
         },
         {
           prop: 'department',
@@ -173,13 +172,18 @@ export default {
           align: 'center',
           showOverflowTooltip: true,
           minWidth: 200,
+          formatter: (row) => {
+          const currentStatus = row.status;
+          const matchedItem = this.statusList.find(item => item.value === currentStatus);
+          return matchedItem ? matchedItem.label : '';
+        }
         },
         {
           prop: 'createTime',
           label: '创建时间',
           align: 'center',
           showOverflowTooltip: true,
-          minWidth: 200,
+          minWidth: 200
         }
       ];
     }
@@ -187,16 +191,18 @@ export default {
   methods: {
     getDeptNames(deptIdArr) {
       if (!deptIdArr || !Array.isArray(deptIdArr) || deptIdArr.length === 0) {
-        return "-";
+        return '-';
       }
-      const deptNames = deptIdArr.map(deptId => 
-        this.deptIdToNameMap[deptId] || ''
+      const deptNames = deptIdArr.map(
+        (deptId) => this.deptIdToNameMap[deptId] || ''
       );
-      return deptNames.join("、");
+      return deptNames.join('、');
     },
     getPieTypeLabel(value) {
       if (!value) return '';
-      const target = this.pietypeList.find(item => item.value === String(value));
+      const target = this.pietypeList.find(
+        (item) => item.value === String(value)
+      );
       return target ? target.label : value;
     },
     handlePietypeList(list, deptRes) {
@@ -214,8 +220,8 @@ export default {
         ...where
       });
       dataPromise
-        .then(response => console.log(response))
-        .catch(error => console.error('获取数据失败:', error));
+        .then((response) => console.log(response))
+        .catch((error) => console.error('获取数据失败:', error));
       return dataPromise;
     },
     /* 刷新表格 */