lilei пре 2 година
родитељ
комит
1305d9fd9f

+ 8 - 8
src/views/basicData/transferTypeManagement/editModal.vue

@@ -20,7 +20,7 @@
           :wrapper-col="formItemLayout.wrapperCol"
         >
           <a-form-model-item label="调拨类别" prop="allocateCategory">
-            <AllocateTypeByLevel id="transferTypeManagementEdit-allocateCategory" @change="changeCategory" :level="2" v-model="form.allocateCategory" placeholder="请选择调拨类别"></AllocateTypeByLevel>
+            <allocateType id="transferTypeManagementEdit-allocateCategory" v-model="allocateType" @change="changeCategory" :level="2" placeholder="请选择调拨类别"></allocateType>
           </a-form-model-item>
           <a-form-model-item label="调拨类型名称" prop="name">
             <a-input
@@ -45,11 +45,11 @@
 import { commonMixin } from '@/utils/mixin'
 import { VSelect } from '@/components'
 import { allocateTypeSave } from '@/api/allocateType'
-import AllocateTypeByLevel from '@/views/common/allocateTypeByLevel.js'
+import allocateType from '@/views/common/allocateType'
 export default {
   name: 'TransferTypeManagementEditModal',
   mixins: [commonMixin],
-  components: { VSelect, AllocateTypeByLevel },
+  components: { VSelect, allocateType },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -77,6 +77,7 @@ export default {
         labelCol: { span: 6 },
         wrapperCol: { span: 16 }
       },
+      allocateType: [],
       form: {
         name: '', // 调拨类型名称
         allocateCategory: undefined, //  调拨类别
@@ -100,11 +101,8 @@ export default {
       str = str.replace(/[\r\n]/g, '')
       this.form.name = str
     },
-    changeCategory (v) {
-      if (v) {
-        this.form.allocateCategory = v
-        this.$refs.ruleForm.clearValidate('allocateCategory')
-      }
+    changeCategory (v, opt) {
+      this.form.allocateCategory = v && v[1] ? v[1] : ''
     },
     //  保存
     handleSave () {
@@ -139,12 +137,14 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
+        this.allocateType = []
       }
     },
     itemSn (newValue, oldValue) {
       if (this.isShow && newValue) { //  编辑
         this.form.name = this.nowData && this.nowData.name ? this.nowData.name : ''
         this.form.allocateCategory = this.nowData && this.nowData.superior ? this.nowData.superior.allocateTypeSn : ''
+        this.allocateType = [this.form.allocateCategory, this.form.allocateCategory]
       } else { //  添加
         this.form.name = ''
         this.form.allocateCategory = undefined

+ 3 - 2
src/views/basicData/transferTypeManagement/list.vue

@@ -63,8 +63,9 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨类别', dataIndex: 'superior.name', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调拨类型名称', dataIndex: 'name', align: 'center', width: '40%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '费用类型', dataIndex: 'superior.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类别', dataIndex: 'superior.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调拨类型名称', dataIndex: 'name', align: 'center', width: '25%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象

+ 33 - 1
src/views/common/allocateType.js

@@ -30,6 +30,10 @@ const AllocateType = {
     changeOnSelect:{
       type: Boolean,
       default: false
+    },
+    level:{
+      type: [String,Number],
+      default: ''
     }
   },
   data() {
@@ -61,12 +65,40 @@ const AllocateType = {
     getProductBrand () {
       allocateTypeTreeList({}).then(res => {
         if (res.status == 200) {
-          this.list = res.data
+          if(this.level){
+            this.list = this.getBylevel(res.data)
+          }else{
+            this.list = res.data
+          }
         } else {
           this.list = []
         }
       })
     },
+    getBylevel(data){
+      const ret = []
+      // 显示一级分类
+      if(this.level == 1){
+        data.map(item => {
+          if(item.sonList){
+            delete item.sonList
+          }
+        })
+      }
+      // 显示二级分类
+      if(this.level == 2){
+        data.map(item => {
+          if(item.sonList){
+            item.sonList.map(cd => {
+              if(cd.sonList){
+                 delete cd.sonList
+              }
+            })
+          }
+        })
+      }
+      return data
+    }
   },
 };
 

+ 1 - 1
src/views/salesReturnManagement/salesReturn/salesReturnEdit.vue

@@ -450,7 +450,7 @@ export default {
       const _this = this
       const a = ['WAIT_CUSTOMER_SERVICE_CONFIRM', 'WAIT_FINANCIAL_AUDIT', 'FINANCIAL_REJECT', 'FINISH'].find(item => item == this.ordeDetail.billStatus)
       const status = a ? 'SALES_RETURN_AMOUNT' : 'SALES_RETURN_REASON'
-      const params = { sn: this.$route.params.sn, status: status }
+      const params = { salesReturnBillSn: this.$route.params.sn, priceType: status }
       _this.spinning = true
       // 导出
       if (type == 'export') {