lilei %!s(int64=4) %!d(string=hai) anos
pai
achega
a844ade532

+ 9 - 5
src/views/financialManagement/expenseManagement/edit.vue

@@ -22,7 +22,7 @@
             @change="changeCostType"
             change-on-select
             v-model="form.costType"
-			expand-trigger="hover"
+            expand-trigger="hover"
             :options="costTypeList"
             :fieldNames="{ label: 'name', value: 'costTypeSn', children: 'children' }"
             id="productInfoList-costType"
@@ -133,9 +133,13 @@ export default {
     },
     //  费用类型  change
     changeCostType (val, opt) {
+      console.log(val, opt)
       this.form.expensesTypeSn1 = val[0] ? val[0] : ''
       this.form.expensesTypeSn2 = val[1] ? val[1] : ''
       this.form.expensesTypeSn3 = val[2] ? val[2] : ''
+      this.form.expensesTypeName1 = val[0] ? opt[0].name : ''
+      this.form.expensesTypeName2 = val[1] ? opt[1].name : ''
+      this.form.expensesTypeName3 = val[2] ? opt[2].name : ''
     },
     //  详情
     getDetail () {
@@ -154,10 +158,10 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
-          if (!this.form.expensesTypeSn3) {
-            this.$message.warning('费用类型未选到第三级,请修改后再提交!')
-            return
-          }
+          // if (!this.form.expensesTypeSn3) {
+          //   this.$message.warning('费用类型未选到第三级,请修改后再提交!')
+          //   return
+          // }
           if (this.form.settleAmount <= 0) {
             this.$message.warning('费用金额必须大于0!')
             return

+ 5 - 2
src/views/financialManagement/expenseManagement/list.vue

@@ -72,7 +72,10 @@
       :data="loadData"
       :scroll="{ x: 1120, y: tableHeight }"
       bordered>
-
+      <!-- 费用类别 -->
+      <template slot="expensesType" slot-scope="text, record">
+        {{ record.expensesTypeName1 }} <span v-if="record.expensesTypeName2">>{{ record.expensesTypeName2 }}</span> <span v-if="record.expensesTypeName3">>{{ record.expensesTypeName3 }}</span>
+      </template>
       <!-- 状态 -->
       <template slot="accountExpensesNo" slot-scope="text, record">
         <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ text }}</span>
@@ -145,7 +148,7 @@ export default {
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '费用单号', dataIndex: 'accountExpensesNo', width: 250, align: 'center', scopedSlots: { customRender: 'accountExpensesNo' } },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '费用类型', dataIndex: 'name', align: 'center', customRender: function (text, record) { return [record.expensesTypeName1, record.expensesTypeName2, record.expensesTypeName3].join(' > ') } },
+        { title: '费用类型', align: 'center', scopedSlots: { customRender: 'expensesType' } },
         { title: '金额', dataIndex: 'settleAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '单据状态', dataIndex: 'stateDictValue', width: 110, align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }