Browse Source

feature: 调整合同字段

liuyaqi 2 years ago
parent
commit
e6a350bd19

+ 4 - 9
src/views/contract/components/DetailsProduct.vue

@@ -52,22 +52,17 @@
             prop: 'prodName',
           },
           {
-            label: '产品类别',
+            label: '产品型号',
             width: '100px',
-            prop: 'prodClass',
+            prop: 'prodCode',
           },
           {
-            label: '建议成交价',
-            width: '120px',
-            prop: 'sugSalesPrice',
-          },
-          {
-            label: '售价',
+            label: '单价',
             width: '120px',
             prop: 'tranPrice',
           },
           {
-            label: '数量',
+            label: '产品数量',
             width: '100px',
             prop: 'prodNum',
           },

+ 25 - 3
src/views/contract/components/Edit.vue

@@ -106,13 +106,18 @@
         <el-col :span="12">
           <el-form-item label="合同类型" prop="contractType">
             <el-select v-model="editForm.contractType" placeholder="合同类型" style="width: 100%">
-              <el-option v-for="item in contractOptions" :key="item.value" :label="item.value" :value="item.value" />
+              <el-option v-for="item in contractOptions" :key="item.value" :label="item.value" :value="item.key" />
             </el-select>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :span="12">
+          <el-form-item label="签订单位类型" prop="signatoryType">
+            <el-select v-model="editForm.signatoryType" placeholder="签订单位类型" style="width: 100%">
+              <el-option v-for="item in signatoryOptions" :key="item.value" :label="item.value" :value="item.key" />
+            </el-select>
+          </el-form-item>
           <el-form-item label="客户签约人" prop="custSignatoryName">
             <el-select
               v-model="editForm.custSignatoryName"
@@ -215,6 +220,7 @@
           custName: '', // 客户名称
           inchargeId: null, //销售工程师
           inchargeName: '', //销售工程师姓名
+          signatoryType: '',
           contractStartTime: '', //合同开始时间
           contractEndTime: '', //合同结束时间
           signatoryName: '', //公司签约人
@@ -228,6 +234,7 @@
         editRules: {
           contractName: [{ required: true, trigger: 'blur', message: '请输入合同名称' }],
           contractType: [{ required: true, trigger: 'change', message: '请选择合同类型' }],
+          signatoryType: [{ required: true, trigger: 'change', message: '请选择签订单位类型' }],
           nboName: [{ required: true, trigger: 'change', message: '请选择关联项目' }],
           contractStartTime: [
             { required: true, trigger: 'change', validator: this.pickerOptionsStart, message: '请选择开始时间' },
@@ -256,6 +263,20 @@
           },
         },
         contractOptions: [], //合同类型
+        signatoryOptions: [
+          {
+            key: '10',
+            value: '终端用户',
+          },
+          {
+            key: '20',
+            value: '经销商',
+          },
+          {
+            key: '30',
+            value: '代理商',
+          },
+        ], //合同类型
         productData: [],
         multiple: false,
         property: '',
