Ver Fonte

feat:销售返利通过状态可以编辑其他信息

zh há 2 anos atrás
pai
commit
f5e70b1d0c
1 ficheiros alterados com 52 adições e 66 exclusões
  1. 52 66
      src/views/finance/components/rebate_list-edit.vue

+ 52 - 66
src/views/finance/components/rebate_list-edit.vue

@@ -1,9 +1,9 @@
 <template>
   <div>
     <div class="sty">
-      <el-page-header @back="goBack" content="销售返利单"> </el-page-header>
+      <el-page-header content="销售返利单11" @back="goBack" />
     </div>
-    <el-divider></el-divider>
+    <el-divider />
     <!-- 表头 -->
     <div>
       <el-form ref="searchForm" :model="searchForm" label-width="100px" size="small" label-position="left">
@@ -17,13 +17,12 @@
                 placeholder="系统自动生成"
                 default-time="23:59:59"
                 value-format="yyyy-MM-dd HH:mm:ss"
-              >
-              </el-date-picker>
+              />
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="备注" prop="remark">
-              <el-input v-model="searchForm.remark" placeholder=""></el-input>
+              <el-input v-model="searchForm.remark" placeholder="" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -34,13 +33,13 @@
       <div class="fl">
         <el-button type="primary" size="small" @click="addFn">保存</el-button>
       </div>
-      <div class="fr" v-if="state == 'SAVE'">
+      <div v-if="state == 'SAVE'" class="fr">
         <el-button type="primary" size="small" @click="addRowFn">添加行</el-button>
         <el-button type="primary" size="small" @click="delRowFn">删除行</el-button>
       </div>
     </div>
     <!-- 列表 -->
-    <div v-if="this.state != 'SAVE'" class="mymain-container">
+    <div v-if="state != 'SAVE' && state != 'OK'" class="mymain-container">
       <div class="table">
         <el-table
           v-loading="listLoading"
@@ -53,63 +52,51 @@
           :row-class-name="rouClassNameFn"
           @row-click="onRowClick"
         >
-          <el-table-column align="left" label="序号" type="index" width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="left" label="返利类型" prop="walletName" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="right" label="返利总金额" prop="amount" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="right" label="暂扣返利" prop="withholdAmount" min-width="160" show-overflow-tooltip>
-          </el-table-column>
+          <el-table-column align="left" label="序号" type="index" width="100" show-overflow-tooltip />
+          <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip />
+          <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip />
+          <el-table-column align="left" label="返利类型" prop="walletName" min-width="160" show-overflow-tooltip />
+          <el-table-column align="right" label="返利总金额" prop="amount" min-width="160" show-overflow-tooltip />
+          <el-table-column align="right" label="暂扣返利" prop="withholdAmount" min-width="160" show-overflow-tooltip />
           <el-table-column
             align="left"
             label="政策文件流水号"
             prop="policyFileNo"
             min-width="160"
             show-overflow-tooltip
-          >
-          </el-table-column>
+          />
           <el-table-column align="left" label="政策文号" prop="policyDocNo" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.policyDocNo"></el-input>
+              <el-input v-model="scope.row.policyDocNo" />
             </template>
           </el-table-column>
-          <el-table-column align="left" label="政策年份" prop="policyYear" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="left" label="政策月份" prop="policyMonth" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="left" label="政策归属部门" prop="policyOrg" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="left" label="客户区域" prop="customerArea" min-width="160" show-overflow-tooltip>
-          </el-table-column>
-          <el-table-column align="left" label="客户属性" prop="customerAttr" min-width="160" show-overflow-tooltip>
-          </el-table-column>
+          <el-table-column align="left" label="政策年份" prop="policyYear" min-width="160" show-overflow-tooltip />
+          <el-table-column align="left" label="政策月份" prop="policyMonth" min-width="160" show-overflow-tooltip />
+          <el-table-column align="left" label="政策归属部门" prop="policyOrg" min-width="160" show-overflow-tooltip />
+          <el-table-column align="left" label="客户区域" prop="customerArea" min-width="160" show-overflow-tooltip />
+          <el-table-column align="left" label="客户属性" prop="customerAttr" min-width="160" show-overflow-tooltip />
           <el-table-column
             align="left"
             label="建立实际归属客户"
             prop="rewardActualCustomers"
             min-width="160"
             show-overflow-tooltip
-          >
-          </el-table-column>
+          />
           <el-table-column align="left" label="备注1" prop="remark1" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.remark1"></el-input>
+              <el-input v-model="scope.row.remark1" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="备注2" prop="remark2" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.remark2"></el-input>
+              <el-input v-model="scope.row.remark2" />
             </template>
           </el-table-column>
         </el-table>
       </div>
     </div>
     <!-- 列表 -->
-    <div v-if="this.state == 'SAVE'" class="mymain-container">
+    <div v-if="state == 'SAVE' || state =='OK'" class="mymain-container">
       <div class="table">
         <el-table
           v-loading="listLoading"
@@ -122,21 +109,21 @@
           :row-class-name="rouClassNameFn"
           @row-click="onRowClick"
         >
-          <el-table-column align="left" label="序号" type="index" width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="left" label="序号" type="index" width="100" show-overflow-tooltip />
           <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input disabled v-model="scope.row.customerNumber"></el-input>
+              <el-input v-model="scope.row.customerNumber" disabled />
             </template>
           </el-table-column>
           <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-select
