Explorar o código

Merge remote-tracking branch 'origin/develop' into develop

FengChaoYu %!s(int64=3) %!d(string=hai) anos
pai
achega
a6edd713c3

+ 9 - 0
src/api/policy_list.js

@@ -34,6 +34,15 @@ export function getConditionList(params) {
   });
 }
 
+//克隆
+export function cloneList(params) {
+  return request({
+    url: "/policy/material/clone",
+    method: "post",
+    params,
+  });
+}
+
 
 //物料列表
 export function getK3List(params) {

+ 19 - 0
src/views/basic_data/dealer/components/dealer_deposit_history.vue

@@ -52,6 +52,25 @@
           />
           <el-table-column
             align="center"
+            label="状态"
+            prop="currentStatus"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-tag type="info" v-if="scope.row.currentStatus == '未开始'"
+                >未开始</el-tag
+              >
+              <el-tag type="success" v-if="scope.row.currentStatus == '生效中'"
+                >生效中</el-tag
+              >
+              <el-tag type="danger" v-if="scope.row.currentStatus == '已结束'"
+                >已结束</el-tag
+              >
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
             label="开始时间"
             prop="startTime"
             min-width="160"

+ 110 - 3
src/views/basic_data/dealer/dealer_deposit.vue

@@ -31,8 +31,25 @@
                 ></el-input>
               </el-form-item>
             </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="状态" prop="currentStatus">
+                <el-select
+                  class="selectStyle"
+                  v-model="searchForm.currentStatus"
+                  placeholder="请选择"
+                >
+                  <el-option
+                    v-for="item in statusList"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
 
-            <el-col :xs="24" :sm="12" :lg="18">
+            <el-col :xs="24" :sm="12" :lg="12">
               <el-form-item label="" class="fr">
                 <el-button size="small" @click="clearFn">清空</el-button>
                 <el-button size="small" type="primary" @click="searchFn"
@@ -54,6 +71,20 @@
             >新增</el-button
           >
         </div>
+        <div class="fr">
+          <el-button type="primary" size="small" @click="downLoadFn"
+            >模板</el-button
+          >
+          <el-upload
+            class="import-btn"
+            action=""
+            :http-request="handleImport"
+            :file-list="importFileList"
+            :show-file-list="false"
+          >
+            <el-button type="primary" size="small">批量导入</el-button>
+          </el-upload>
+        </div>
       </div>
 
       <div class="mymain-container">
@@ -98,6 +129,27 @@
             />
             <el-table-column
               align="center"
+              label="状态"
+              prop="currentStatus"
+              min-width="160"
+              show-overflow-tooltip
+            >
+              <template slot-scope="scope">
+                <el-tag type="info" v-if="scope.row.currentStatus == '未开始'"
+                  >未开始</el-tag
+                >
+                <el-tag
+                  type="success"
+                  v-if="scope.row.currentStatus == '生效中'"
+                  >生效中</el-tag
+                >
+                <el-tag type="danger" v-if="scope.row.currentStatus == '已结束'"
+                  >已结束</el-tag
+                >
+              </template>
+            </el-table-column>
+            <el-table-column
+              align="center"
               label="开始时间"
               prop="startTime"
               min-width="160"
@@ -305,6 +357,7 @@ import {
 } from "@/api/basic_data/dealer";
 // import { number } from "echarts";
 import DealerDepositHistory from "./components/dealer_deposit_history";
+import { downloadFiles, handleImport } from "@/utils/util";
 
 export default {
   components: {
@@ -312,6 +365,7 @@ export default {
   },
   data() {
     return {
+      importFileList: [],
       historyId: "",
       showHistory: true,
       marks: {
@@ -397,6 +451,21 @@ export default {
       showDialog: false,
       dataList: [],
       dealerList: [],
+      statusList: [
+        {
+          value: "1",
+          label: "未开始",
+        },
+        {
+          value: "2",
+          label: "生效中",
+        },
+        {
+          value: "3",
+          label: "已结束",
+        },
+      ],
+      currentStatus: "",
     };
   },
   async created() {
@@ -427,7 +496,27 @@ export default {
     //     this.$message.warning("已选定额押金,如需选择押金比例,请把定额押金归零");
     //   }
     // },
+    // 导入
+    async handleImport(param) {
+      const file = param.file;
+
+      const formData = new FormData();
+      formData.append("file", file);
 
+      let result = await handleImport("/customer/deposit/import", formData);
+
+      console.log(result);
+      this.importFileList = [];
+      if (result.code == 200) {
+        this.$message.success("导入成功");
+      } else {
+        this.$message.error(result.message);
+      }
+    },
+    //下载模板
+    async downLoadFn() {
+      downloadFiles("/customer/deposit/downModel");
+    },
     //记录
     logFn(id) {
       this.historyId = id;
@@ -474,18 +563,29 @@ export default {
     handleSizeChange(val) {
       this.pageSize = val;
       this.currentPage = 1;
-      this.getList({ pageNum: 1, pageSize: this.pageSize });
+      this.getList({
+        pageNum: 1,
+        pageSize: this.pageSize,
+        keyword: this.searchForm.customerName,
+        currentStatus: this.searchForm.currentStatus,
+      });
     },
     // 更改当前页
     handleCurrentChange(val) {
       this.currentPage = val;
-      this.getList({ pageNum: val, pageSize: 10 });
+      this.getList({
+        pageNum: val,
+        pageSize: 10,
+        keyword: this.searchForm.customerName,
+        currentStatus: this.searchForm.currentStatus,
+      });
     },
     //搜索功能
     async searchFn() {
       console.log(this.searchForm);
       await this.getList({
         keyword: this.searchForm.customerName,
+        currentStatus: this.searchForm.currentStatus,
         pageNum: 1,
         pageSize: 10,
       });
@@ -560,6 +660,9 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.selectStyle {
+  width: 100%;
+}
 ::v-deep .el-textarea__inner {
   resize: none;
 }
@@ -595,6 +698,10 @@ export default {
     margin-right: 12px;
   }
 }
+.import-btn {
+  display: inline-block;
+  margin-left: 10px;
+}
 // .main {
 //   padding: 12px;
 // }

+ 10 - 0
src/views/basic_data/material/modify_list.vue

@@ -83,6 +83,7 @@
           </el-popconfirm>
         </div>
         <div class="fr">
+            <ExportButton :exUrl="'/product-upd-price/export'" :exParams="exParams" />
           <!-- <el-button type="primary" size="small">导入</el-button>
           <el-button type="primary" size="small">导出</el-button>
           <el-button type="primary" size="small">打印</el-button> -->
@@ -469,6 +470,15 @@ export default {
     ModifyListApproval,
     ModifyListDetail,
   },
+  computed:{
+    exParams() {
+      return {
+        materialName: this.screenForm.materialName,
+        materialNumber: this.screenForm.materialNumber,
+        startDate:this.screenForm.startDate
+      };
+    },
+  },
   mounted() {
     let params = {
       pageNum: 1,

+ 28 - 24
src/views/engin_deposit/components/refund_list-detail.vue

@@ -50,6 +50,7 @@
           <div class="value">
             <el-input
               :disabled="title == '详情'"
+              placeholder="请输入"
               v-model="detailList.refFactoryNo"
             ></el-input>
           </div>
@@ -82,7 +83,8 @@
               class="selectStyle"
               v-model="detailList.sendFactoryDate"
               type="datetime"
-              placeholder=""
+              prefix-icon="''"
+              placeholder="请选择寄厂日期"
               default-time="00:00:00"
               value-format="yyyy-MM-dd HH:mm:ss"
             >
@@ -97,11 +99,12 @@
           <div class="label">安装时间</div>
           <div class="value">
             <el-date-picker
+              prefix-icon="''"
+              placeholder="请选择安装时间"
               :disabled="title == '详情'"
               class="selectStyle"
               v-model="detailList.installDate"
               type="datetime"
-              placeholder=""
               default-time="00:00:00"
               value-format="yyyy-MM-dd HH:mm:ss"
             >
@@ -378,14 +381,15 @@
           <div class="label">验收人</div>
           <div class="value">{{ this.checkBy }}</div>
         </el-col>
-        <el-col :xs="12" :sm="12" :lg="12" class="item">
+        <el-col :xs="12" :sm="12" :lg="12" class="item dateS">
           <div class="label">验收日期</div>
           <div class="value">
             <el-date-picker
+              disabled
+              prefix-icon="''"
               class="selectStyle"
-              v-model="checkDate"
               type="datetime"
-              placeholder=""
+              placeholder="系统自动生成"
               default-time="00:00:00"
               value-format="yyyy-MM-dd HH:mm:ss"
             >
@@ -421,7 +425,7 @@
           <div class="label">验收人</div>
           <div class="value">{{ detailList.checkBy }}</div>
         </el-col>
-        <el-col :xs="12" :sm="12" :lg="12" class="item">
+        <el-col :xs="12" :sm="12" :lg="12" class="item dateS">
           <div class="label">验收日期</div>
           <div class="value">
             <el-date-picker
@@ -446,7 +450,7 @@
             </el-radio-group>
           </div>
         </el-col>
-        <el-col :xs="12" :sm="24" :lg="24" class="item">
+        <el-col :xs="12" :sm="24" :lg="24" class="item dateS">
           <div class="label">验收说明</div>
           <div class="value">
             <el-input
@@ -503,11 +507,12 @@ export default {
       dataList: [], // 列表数据
       detailList: {},
       checkBy: "",
-      checkDate: null,
+      checkDate: "",
       isRefundDeposit: true,
       checkNote: "",
     };
   },
+
   created() {
     console.log(this.$imageUrl, 8888);
     this.checkBy = this.name;
@@ -516,25 +521,11 @@ export default {
   methods: {
     //批量下载
     async batchDownloadFn() {
-      // let res = await getDepositManageDownZip({ parentId: this.detailId });
-      // console.log(res, 888999);
-      // // window.open(this.imageURL + "/deposit-manage/downZip");
-      // // console.log(res, 9999);
-      // if (res.data) {
-      //   window.open(this.imageURL + res.data);
-      // }
       downloadFiles("/deposit-manage/downZip", { parentId: this.detailId });
     },
     //下载
     downLoadFn(v) {
       window.open(this.imageURL + v);
-      // const url = this.imageURL + v;
-      // const link = document.createElement("a");
-      // link.style.display = "none";
-      // link.href = url;
-      // link.setAttribute("download", "导入学生账号模板");
-      // document.body.appendChild(link);
-      // link.click();
     },
     // 检查文件类型
     checkFileType(url) {
@@ -559,10 +550,14 @@ export default {
     },
     //审批驳回
     async rejectFn() {
+      if (!this.detailList.installDate) {
+        this.$message.error("请选择安装时间");
+        return;
+      }
       let data = {
         ...this.detailList,
         checkBy: this.checkBy,
-        checkDate: this.checkDate,
+        // checkDate: this.checkDate,
         isRefundDeposit: this.isRefundDeposit,
         checkNote: this.checkNote,
         examineResult: 0,
@@ -574,10 +569,14 @@ export default {
     },
     //审批通过
     async adoptFn() {
+      if (!this.detailList.installDate) {
+        this.$message.error("请选择安装时间");
+        return;
+      }
       let data = {
         ...this.detailList,
         checkBy: this.checkBy,
-        checkDate: this.checkDate,
+        // checkDate: this.checkDate,
         isRefundDeposit: this.isRefundDeposit,
         checkNote: this.checkNote,
         examineResult: 1,
@@ -612,6 +611,11 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.dateS {
+  .value {
+    padding: 0;
+  }
+}
 .batchDownload {
   float: right;
   margin-top: 9px;

+ 1 - 1
src/views/engin_deposit/deposit_list.vue

@@ -17,7 +17,7 @@
         >
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="工程订单编号" prop="refEnginRecordNo">
+              <el-form-item label="工程登录编码" prop="refEnginRecordNo">
                 <el-input
                   v-model="screenForm.refEnginRecordNo"
                   placeholder="请输入"

+ 16 - 0
src/views/finance/account_list.vue

@@ -107,6 +107,12 @@
             >记录</el-button
           >
         </div>
+        <div class="fr">
+          <ExportButton
+            :exUrl="'/finance/standing/book/export'"
+            :exParams="exParams"
+          />
+        </div>
       </div>
       <!-- 列表 -->
       <div class="mymain-container">
@@ -269,6 +275,16 @@ export default {
       walletList: [],
     };
   },
+  computed: {
+    exParams() {
+      return {
+        ...this.searchForm,
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        isReconciliation: false,
+      };
+    },
+  },
   created() {
     this.getDataList({
       pageSize: this.pageSize,

+ 1 - 1
src/views/finance/rebate_form.vue

@@ -386,7 +386,7 @@ export default {
       if (result.code == 200) {
         this.$message.success("导入成功");
       } else {
-        this.$message.error("导入失败");
+        this.$message.error(result.message);
       }
     },
     //下载模板

+ 15 - 1
src/views/finance/rebate_list.vue

@@ -71,7 +71,12 @@
           </el-row>
         </el-form>
       </div>
-
+      <!-- 按钮 -->
+      <div class="btn-group clearfix">
+        <div class="fr">
+          <ExportButton :exUrl="'/rebate/order/export'" :exParams="exParams" />
+        </div>
+      </div>
       <!-- 列表 -->
       <div class="mymain-container">
         <div class="table">
@@ -588,6 +593,15 @@ export default {
       isShow: null,
     };
   },
+  computed: {
+    exParams() {
+      return {
+        ...this.searchForm,
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+      };
+    },
+  },
   created() {
     this.getDataList({
       pageSize: this.pageSize,

+ 125 - 34
src/views/finance/standbook_list.vue

@@ -110,6 +110,15 @@
         </el-row>
       </el-form>
     </div>
+    <!-- 按钮 -->
+    <div class="btn-group clearfix">
+      <div class="fr">
+        <ExportButton
+          :exUrl="'/finance/standing/book/export'"
+          :exParams="exParams"
+        />
+      </div>
+    </div>
     <div v-show="bill == 'COMMONLY'">
       <!-- 列表 -->
       <div class="mymain-container">
@@ -357,7 +366,11 @@
               prop="billType"
               min-width="160"
               show-overflow-tooltip
-            ></el-table-column>
+            >
+              <template slot-scope="scope">
+                {{ scope.row.billType == 3 ? "付款单" : scope.row.billType }}
+              </template>
+            </el-table-column>
             <el-table-column
               align="center"
               label="单据号"
@@ -480,47 +493,125 @@ export default {
       isDisabled: false,
     };
   },
+  computed: {
+    exParams() {
+      // return {
+      //   type: this.bill,
+      // };
+      if (this.$route.query.customerName && this.$route.query.customerNumber) {
+        return {
+          ...this.searchForm,
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+          customerName: this.$route.query.customerName,
+          customerNumber: this.$route.query.customerNumber,
+        };
+      } else if (this.isCustomer) {
+        return {
+          ...this.searchForm,
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+          customerName: this.$store.state.user.customerName,
+          customerNumber: this.$store.state.user.customerNumber,
+        };
+      } else {
+        return {
+          ...this.searchForm,
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+          customerName: this.customerName,
+          customerNumber: this.customerNumber,
+        };
+      }
+    },
+  },
+  beforeRouteEnter(to, from, next) {
+    // console.log(to, from, next, 898);
+    next((vm) => {
+      // 这个时候组件还没有创建,所以要通过vm来访问
+      console.log(vm);
+      if (
+        from.path == "/finance/details/balance_sum" &&
+        to.path == "/finance/details/standbook_list"
+      ) {
+        //只有是从A进到B页面才执行
+        // 将要执行的逻辑
+
+        vm.isDisabled = true;
+        vm.searchForm.customerId = vm.$route.query.customerName;
+        vm.changeFn(vm.$route.query.customerId);
+        vm.getDataList({
+          pageSize: vm.pageSize,
+          pageNum: vm.currentPage,
+          type: vm.bill,
+          customerName: vm.$route.query.customerName,
+          customerNumber: vm.$route.query.customerNumber,
+        });
+      } else if (vm.isCustomer) {
+        vm.isDisabled = true;
+        vm.searchForm.customerId = vm.$store.state.user.customerName;
+        vm.changeFn(vm.$store.state.user.customerId);
+        vm.getDataList({
+          pageSize: vm.pageSize,
+          pageNum: vm.currentPage,
+          type: vm.bill,
+          customerName: vm.$store.state.user.customerName,
+          customerNumber: vm.$store.state.user.customerNumber,
+        });
+      } else {
+        vm.searchForm.customerId = "";
+        vm.isDisabled = false;
+        vm.getDataList({
+          pageSize: vm.pageSize,
+          pageNum: vm.currentPage,
+          type: vm.bill,
+        });
+        vm.getCustomerDataList();
+      }
+    });
+  },
 
   created() {
     // console.log(
     //   this.customerId,
     //   this.$store.state.user.customerName,
     //   this.$store.state.user.customerNumber,
-
     //   777777
     // );
-
-    if (this.$route.query.customerName && this.$route.query.customerNumber) {
-      this.isDisabled = true;
-      this.searchForm.customerId = this.$route.query.customerName;
-      this.changeFn(this.$route.query.customerId);
-      this.getDataList({
-        pageSize: this.pageSize,
-        pageNum: this.currentPage,
-        type: this.bill,
-        customerName: this.$route.query.customerName,
-        customerNumber: this.$route.query.customerNumber,
-      });
-    } else if (this.isCustomer) {
-      this.isDisabled = true;
-      this.searchForm.customerId = this.$store.state.user.customerName;
-      this.changeFn(this.$store.state.user.customerId);
-      this.getDataList({
-        pageSize: this.pageSize,
-        pageNum: this.currentPage,
-        type: this.bill,
-        customerName: this.$store.state.user.customerName,
-        customerNumber: this.$store.state.user.customerNumber,
-      });
-    } else {
-      this.getDataList({
-        pageSize: this.pageSize,
-        pageNum: this.currentPage,
-        type: this.bill,
-      });
-      this.getCustomerDataList();
-    }
-
+    // if (this.$route.query.customerName && this.$route.query.customerNumber) {
+    //   this.isDisabled = true;
+    //   this.searchForm.customerId = this.$route.query.customerName;
+    //   this.changeFn(this.$route.query.customerId);
+    //   this.getDataList({
+    //     pageSize: this.pageSize,
+    //     pageNum: this.currentPage,
+    //     type: this.bill,
+    //     customerName: this.$route.query.customerName,
+    //     customerNumber: this.$route.query.customerNumber,
+    //   });
+    // } else
+    // if (this.isCustomer) {
+    //   this.isDisabled = true;
+    //   this.searchForm.customerId = this.$store.state.user.customerName;
+    //   this.changeFn(this.$store.state.user.customerId);
+    //   this.getDataList({
+    //     pageSize: this.pageSize,
+    //     pageNum: this.currentPage,
+    //     type: this.bill,
+    //     customerName: this.$store.state.user.customerName,
+    //     customerNumber: this.$store.state.user.customerNumber,
+    //   });
+    // } else {
+    //   this.getDataList({
+    //     pageSize: this.pageSize,
+    //     pageNum: this.currentPage,
+    //     type: this.bill,
+    //   });
+    //   this.getCustomerDataList();
+    // }
     // this.getCustomerDataList();
     // this.getWalletList();
     // this.getDataDict();

+ 19 - 1
src/views/sales_policy/policy_list.vue

@@ -220,8 +220,19 @@
                 >作废</el-button
               >
             </el-popconfirm>
+                <el-popconfirm
+              v-if="$checkBtnRole('examine', $route.meta.roles)"
+              style="margin-left: 10px"
+              title="克隆?"
+              @onConfirm="handleClone(scope.row)"
+            >
+                <!--  -->
+              <el-button type="text" size="small" slot="reference"
+                >克隆</el-button
+              >
+            </el-popconfirm>
             <el-popconfirm
-              v-if="scope.row.examineStatus != 'OK'"
+              v-if="scope.row.examineStatus != 'OK' "
               style="margin-left: 10px"
               title="删除吗?"
               @onConfirm="hanleDelete(scope.row.id)"
@@ -329,6 +340,7 @@ import {
   deletePolicy,
   getpolicySubmit,
   toExamine,
+  cloneList
 } from "@/api/policy_list";
 import Minxin from "@/mixin";
 import { downloadFiles, handleImport } from "@/utils/util";
@@ -413,6 +425,12 @@ export default {
         this.isShow = 2;
       });
     },
+    handleClone(row){
+      cloneList({policyId:row.id}).then(res=>{
+        this.$successMsg('克隆成功')
+        this.getList()
+      })
+    },
     getList() {
       this.listLoading = true;
       const params = {

+ 251 - 83
src/views/supply/policy/components/retail_form.vue

@@ -17,7 +17,7 @@
       label-position="right"
     >
       <el-row :gutter="20">
-        <el-col :xs="24" :sm="12" :lg="8" >
+        <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="销售政策编号" prop="policyCode">
             <div style="display: flex">
               <el-input
@@ -70,6 +70,7 @@
             <el-select
               v-model="mainForm.k3ServiceName"
               placeholder="选择业务员"
+              @change="handleUser"
               style="width: 100%"
             >
               <el-option
@@ -86,7 +87,7 @@
 
     <div class="main-title">
       <div class="title">货品信息</div>
-      <div >
+      <div>
         <el-select
           v-model="warehouseValue"
           placeholder="请选择发货仓库"
@@ -222,8 +223,7 @@
         >
           <template slot-scope="scope">
             {{
-              (scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) /
-                100 || 0
+               (scope.row.price - scope.row.discAmount)*((scope.row.rebateRate * scope.row.qty) * 100)/100 || 0
             }}
           </template>
         </el-table-column>
@@ -273,7 +273,8 @@
           <template slot-scope="scope">
             <el-select
               size="small"
-              v-model="scope.row.k3ServiceName"
+              v-model="scope.row.serviceName"
+              @change="handleUser2($event,scope.row)"
               placeholder="选择业务员"
               style="width: 100%"
             >
@@ -387,10 +388,7 @@
       </el-table>
     </div>
 
-    <div class="page-footer" style="
-    position: fixed;
-    bottom: 0;
-  ">
+    <div class="page-footer" style="position: fixed; bottom: 0; z-index: 99">
       <div class="footer" :class="classObj">
         <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
         <el-popconfirm
@@ -491,20 +489,23 @@
         </el-form>
         <template v-if="!dataList.length">
           <div v-for="(item, index) in popDataArr" :key="index">
+            <div style="padding: 20px 0">
+              <div v-if="index == 0">限定机型</div>
+              <div v-else>配提机型{{ index }}</div>
+            </div>
             <el-table
+            class="table"
               v-loading="listLoading"
               :data="item"
               ref="singleTable"
               element-loading-text="Loading"
+              max-height="500"
               border
               fit
               highlight-current-row
               @select-all="handleSelectionChange($event, 1, index)"
               @selection-change="handleSelectionChange($event, 1, index)"
               stripe
-              show-summary
-              :summary-method="$getSummaries"
-
             >
               <el-table-column
                 align="center"
@@ -523,7 +524,13 @@
                   show-overflow-tooltip
                 >
                   <template slot-scope="scope">
-                    <el-input v-model="scope.row.qty" size="small"></el-input>
+                    <el-input
+                      type="number"
+                      v-model.lazy="scope.row.qty"
+                      @blur="blurQty(scope.row.qty, scope.row)"
+                      @input="funQty(scope.row.qty, scope.row, index)"
+                      size="small"
+                    ></el-input>
                   </template>
                 </el-table-column>
                 <el-table-column
@@ -548,8 +555,22 @@
                 >
                 </el-table-column>
               </template>
+              <template #append>
+                <div class="mybox">
+                  <el-row class="mybox-row" type="flex">
+                    <el-col style="width: 55px">合计</el-col>
+                    <el-col></el-col>
+                    <el-col></el-col>
+                    <el-col></el-col>
+                    <el-col>{{ totalArr[index].totalQty }}</el-col>
+                    <el-col>{{ totalArr[index].totalPrice }}</el-col>
+                    <el-col>{{ totalArr[index].totalAmount }}</el-col>
+                  </el-row>
+                </div>
+              </template>
             </el-table>
-            <div style="margin: 10px 0">
+            <!-- <div style="margin: 10px 0">
+                分页
               <el-pagination
                 @size-change="
                   popfun['handleSizeChange' + (index + 1)]($event, index + 1)
@@ -564,7 +585,7 @@
                 :total="poptotal['total' + (index + 1)]"
               >
               </el-pagination>
-            </div>
+            </div> -->
           </div>
           <div v-if="factor.length">
             引用销售政策说明:{{ factor.length ? factor[0].name : "" }}
@@ -575,18 +596,18 @@
         </template>
         <template v-else>
           <el-table
+           class="table"
             ref="singleTable"
-            v-loading="listLoading"
+            v-loading="listLoading2"
             :data="dataList"
             element-loading-text="Loading"
             border
             fit
+            max-height="500"
             highlight-current-row
             @select-all="handleSelectionChange"
             @selection-change="handleSelectionChange"
             stripe
-                show-summary
-              :summary-method="$getSummaries"
           >
             <el-table-column
               align="center"
@@ -605,7 +626,13 @@
                 show-overflow-tooltip
               >
                 <template slot-scope="scope">
-                  <el-input v-model="scope.row.qty" size="small"></el-input>
+                  <el-input
+                      type="number"
+                      v-model.lazy="scope.row.qty"
+                      @blur="blurQty(scope.row.qty, scope.row)"
+                      @input="funQty(scope.row.qty, scope.row)"
+                      size="small"
+                    ></el-input>
                 </template>
               </el-table-column>
               <el-table-column
@@ -630,8 +657,21 @@
               >
               </el-table-column>
             </template>
+            <template #append>
+                <div class="mybox">
+                    <el-row  class="mybox-row" type="flex" >
+                    <el-col style="width: 55px;" >合计</el-col>
+                    <el-col ></el-col>
+                    <el-col ></el-col>
+                    <el-col ></el-col>
+                    <el-col >{{totalQty}}</el-col>
+                    <el-col >{{totalPrice}}</el-col>
+                    <el-col >{{totalAmount}}</el-col>
+                  </el-row>
+                </div>
+            </template>
           </el-table>
-          <div style="margin: 10px 0">
+          <!-- <div style="margin: 10px 0">
             <el-pagination
               @size-change="handleSizeChange"
               @current-change="handleCurrentChange"
@@ -642,7 +682,7 @@
               :total="total"
             >
             </el-pagination>
-          </div>
+          </div> -->
           <span slot="footer" class="dialog-footer">
             <el-button type="primary" @click="hanlePopData">完成</el-button>
           </span>
@@ -673,8 +713,6 @@ import {
   getPolicyConditionList,
 } from "@/api/supply/policy";
 import { getDictList } from "@/api/common";
-import { findElem } from "@/utils/util";
-import { async } from "q";
 
 export default {
   name: "RetailForm",
@@ -769,11 +807,13 @@ export default {
         },
         {
           prop: "zong",
+          widht: 160,
           lable: "金额",
           jie: true,
         },
       ],
       listLoading: false,
+      listLoading2: false,
       popDataArr: [],
       radioObj: {},
       step: 0,
@@ -790,6 +830,11 @@ export default {
       popfun: {},
       poptotal: {},
       popcun: {},
+      totalQty: 0,
+      totalPrice: 0,
+      totalAmount: 0,
+      totalArr: [],
+      type:1
     };
   },
 
@@ -835,6 +880,7 @@ export default {
         }
       };
     },
+
     // pickerOptions({ $props }) {
     //   return {
     //     disabledDate: (time) => {
@@ -842,11 +888,6 @@ export default {
     //     },
     //   };
     // },
-      wZong(){
-        return (val,oval)=>{
-            console.log(744);
-        }
-      }
   },
 
   created() {
@@ -859,8 +900,41 @@ export default {
       this.getDetail();
     }
   },
-  beforeUpdate() {},
+
   methods: {
+    blurQty(e, row) {
+      if (!e) {
+        this.$set(row, "qty", 1);
+      }
+    },
+    funQty(qty, row, index) {
+      if (row.fang) {
+        if (this.type==1) {
+          this.$set(this.totalArr, index, {
+            totalQty: 0,
+            totalPrice: 0,
+            totalAmount: 0,
+          });
+          for (let j = 0; j < this.multipleSelections[index].length; j++) {
+            this.multipleSelections[index][j].fang = true;
+            this.totalArr[index].totalQty += +qty || 1;
+            this.totalArr[index].totalPrice +=
+              +this.multipleSelections[index][j].price;
+            this.totalArr[index].totalAmount +=
+              +this.multipleSelections[index][j].price * (+qty || 1);
+          }
+        } else {
+
+          this.totalQty = this.totalPrice = this.totalAmount = 0;
+          for (let i = 0; i < this.multipleSelection.length; i++) {
+            this.totalQty += +qty || 1;
+            this.totalPrice += +this.multipleSelection[i].price;
+            this.totalAmount +=
+              +this.multipleSelection[i].price * (+qty || 1);
+          }
+        }
+      }
+    },
     getUserList() {
       getUserList({
         pageNum: 1,
@@ -875,6 +949,21 @@ export default {
         // // consloe(this.userList,'122');
       });
     },
+    handleUser(e){
+      const user=  this.userList.filter(k=>{
+        return k.adminUserId == e
+       })[0]
+       this.mainForm.k3ServiceId = user.adminUserId
+       this.mainForm.k3ServiceName = user.nickName
+    },
+    handleUser2(e,row){
+        const user=  this.userList.filter(k=>{
+        return k.adminUserId == e
+       })[0]
+       this.$set(row,'serviceId',user.adminUserId)
+      this.$set(row,'serviceName', user.nickName)
+
+    },
     // 返回列表
     goBack() {
       this.$emit("backListFormDetail");
@@ -891,9 +980,7 @@ export default {
     },
     // 选择销售政策获取政策条件列表
     async handlePolicy(e) {
-
-
-
+      this.totalArr = [];
       this.multipleSelections = [];
       this.dataList = [];
       this.popDataArr = [];
@@ -925,7 +1012,6 @@ export default {
         }
       } else {
         // LIMIT 限量
-
         this.getMaterialTypeList("sProvision");
       }
     },
@@ -974,14 +1060,14 @@ export default {
     },
     // 获取某一个比例下的数据 ,查询popType 当前 this.cusIndex+1
     async getConditionList(policyConditionId, popType, fang) {
+      this.listLoading = true;
       const { data } = await getConditionList({
         pageNum: this.currentPage,
-        pageSize: 10,
+        pageSize: -1,
         policyConditionId,
         popType,
       });
 
-
       if (!fang) {
         this.poptotal["total" + popType] = data.total;
         this.popcun["cun" + popType] = 1;
@@ -1002,14 +1088,14 @@ export default {
         for (let p = 0; p < this.goodsList.length; p++) {
           for (let q = 0; q < datas.length; q++) {
             if (this.goodsList[p].id == datas[q].id) {
-              this.$set(datas[q],'disabled',true)
+              this.$set(datas[q], "disabled", true);
             }
           }
         }
       }
       for (let i = 0; i < data.records.length; i++) {
         data.records[i].qty = 1;
-
+        data.records[i].policyMaterialId = data.records[i].id
         this.$set(
           data.records[i],
           "zong",
@@ -1023,51 +1109,60 @@ export default {
       } else {
         this.popDataArr.push(datas);
       }
+      this.totalArr.push({
+        totalQty: 0,
+        totalPrice: 0,
+        totalAmount: 0,
+      });
+      // this.$set(this.totalArr,[...this.totalArr])
+      this.listLoading = false;
       // consloe(this.popDataArr);
     },
-     // 获取政策列表
+    // 获取政策列表
     getMaterialTypeList(val) {
+      this.listLoading2 = true;
       getMaterialTypeList({
         pageNum: 1,
-        pageSize: 10,
+        pageSize: -1,
         policyId: this.screenForm.policyId,
         saleTypeCode: this.screenForm.saleTypeCode,
         [val]: true,
       }).then((res) => {
+        this.dataList = res.data.records;
 
-           this.dataList = res.data.records;
-            if (this.listItem) {
-
-          for (let i = 0; i < this.dataList.length; i++) {
-           for (let j = 0; j < this.goodsList.length; j++) {
-              console.log(8888);
-              if (this.dataList[i].id==this.goodsList[j].id) {
-                    this.$set(this.dataList[i],'disabled',true)
-                }
+        if (this.listItem) {
 
-           }
+          for (let i = 0; i < this.goodsList .length; i++) {
+            for (let j = 0; j <this.dataList.length; j++) {
 
+              if (this.dataList[j].id == this.goodsList[i].policyMaterialId) {
+                     console.log(8888);
+                this.$set(this.dataList[i], "disabled", true);
+              }
+            }
           }
         }
 
         for (let i = 0; i < res.data.records.length; i++) {
-          res.data.records[i].qty = 1;
-           this.$set(
-          res.data.records[i],
-          "zong",
-          res.data.records[i].qty * res.data.records[i].price
+          this.$set(
+            res.data.records[i],
+            "qty",
+            1
           );
           res.data.records[i].sums1 = ["price", "qty", "zong"];
           res.data.records[i].userList = this.userList;
+           res.data.records[i].policyMaterialId = res.data.records[i].id
           for (let j = 0; j < this.newDataList.length; j++) {
+
             if (this.newDataList[j].id == res.data.records[i].id) {
-              res.data.records[i].disabled = false;
 
+               res.data.records[i].disabled = false;
             }
           }
         }
-       this.dataList = res.data.records;
+        this.dataList = res.data.records;
         this.total = res.data.total;
+        this.listLoading2 = false;
         this.popDataArr = [];
         this.popArr = [];
         // // consloe(this.dataList, "kkkk");
@@ -1125,14 +1220,42 @@ export default {
       // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
       // 如果没有返回值则默认返回false(全部无法选中)
     },
-
     // 条件数据多选
     handleSelectionChange(val, type, index) {
+
       if (type == 1) {
+        this.type=1
         this.$set(this.multipleSelections, index, val);
+        this.$set(this.totalArr, index, {
+          totalQty: 0,
+          totalPrice: 0,
+          totalAmount: 0,
+        });
+
+        for (let j = 0; j < this.multipleSelections[index].length; j++) {
+          this.multipleSelections[index][j].fang = true;
+          this.totalArr[index].totalQty +=
+            +this.multipleSelections[index][j].qty;
+          this.totalArr[index].totalPrice +=
+            +this.multipleSelections[index][j].price;
+          this.totalArr[index].totalAmount +=
+            +this.multipleSelections[index][j].price *
+            +this.multipleSelections[index][j].qty;
+        }
+
         // consloe(this.multipleSelections);
       } else {
+        this.type=2
         this.multipleSelection = val;
+        this.totalQty = this.totalPrice = this.totalAmount = 0;
+        for (let i = 0; i < this.multipleSelection.length; i++) {
+           this.multipleSelection[i].fang = true;
+          this.totalQty += +this.multipleSelection[i].qty;
+          this.totalPrice += +this.multipleSelection[i].price;
+          this.totalAmount +=
+            +this.multipleSelection[i].price *
+            +this.multipleSelection[i].qty;
+        }
       }
     },
     hanlePopData() {
@@ -1164,17 +1287,21 @@ export default {
 
         if (this.goodsList.length && this.goodsList[0].wallets.length) {
           this.mainForm.k3ServiceName =
-            this.goodsList[0].wallets[0].serviceId || "";
+            this.goodsList[0].wallets[0].k3ServiceName || "";
           this.mainForm.k3ServiceId =
             this.goodsList[0].wallets[0].serviceId || "";
         }
-
+        // if (this.goodsList.length>4) {
+        //     this.newGoodsList = this.goodsList
+        //     this.newGoodsList.length = 4
+        // }
         this.cusIndex = 0;
         this.total = 0;
         this.popDataArr = [];
         this.multipleData = [];
         this.multipleSelection = [];
         this.policyId = this.screenForm.policyId;
+        this.totalQty = this.totalPrice = this.totalAmount = 0;
         this.isShowDialog = false;
         this.$refs.singleTable.clearSelection();
         // consloe(this.goodsList, "kkkk");
@@ -1195,7 +1322,7 @@ export default {
 
         if (this.goodsList.length && this.goodsList[0].wallets.length) {
           this.mainForm.k3ServiceName =
-            this.goodsList[0].wallets[0].serviceId || "";
+            this.goodsList[0].wallets[0].k3ServiceName || "";
           this.mainForm.k3ServiceId =
             this.goodsList[0].wallets[0].serviceId || "";
         }
@@ -1210,6 +1337,7 @@ export default {
         this.multipleData = [];
         this.multipleSelection = [];
         this.policyId = this.screenForm.policyId;
+        this.totalQty = this.totalPrice = this.totalAmount = 0;
         this.isShowDialog = false;
         this.$refs.singleTable.forEach((k) => {
           k.clearSelection();
@@ -1222,29 +1350,47 @@ export default {
     },
     // 获取详情
     getDetail() {
-      getDetail({ id: this.listItem.id }).then((res) => {
+
+       getUserList({
+        pageNum: 1,
+        pageSize: -1,
+        adminWebsitId: "",
+        isCustomer: 0,
+        roleId: "",
+        status: true,
+        userName: "",
+          }).then((res) => {
+        this.userList = res.data.records;
+
+      getDetail({ id: this.listItem.id }).then(res=>{
         let data = res.data;
         this.mainForm.date = data.theTime;
         this.mainForm.type = data.mainId;
         this.mainForm.remark = data.remark;
         this.mainForm.policyId = data.policyId;
         this.policyId = data.policyId;
-        this.mainForm.k3ServiceName = data.k3ServiceId;
-        this.mainForm.k3ServiceId = data.k3ServiceId;
+        this.mainForm.k3ServiceName =data.k3ServiceName;
+        this.mainForm.k3ServiceId = data.k3ServiceId ;
+
         data.retailOrderItemList.forEach((item) => {
           item.status1 = "";
           item.status2 = "";
+
+         this.$set(item, "userList", this.userList);
           item.wallets.forEach((k) => {
             if (k.customerWalletId === data.customerWalletId) {
               this.$set(item, "serviceId", k.serviceId);
-              this.$set(item, "serviceName", k.serviceId);
+              this.$set(item, "serviceName", k.serviceName);
             }
           });
 
-          this.$set(item, "userList", this.userList);
+
         });
+        console.log(data.retailOrderItemList);
         this.goodsList = data.retailOrderItemList;
-      });
+     })
+
+         });
     },
     // 获取销售政策
     getPolicyList() {
@@ -1254,11 +1400,10 @@ export default {
         status: true,
       }).then((res) => {
         if (this.policyId) {
-          this.screenForm.policyId = this.policyId
-          this.disabled = true
-
-        }else{
-           this.screenForm.policyId = res.data.records[0].code;
+          this.screenForm.policyId = this.policyId;
+          this.disabled = true;
+        } else {
+          this.screenForm.policyId = res.data.records[0].code;
         }
 
         this.policyList = res.data.records;
@@ -1298,20 +1443,20 @@ export default {
         policyId: this.screenForm.policyId,
         saleTypeCode: this.screenForm.saleTypeCode,
       }).then((res) => {
-        console.log(res.data.records,'7777');
+
         for (let i = 0; i < res.data.records.length; i++) {
-          res.data.records[i].qty = 1;
+
           this.$set(
-          res.data.records[i],
-          "zong",
-          res.data.records[i].qty * res.data.records[i].price
+            res.data.records[i],
+            "qty",
+            1
           );
           res.data.records[i].sums2 = ["price", "qty", "zong"];
           res.data.records[i].userList = this.userList;
-
         }
 
         this.dataList = res.data.records;
+
         this.total = res.data.total;
       });
     },
@@ -1319,9 +1464,9 @@ export default {
     // 打开引用
     handleShow() {
       this.isShowDialog = true;
-      if (!this.dataList.length) {
+
         this.getPolicyList();
-      }
+
     },
     // 获取钱包列表
     getWalletList() {
@@ -1492,6 +1637,7 @@ export default {
       this.getConditionList(this.policyConditionId, this.cusIndex + 1);
     },
     handleClose() {
+      this.totalQty = this.totalPrice = this.totalAmount = 0;
       // this.dataList = [];
       // this.popDataArr = [];
       // this.screenForm.policyId = "";
@@ -1501,12 +1647,12 @@ export default {
     deleteItem(index, id) {
       this.goodsList.splice(index, 1);
       // this.dataList
-      if (this.newDataList.length) {
         this.newDataList.splice(index, 1);
-      }
-      if (!this.goodsList.length) {
+       if (!this.goodsList.length) {
         this.disabled = false;
-      }
+        this.policyId = ''
+        this.mainForm.policyId = ''
+       }
 
       // this.popDataArr.splice(index,1)
     },
@@ -1573,7 +1719,9 @@ export default {
             type: 2, // 1:普通零售单,2:政策零售单
             retailOrderItemList: this.goodsList,
             policyId: this.policyId,
+
           };
+        console.log(params);
           if (this.listItem) {
             params.id = this.listItem.id;
             editData(params).then((res) => {
@@ -1603,7 +1751,26 @@ export default {
 .detail-container {
   width: 100%;
   height: 100%;
+  ::v-deep .el-table__append-wrapper{
+    overflow: initial;
+  }
 }
+.table{
+  background-color: rgb(237 237 237);
+}
+.mybox {
+  padding: 20px 0;
+
+  div:first-child {
+    flex: 0 0 55px;
+  }
+  div {
+    flex: 1 0 160px;
+    text-align: center;
+  }
+}
+
+
 .main-title {
   display: flex;
   justify-content: space-between;
@@ -1641,4 +1808,5 @@ export default {
   text-overflow: ellipsis;
   white-space: nowrap;
 }
+
 </style>

+ 1 - 1
src/views/supply/policy/policy_list.vue

@@ -326,7 +326,7 @@
             <el-table-column
               align="center"
               label="业务员"
-              prop="serviceName"
+              prop="k3ServiceName"
               min-width="100"
               show-overflow-tooltip
             ></el-table-column>