@@ -432,7 +453,7 @@
       async contractSave() {
         let product = this.productData.map((item) => ({
           prodId: item.id,
-          prodNum: item.count,
+          prodNum: parseInt(item.count),
           maintTerm: 1,
           sugSalesPrice: item.guidPrice,
           tranPrice: item.price,
@@ -451,7 +472,7 @@
       async contractEdit() {
         let product = this.productData.map((item) => ({
           prodId: item.id,
-          prodNum: item.count,
+          prodNum: parseInt(item.count),
           maintTerm: 1,
           sugSalesPrice: item.guidPrice,
           tranPrice: item.price,
@@ -476,6 +497,7 @@
           custName: '', // 客户名称
           inchargeId: null, //销售工程师
           inchargeName: '', //销售工程师名称
+          signatoryType: '',
           contractStartTime: '', //合同开始时间
           contractEndTime: '', //合同结束时间
           signatoryName: '', //公司签约人

+ 81 - 31
src/views/contract/index.vue

@@ -67,15 +67,46 @@
           <span v-else-if="item.prop === 'contractAmount'">
             {{ formatPrice(row.contractAmount) }}
           </span>
-          <span v-else-if="item.label === '合同时间'">
+          <span v-else-if="item.label === '合同有效时间'">
             {{ parseTime(row.contractStartTime, '{y}-{m}-{d}') }}~{{ parseTime(row.contractEndTime, '{y}-{m}-{d}') }}
           </span>
+          <span v-else-if="item.label === '合同类型'">
+            {{ contractOptions[row.contractType] }}
+          </span>
+          <span v-else-if="item.label === '签订单位类型'">
+            {{
+              row.signatoryType == '10'
+                ? '终端用户'
+                : row.signatoryType == '20'
+                ? '经销商'
+                : row.signatoryType == '30'
+                ? '代理商'
+                : ''
+            }}
+          </span>
+          <span v-else-if="item.label === '合同签订单位'">
+            {{
+              row.signatoryType == '10'
+                ? row.custName
+                : row.signatoryType == '20'
+                ? row.distributorName
+                : row.signatoryType == '30'
+                ? row.distributorName
+                : ''
+            }}
+          </span>
+          <span v-else-if="item.label === '合同签订时间'">
+            {{ parseTime(row.createdTime, '{y}-{m}-{d}') }}
+          </span>
+          <span v-else-if="item.label === '回款金额'">
+            {{ formatPrice(row.collectedAmount) }}
+          </span>
           <el-button
-            v-else-if="item.prop === 'contractName'"
+            v-else-if="item.prop === 'contractCode'"
             style="font-size: 14px"
             type="text"
             @click="handleContractDetail(row)">
-            {{ row.contractName }}
+            {{ row.contractCode }}
           </el-button>
           <span v-else>{{ row[item.prop] }}</span>
         </template>
@@ -140,6 +171,7 @@
         selectRows: [], //选择的表格数据
         industryOptions: [], //客户行业
         levelOptions: [], //客户级别
+        contractOptions: {}, //合同类型
         // 自定义列表
         checkList: [],
         columns: [
@@ -151,79 +183,86 @@
             disableCheck: false,
           },
           {
-            label: '合同名称',
-            width: '280px',
-            prop: 'contractName',
+            label: '合同类型',
+            width: '100px',
+            prop: 'contractType',
             sortable: false,
             disableCheck: false,
           },
+          // {
+          //   label: '审批状态',
+          //   width: '100px',
+          //   prop: 'approStatus',
+          //   sortable: false,
+          //   disableCheck: false,
+          // },
           {
-            label: '客户名称',
-            width: '280px',
-            prop: 'custName',
+            label: '所在省',
+            width: '100px',
+            prop: 'custProvince',
             sortable: false,
             disableCheck: false,
           },
           {
-            label: '项目名称',
-            width: '280px',
-            prop: 'nboName',
+            label: '所在市',
+            width: '100px',
+            prop: 'custCity',
             sortable: false,
             disableCheck: false,
           },
           {
-            label: '合同类型',
-            width: '100px',
-            prop: 'contractType',
+            label: '客户名称',
+            width: '280px',
+            prop: 'custName',
             sortable: false,
             disableCheck: false,
           },
           {
-            label: '合同金额',
+            label: '签订单位类型',
             width: '120px',
-            prop: 'contractAmount',
+            prop: 'signatoryType',
             sortable: false,
             disableCheck: false,
           },
           {
-            label: '合同时间',
-            width: '180px',
+            label: '合同签订单位',
+            width: '120px',
             prop: 'distributorName',
             sortable: false,
             disableCheck: false,
           },
           {
-            label: '审批状态',
-            width: '100px',
-            prop: 'approStatus',
+            label: '合同签订时间',
+            width: '120px',
+            prop: 'createdTime',
             sortable: false,
             disableCheck: false,
           },
           {
-            label: '销售工程师',
-            width: '120px',
-            prop: 'inchargeName',
+            label: '合同有效时间',
+            width: '200px',
+            prop: 'contractStartTime',
             sortable: false,
             disableCheck: false,
           },
           {
-            label: '公司签约人',
+            label: '合同金额',
             width: '120px',
-            prop: 'signatoryName',
+            prop: 'contractAmount',
             sortable: false,
             disableCheck: false,
           },
           {
-            label: '客户签约人',
+            label: '回款金额',
             width: '120px',
-            prop: 'custSignatoryName',
+            prop: 'collectedAmount',
             sortable: false,
             disableCheck: false,
           },
           {
-            label: '经销商/代理商',
+            label: '销售工程师',
             width: '120px',
-            prop: 'distributorName',
+            prop: 'inchargeName',
             sortable: false,
             disableCheck: false,
           },
@@ -237,8 +276,19 @@
     },
     mounted() {
       this.queryData()
+      this.getOptions()
     },
     methods: {
+      getOptions() {
+        Promise.all([this.getDicts('contract_type')])
+          .then(([contract]) => {
+            this.contractOptions = {}
+            contract.data.values.filter((i) => {
+              this.contractOptions[i.key] = i.value
+            })
+          })
+          .catch((err) => console.log(err))
+      },
       async queryData() {
         this.listLoading = true
         const params = { ...this.queryForm }