-                filterable
-                @change="changeCustomerFn($event, scope.$index, scope.row)"
                 v-model="scope.row.customerId"
+                filterable
                 placeholder="请选择"
+                @change="changeCustomerFn($event, scope.$index, scope.row)"
               >
-                <el-option v-for="item in customerData" :key="item.id" :label="item.name" :value="item.id"> </el-option>
+                <el-option v-for="item in customerData" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </template>
           </el-table-column>
@@ -149,8 +136,7 @@
                   :key="item.customerWalletId"
                   :label="item.name"
                   :value="item.customerWalletId"
-                >
-                </el-option>
+                />
               </el-select>
               <!-- <el-select v-else v-model="scope.row.walletName" placeholder="请选择">
                 <el-option :label="scope.row.walletName" value=""> </el-option>
@@ -159,12 +145,12 @@
           </el-table-column>
           <el-table-column align="left" label="返利总金额" prop="amount" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input class="mountclass" v-model.number="scope.row.amount"></el-input>
+              <el-input v-model.number="scope.row.amount" class="mountclass" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="暂扣返利" prop="withholdAmount" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input class="mountclass" v-model.number="scope.row.withholdAmount"></el-input>
+              <el-input v-model.number="scope.row.withholdAmount" class="mountclass" />
             </template>
           </el-table-column>
           <el-table-column
@@ -175,37 +161,37 @@
             show-overflow-tooltip
           >
             <template slot-scope="scope">
-              <el-input v-model="scope.row.policyFileNo"></el-input>
+              <el-input v-model="scope.row.policyFileNo" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="政策文号" prop="policyDocNo" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.policyDocNo"></el-input>
+              <el-input v-model="scope.row.policyDocNo" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="政策年份" prop="policyYear" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.policyYear"></el-input>
+              <el-input v-model="scope.row.policyYear" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="政策月份" prop="policyMonth" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.policyMonth"></el-input>
+              <el-input v-model="scope.row.policyMonth" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="政策归属部门" prop="policyOrg" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.policyOrg"></el-input>
+              <el-input v-model="scope.row.policyOrg" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="客户区域" prop="customerArea" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.customerArea"></el-input>
+              <el-input v-model="scope.row.customerArea" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="客户属性" prop="customerAttr" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.customerAttr"></el-input>
+              <el-input v-model="scope.row.customerAttr" />
             </template>
           </el-table-column>
           <el-table-column
@@ -216,17 +202,17 @@
             show-overflow-tooltip
           >
             <template slot-scope="scope">
-              <el-input v-model="scope.row.rewardActualCustomers"></el-input>
+              <el-input v-model="scope.row.rewardActualCustomers" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="备注1" prop="remark1" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.remark1"></el-input>
+              <el-input v-model="scope.row.remark1" />
             </template>
           </el-table-column>
           <el-table-column align="left" label="备注2" prop="remark2" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.remark2"></el-input>
+              <el-input v-model="scope.row.remark2" />
             </template>
           </el-table-column>
         </el-table>
@@ -249,8 +235,8 @@ export default {
   },
   data() {
     return {
-      state: '', //单据状态
-      state2: false, //状态
+      state: '', // 单据状态
+      state2: false, // 状态
       dataList: [],
       listLoading: false, // 列表加载loading
       searchForm: {
@@ -277,9 +263,9 @@ export default {
     goBack() {
       this.$emit('setShowPage', 1)
     },
-    //获取详情数据
+    // 获取详情数据
     async getDataList() {
-      let res = await getRebateOrderDetail({ id: this.detailId })
+      const res = await getRebateOrderDetail({ id: this.detailId })
       //   this.searchForm.rebateOrderId = res.data.id;
       this.searchForm.theTime = res.data.theTime
       //   this.searchForm.createBy = res.data.createBy;
@@ -296,7 +282,7 @@ export default {
       this.dataList = res.data.items
       // this.$set(this.dataList, 'walletList', wallet.data)
     },
-    //保存
+    // 保存
     async addFn() {
       // await this.$refs.searchForm.validate();
 
@@ -319,10 +305,10 @@ export default {
       this.$message.success('保存成功')
       this.$emit('setShowPage', 1)
     },
-    //选择经销商名称事件
+    // 选择经销商名称事件
     async changeCustomerFn(v, index, value) {
       this.state2 = true
-      this.$nextTick(function () {
+      this.$nextTick(function() {
         value.customerWalletId = ''
         value.walletName = ''
       })
@@ -337,23 +323,23 @@ export default {
       this.$set(this.dataList[index], 'customerName', res2[0].name)
       this.$set(this.dataList[index], 'walletList', res.data)
     },
-    //获取经销商数据
+    // 获取经销商数据
     async getCustomerData() {
       const res = await getCustomerList({ pageSize: -1, pageNum: 1 })
       this.customerData = res.data.records
     },
     rouClassNameFn({ row, rowIndex }) {
-      //把每一行的索引放进row
+      // 把每一行的索引放进row
       row.index = rowIndex
     },
     onRowClick(row, event, column) {
       this.delIndex = row.index
     },
-    //删除行
+    // 删除行
     delRowFn() {
       this.dataList.splice(this.delIndex, 1)
     },
-    //添加行
+    // 添加行
     addRowFn() {
       this.dataList.push({
         customerNumber: '',