Browse Source

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

FengChaoYu 3 năm trước cách đây
mục cha
commit
fc59705f2f

+ 8 - 0
src/api/engin_deposit/refund_list.js

@@ -32,3 +32,11 @@ export function getDepositManagExport(params) {
     params,
   });
 }
+// 下载押金管理附件
+export function getDepositManageDownZip(params) {
+  return request({
+    url: "/deposit-manage/downZip",
+    method: "get",
+    params,
+  });
+}

+ 9 - 0
src/api/setting.js

@@ -449,3 +449,12 @@ export function getApiList(params) {
     params
   })
 }
+
+// 仓库仓位对应关系列表
+export function getStockListStock(params) {
+  return request({
+    url: '/stock/listStock',
+    method: 'get',
+    params
+  })
+}

+ 7 - 6
src/utils/common.js

@@ -30,7 +30,7 @@ export const warningNotify = msg => {
  * 查询按钮权限
  * @param {*} value 当前按钮对应code
  * @param {*} btnRole 当前路由所有按钮权限
- * @returns 
+ * @returns
  */
 export const checkBtnRole = (value, btnRole) => {
   if(!btnRole) {return true}
@@ -47,8 +47,8 @@ export const checkBtnRole = (value, btnRole) => {
           item.sums1 = ['number'];
           item.sums2 = ['totalAmount', 'payAmount'];
         })
- * @param {*} param 
- * @returns 
+ * @param {*} param
+ * @returns
  */
 export const getSummaries = (param) => {
   const { columns, data } = param;
@@ -58,6 +58,7 @@ export const getSummaries = (param) => {
       sums[index] = '合计';
       return;
     }
+    // console.log(columns);
     try {
       const values = data.map(item => Number(item[column.property]));
       if (data[0] && data[0].sums1.includes(column.property)) {
@@ -92,8 +93,8 @@ export const getSummaries = (param) => {
 
 /**
  * 保留2位小数点
- * @param {number} num 
- * @returns 
+ * @param {number} num
+ * @returns
  */
  export const numToFixed = (num) => {
 	if(!num) return '0.00';
@@ -109,4 +110,4 @@ export default {
   checkBtnRole,
   getSummaries,
   numToFixed
-}
+}

+ 33 - 2
src/views/engin_deposit/components/refund_list-detail.vue

@@ -238,8 +238,18 @@
         </el-table>
       </div>
     </div>
-    <h3>工程资料</h3>
+
+    <h3 class="gdzl">工程资料</h3>
+    <el-button
+      class="batchDownload"
+      type="primary"
+      size="small"
+      @click="batchDownloadFn"
+      >批量下载</el-button
+    >
+
     <el-divider></el-divider>
+
     <!-- 列表 -->
     <div class="mymain-container">
       <div class="table">
@@ -465,11 +475,13 @@
 </template>
 
 <script>
+import { downloadFiles } from "@/utils/util";
 import IMAGEUPLOAD from "@/components/Common/image-upload.vue";
 import { mapGetters } from "vuex";
 import {
   getDepositManageDetail,
   getDepositManageExamine,
+  getDepositManageDownZip,
 } from "@/api/engin_deposit/refund_list";
 export default {
   props: {
@@ -484,6 +496,7 @@ export default {
   },
   data() {
     return {
+      imageURL: this.$imageUrl,
       title: "审批",
       imageURL: this.$imageUrl,
       listLoading: false, // 列表加载loading
@@ -501,9 +514,20 @@ export default {
     this.getData({ id: this.detailId });
   },
   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 + "?attname=新文件名.xlsx");
+      window.open(this.imageURL + v);
       // const url = this.imageURL + v;
       // const link = document.createElement("a");
       // link.style.display = "none";
@@ -588,6 +612,13 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.batchDownload {
+  float: right;
+  margin-top: 9px;
+}
+.gdzl {
+  display: inline-block;
+}
 .dateStyle {
   width: 100%;
 }

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

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

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

@@ -172,7 +172,7 @@
             <el-table-column
               align="center"
               label="往来单位"
-              prop="wlCompanyType"
+              prop="wlCompanyName"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>

+ 32 - 6
src/views/sales_policy/components/AddPolicy.vue

@@ -328,9 +328,9 @@
               >
             </div>
             <el-pagination
-              @size-change="handleSizeChange"
-              @current-change="handleCurrentChange"
-              :current-page="currentPage"
+              @size-change="handleSizeChange2"
+              @current-change="handleCurrentChange2"
+              :current-page="dcurrentPage"
               :page-sizes="[10, 20, 30, 50]"
               :page-size="10"
               layout="total, sizes, prev, pager, next, jumper"
@@ -515,7 +515,9 @@ export default {
       dictList: [],
       k3List: [],
       NoRebateWalletList: [],
-      sleectBox:{currentPage:1}
+      sleectBox:{currentPage:1},
+      dpageSize:10,
+      dcurrentPage:1
     };
   },
   computed: {
@@ -680,12 +682,36 @@ export default {
         this.handletwoList();
       }
     },
+      // 更改每页数量
+    handleSizeChange1(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.handletwoList();
+    },
+    // 更改当前页
+    handleCurrentChange1(val) {
+      this.currentPage = val;
+      this.handletwoList();
+    },
+
+   // 更改每页数量
+    handleSizeChange2(val) {
+      this.dpageSize = val;
+      this.dcurrentPage = 1;
+     this.handletwoList()
+    },
+    // 更改当前页
+    handleCurrentChange2(val) {
+
+      this.dcurrentPage = val;
+      this.handletwoList()
+    },
     // 获取货品信息
     handletwoList() {
       // this.searchForm.type
       const paramss = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
+        pageNum: this.dcurrentPage,
+        pageSize: this.dpageSize,
         policyId: this.comCode,
         saleTypeCode: "",
       };

+ 14 - 12
src/views/sales_policy/components/Examine.vue

@@ -183,7 +183,6 @@
             <el-table-column
               prop="saleTypeCode"
               label="销售类型编码"
-
               align="center"
             >
             </el-table-column>
@@ -587,9 +586,9 @@ export default {
   data() {
     return {
       baseURL: "",
-      dcurrentPage:1,
-      dpageSize:10,
-      dlistTotal:0,
+      dcurrentPage: 1,
+      dpageSize: 10,
+      dlistTotal: 0,
       currentPages: 1, // 当前页码
       pageSizes: 10, // 每页数量
       clistTotal: 0,
@@ -660,7 +659,7 @@ export default {
               hover: "",
               url: this.detail.imgSrc,
             },
-           ]
+          ];
         }
         this.handletwoList();
         // 获取条件政策
@@ -707,16 +706,19 @@ export default {
       this.currentPages = val;
       this.getCond();
     },
-      // 更改每页数量
+    // 更改每页数量
     handleSizeChange2(val) {
-      this.dpageSize = val;
+
+    this.dpageSize = val;
       this.dcurrentPage = 1;
-     this.handletwoList()
+      this.handletwoList();
     },
     // 更改当前页
     handleCurrentChange2(val) {
+
+
       this.dcurrentPage = val;
-      this.handletwoList()
+      this.handletwoList();
     },
     getCommonApi(row) {
       (this.isEdit = 2), (this.cid = row.id), (this.cpolicyId = row.policyId);
@@ -755,15 +757,15 @@ export default {
     handletwoList() {
       // this.searchForm.type
       const paramss = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
+        pageNum: this.dcurrentPage,
+        pageSize: this.dpageSize,
         policyId: this.detail.code,
         saleTypeCode: "",
       };
       getMaterialList(paramss)
         .then((result) => {
           this.dataList = result.data.records;
-          this.listTotal = result.data.total;
+          this.dlistTotal = result.data.total;
           this.listLoading = false;
         })
         .catch((err) => {

+ 25 - 1
src/views/setting/account.vue

@@ -131,6 +131,7 @@
         <el-form-item label="用户名" prop="nickName">
           <el-input v-model="AccountForm.nickName" autocomplete="off" placeholder="请输入用户名"></el-input>
         </el-form-item>
+      
         <el-form-item label="角色组" prop="role">
           <el-select v-model="AccountForm.role" placeholder="请选择角色组" style="width: 100%;" filterable>
             <el-option :label="item.name" :value="item.adminRoleId" v-for="(item, index) in roleList" :key="index"></el-option>
@@ -174,6 +175,7 @@
             <el-radio :label="false">否</el-radio>
           </el-radio-group>
         </el-form-item>
+       
         <el-form-item label="密码" prop="newPassword">
           <el-input v-model="AccountForm.newPassword" ref="password1" autocomplete="off" placeholder="请输入密码" :type="passwordType1"></el-input>
           <span class="show-pwd" @click="showPwd(1)">
@@ -186,6 +188,12 @@
             <svg-icon :icon-class="passwordType2 === 'password' ? 'eye' : 'eye-open'" />
           </span>
         </el-form-item>
+         <el-form-item  label="可用仓库" prop="correspondIds">
+          <el-select  multiple  v-model="AccountForm.correspondIds" placeholder="请选择可用仓库" style="width: 100%;" filterable>
+            <el-option :label="item.name" :value="item.id" v-for="(item, index) in stockList" :key="index"></el-option>
+          </el-select>
+        
+        </el-form-item>
 
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -220,7 +228,7 @@
 </template>
 
 <script>
-import { getDepartmentList, getAccountList, addAccount, editAccount, deleteAccount, getAccountDetail, getRoleList, getMerchantList, changeAccountStatus, resetPassword } from '@/api/setting'
+import {getStockListStock, getDepartmentList, getAccountList, addAccount, editAccount, deleteAccount, getAccountDetail, getRoleList, getMerchantList, changeAccountStatus, resetPassword } from '@/api/setting'
 import { getDealerList } from '@/api/common'
 import { findElem, downloadFiles, handleImport } from '@/utils/util'
 
@@ -269,6 +277,7 @@ export default {
       }
     };
     return {
+      stockList:[],//仓库列表
       baseURL: process.env.VUE_APP_BASE_API,
       dataList: null, // 列表数据
       moduleList: null, // 模块列表
@@ -290,6 +299,7 @@ export default {
         merchant: '', // 商户
         dealer: '', //经销商
         role: '', // 角色组
+        correspondIds:[],//仓库
         isGroup: false,
         company: '',
         isDiscount: true,
@@ -306,6 +316,9 @@ export default {
         role: [
           { required: true, message: '请选择角色组', trigger: 'change' }
         ],
+        correspondIds: [
+          { required: true, message: '请选择可用仓库', trigger: 'change' }
+        ],
         newPassword: [
           { required: true, validator: validatePass3, trigger: 'blur' }
         ],
@@ -371,8 +384,15 @@ export default {
   async created() {
     this.getTree();
     this.getList();
+    this.getStockList()
   },
   methods: {
+    //获取仓库仓位对应关系列表
+    async getStockList(){
+      let res = await getStockListStock({pageSize:-1,pageNum:1})
+      this.stockList = res.data.records
+
+    },
     // 查询按钮权限
     checkBtnRole(value) {
       // let btnRole = this.$route.meta.roles;
@@ -522,6 +542,7 @@ export default {
       if(type == 'edit') {
         this.editAccountId = id;
         getAccountDetail({adminUserId: id}).then(res => {
+          console.log(res,78787);
           this.AccountForm.account = res.data.userName;
           this.AccountForm.role = res.data.roleId;
           this.AccountForm.nickName = res.data.nickName;
@@ -530,6 +551,7 @@ export default {
           this.AccountForm.isGroup = res.data.isGroupCompany;
           this.AccountForm.company = res.data.parentCustomerId;
           this.AccountForm.isDiscount = res.data.isZr;
+          this.AccountForm.correspondIds = res.data.stockCorrespondList;
           this.$refs.tree.setCheckedKeys(res.data.adminWebsitIds || []);
         })
       }
@@ -545,6 +567,7 @@ export default {
 
     // 提交 账号表单
     submitAccountForm() {
+      console.log(this.AccountForm.correspondIds);
       this.$refs.AccountForm.validate((valid) => {
         if (valid) {
           let params = {
@@ -552,6 +575,7 @@ export default {
             nickName: this.AccountForm.nickName,
             roleId: this.AccountForm.role,
             password: this.AccountForm.newPassword,
+            correspondIds: this.AccountForm.correspondIds,
           }
           if(this.roleObj.type === 0) {
             params.adminWebsitIds = this.$refs.tree.getCheckedKeys();

+ 98 - 33
src/views/supply/policy/components/retail_detail.vue

@@ -5,8 +5,13 @@
       <div class="title">提货进度</div>
     </div>
     <div class="progress-container">
-          <el-progress :text-inside="true" :stroke-width="26" :percentage="detailData.thjd ? (detailData.thjd * 1000 / 10).toFixed(2) : 0"></el-progress>
-
+      <el-progress
+        :text-inside="true"
+        :stroke-width="26"
+        :percentage="
+          detailData.thjd ? ((detailData.thjd * 1000) / 10).toFixed(2) : 0
+        "
+      ></el-progress>
     </div>
 
     <div class="main-title">
@@ -75,6 +80,8 @@
         highlight-current-row
         stripe
         max-height="400"
+        show-summary
+        :summary-method="$getSummaries"
       >
         <el-table-column
           align="center"
@@ -116,18 +123,23 @@
           prop="unit"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+        </el-table-column>
         <el-table-column
           align="center"
           label="单价"
           prop="price"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            {{ scope.row.price | numToFixed }}
+          </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="数量"
-          prop="refundableQty"
+          prop="qty"
           min-width="100"
           show-overflow-tooltip
         ></el-table-column>
@@ -137,7 +149,11 @@
           prop="totalAmount"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            {{ scope.row.totalAmount | numToFixed }}
+          </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="返利类型"
@@ -146,14 +162,13 @@
           show-overflow-tooltip
         >
           <template slot-scope="scope">
-              <!-- v-for="item in scope.row.rebateWallets" -->
+            <!-- v-for="item in scope.row.rebateWallets" -->
             <el-tag
-            v-if="scope.row.customerWalletName2"
+              v-if="scope.row.customerWalletName2"
               type="success"
               size="small"
-
             >
-                {{ scope.row.customerWalletName2 }}
+              {{ scope.row.customerWalletName2 }}
             </el-tag>
           </template>
         </el-table-column>
@@ -163,14 +178,22 @@
           prop="payRebateAmount"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            {{ scope.row.payRebateAmount | numToFixed }}
+          </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="格力折扣"
           prop="totalDiscAmount"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            {{ scope.row.totalDiscAmount | numToFixed }}
+          </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="现金钱包"
@@ -179,12 +202,8 @@
           show-overflow-tooltip
         >
           <template slot-scope="scope">
-              <!-- v-for="item in scope.row.wallets" -->
-            <el-tag
-              type="success"
-              size="small"
-
-            >
+            <!-- v-for="item in scope.row.wallets" -->
+            <el-tag type="success" size="small">
               {{ scope.row.customerWalletName }}
             </el-tag>
           </template>
@@ -195,7 +214,11 @@
           prop="payAmount"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            {{ scope.row.payAmount | numToFixed }}
+          </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="是否直调"
@@ -215,7 +238,7 @@
           show-overflow-tooltip
         ></el-table-column>
 
-          <!-- <el-table-column
+        <!-- <el-table-column
           align="center"
           label="已退数量"
           prop="retiredQty"
@@ -247,8 +270,18 @@
     </div>
     <div class="page-footer">
       <div class="footer" :class="classObj">
-       <el-button :type="status?'info':'primary'" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK' || status">直调发货</el-button>
-        <el-button :type="status?'info':'primary'" @click="handleFinish" :disabled="detailData.examineStatus !== 'OK' || status">直调完成</el-button>
+        <el-button
+          :type="status ? 'info' : 'primary'"
+          @click="openDeliverDialog"
+          :disabled="detailData.examineStatus !== 'OK' || status"
+          >直调发货</el-button
+        >
+        <el-button
+          :type="status ? 'info' : 'primary'"
+          @click="handleFinish"
+          :disabled="detailData.examineStatus !== 'OK' || status"
+          >直调完成</el-button
+        >
         <!-- <el-button @click="goBack">关 闭</el-button> -->
       </div>
     </div>
@@ -352,6 +385,8 @@
           highlight-current-row
           stripe
           max-height="400"
+          show-summary
+          :summary-method="$getSummaries"
         >
           <el-table-column
             align="center"
@@ -430,21 +465,33 @@
             prop="price"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              {{ scope.row.price | numToFixed }}
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="金额"
             prop="totalAmount"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              {{ scope.row.totalAmount | numToFixed }}
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="返利"
             prop="payRebateAmount"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              {{ scope.row.payRebateAmount | numToFixed }}
+            </template>
+          </el-table-column>
 
           <el-table-column
             align="center"
@@ -511,7 +558,7 @@ export default {
       positionList: [],
 
       goodsList: [],
-        status:false
+      status: false,
     };
   },
 
@@ -546,18 +593,36 @@ export default {
     goBack() {
       this.$emit("backListFormDetail");
     },
-// 是否直调完成
-    directTransferStatus(val){
-      this.status =  val.retailOrderItemList.some(k=>{
-          return k.directTransferStatus == true
-        })
-        console.log(this.status,'4554545');
+    // 是否直调完成
+    directTransferStatus(val) {
+      this.status = val.retailOrderItemList.some((k) => {
+        return k.directTransferStatus == true;
+      });
+      console.log(this.status, "4554545");
     },
     // 获取详情
     getDetail() {
       getDetail({ id: this.listItem.id }).then((res) => {
+        if (res.data.retailOrderItemList) {
+          res.data.retailOrderItemList.forEach((item) => {
+            item.sums1 = [
+              "directTransferQty",
+              "qty",
+              "refundableQty",
+              "oldQty",
+            ];
+            item.sums2 = [
+              "totalAmount",
+              "payAmount",
+              "price",
+              "payRebateAmount",
+              "discAmount",
+              "totalDiscAmount",
+            ];
+          });
+        }
         this.detailData = res.data;
-           this.directTransferStatus(res.data)
+        this.directTransferStatus(res.data);
       });
     },
     // 直调完成

+ 1 - 1
src/views/supply/policy/components/retail_examine.vue

@@ -117,7 +117,7 @@
         <el-table-column
           align="center"
           label="数量"
-          prop="refundableQty"
+          prop="qty"
           min-width="100"
           show-overflow-tooltip
         ></el-table-column>

+ 130 - 67
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" v-if="!listItem">
+        <el-col :xs="24" :sm="12" :lg="8" >
           <el-form-item label="销售政策编号" prop="policyCode">
             <div style="display: flex">
               <el-input
@@ -34,7 +34,7 @@
             </div>
           </el-form-item>
         </el-col>
-        <el-col :xs="24" :sm="12" :lg="8" v-else>
+        <!-- <el-col :xs="24" :sm="12" :lg="8" v-else>
           <el-form-item label="销售政策编号" prop="policyCode">
             <el-input
               disabled
@@ -42,7 +42,8 @@
               placeholder="销售政策编号"
             ></el-input>
           </el-form-item>
-        </el-col>
+
+        </el-col> -->
         <el-col :xs="24" :sm="12" :lg="8" style="height: 51px">
           <el-form-item label="单据日期" prop="date">
             <el-date-picker
@@ -85,7 +86,7 @@
 
     <div class="main-title">
       <div class="title">货品信息</div>
-      <div v-if="!listItem">
+      <div >
         <el-select
           v-model="warehouseValue"
           placeholder="请选择发货仓库"
@@ -222,7 +223,7 @@
           <template slot-scope="scope">
             {{
               (scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) /
-              100
+                100 || 0
             }}
           </template>
         </el-table-column>
@@ -385,28 +386,11 @@
         </el-table-column>
       </el-table>
     </div>
-    <el-dialog :visible.sync="dialogVisible" width="50%">
-      <el-form label-width="80px" :inline="false" size="small">
-        <el-form-item label="单据日期" prop="date">
-          <el-date-picker
-            v-model="mainForm.date"
-            type="datetime"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            style="width: 100%"
-            placeholder="选择日期"
-          >
-          </el-date-picker>
-        </el-form-item>
-      </el-form>
-
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" size="small" @click="hendleEdit"
-          >确 定</el-button
-        >
-      </span>
-    </el-dialog>
-    <div class="page-footer">
+
+    <div class="page-footer" style="
+    position: fixed;
+    bottom: 0;
+  ">
       <div class="footer" :class="classObj">
         <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
         <el-popconfirm
@@ -433,6 +417,9 @@
           label-width="120px"
           size="small"
         >
+          <el-row v-if="factor.length" style="margin: 0 0 20px 0">
+            引用销售政策说明:{{ factor.length ? factor[0].name : "" }}
+          </el-row>
           <el-row :gutter="20">
             <el-col :xs="24" :sm="6" :lg="6">
               <el-form-item label="销售政策">
@@ -444,6 +431,8 @@
                   :disabled="disabled"
                   style="width: 100%"
                 >
+                  <el-option label="默认" :value="''"></el-option>
+
                   <el-option
                     v-for="(item, index) in policyList"
                     :key="index"
@@ -478,7 +467,7 @@
                   placeholder="选择销售类型"
                   style="width: 100%"
                 >
-                <el-option  label="默认" :value="''"></el-option>
+                  <el-option label="默认" :value="''"></el-option>
 
                   <el-option
                     v-for="item in ztypeList"
@@ -513,6 +502,9 @@
               @select-all="handleSelectionChange($event, 1, index)"
               @selection-change="handleSelectionChange($event, 1, index)"
               stripe
+              show-summary
+              :summary-method="$getSummaries"
+
             >
               <el-table-column
                 align="center"
@@ -593,6 +585,8 @@
             @select-all="handleSelectionChange"
             @selection-change="handleSelectionChange"
             stripe
+                show-summary
+              :summary-method="$getSummaries"
           >
             <el-table-column
               align="center"
@@ -801,7 +795,7 @@ export default {
 
   computed: {
     sidebar() {
-      console.log(11145454);
+      // console.log(11145454);
       return this.$store.state.app.sidebar;
     },
     classObj() {
@@ -848,6 +842,11 @@ export default {
     //     },
     //   };
     // },
+      wZong(){
+        return (val,oval)=>{
+            console.log(744);
+        }
+      }
   },
 
   created() {
@@ -892,6 +891,9 @@ export default {
     },
     // 选择销售政策获取政策条件列表
     async handlePolicy(e) {
+
+
+
       this.multipleSelections = [];
       this.dataList = [];
       this.popDataArr = [];
@@ -910,6 +912,9 @@ export default {
 
         if (this.policyId) {
           this.screenForm.policyId = this.policyId;
+          if (this.listItem) {
+            this.policyConditionId = data[0].id;
+          }
         } else {
           this.screenForm.policyId = data[0].policyId;
           this.policyConditionId = data[0].id;
@@ -975,6 +980,8 @@ export default {
         policyConditionId,
         popType,
       });
+
+
       if (!fang) {
         this.poptotal["total" + popType] = data.total;
         this.popcun["cun" + popType] = 1;
@@ -990,17 +997,25 @@ export default {
       }
       const datas = data.records;
       // this.total = data.total;
+      // console.log(this.goodsList,'4555');
       if (this.goodsList.length) {
         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) {
-              datas[q].disabled = true;
+              this.$set(datas[q],'disabled',true)
             }
           }
         }
       }
       for (let i = 0; i < data.records.length; i++) {
         data.records[i].qty = 1;
+
+        this.$set(
+          data.records[i],
+          "zong",
+          data.records[i].qty * data.records[i].price
+        );
+        data.records[i].sums1 = ["price", "qty", "zong"];
         // this.$set(data.records[i],'userList',this.userList)
       }
       if (fang) {
@@ -1008,9 +1023,56 @@ export default {
       } else {
         this.popDataArr.push(datas);
       }
-
       // consloe(this.popDataArr);
     },
+     // 获取政策列表
+    getMaterialTypeList(val) {
+      getMaterialTypeList({
+        pageNum: 1,
+        pageSize: 10,
+        policyId: this.screenForm.policyId,
+        saleTypeCode: this.screenForm.saleTypeCode,
+        [val]: true,
+      }).then((res) => {
+
+           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)
+                }
+
+           }
+
+          }
+        }
+
+        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].sums1 = ["price", "qty", "zong"];
+          res.data.records[i].userList = this.userList;
+          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;
+
+            }
+          }
+        }
+       this.dataList = res.data.records;
+        this.total = res.data.total;
+        this.popDataArr = [];
+        this.popArr = [];
+        // // consloe(this.dataList, "kkkk");
+      });
+    },
     // 下一步获取某个政策条件比例数据
     handleCondition() {
       if (this.multipleSelection.length) {
@@ -1099,10 +1161,13 @@ export default {
           this.$set(item, "userList", this.userList);
         });
 
-            if (this.goodsList.length && this.goodsList[0].wallets.length) {
-                this.mainForm.k3ServiceName = this.goodsList[0].wallets[0].serviceId;
-        this.mainForm.k3ServiceId = this.goodsList[0].wallets[0].serviceId;
-            }
+
+        if (this.goodsList.length && this.goodsList[0].wallets.length) {
+          this.mainForm.k3ServiceName =
+            this.goodsList[0].wallets[0].serviceId || "";
+          this.mainForm.k3ServiceId =
+            this.goodsList[0].wallets[0].serviceId || "";
+        }
 
         this.cusIndex = 0;
         this.total = 0;
@@ -1126,10 +1191,14 @@ export default {
         } else {
           this.goodsList = arrData;
         }
-         if (this.goodsList.length && this.goodsList[0].wallets.length) {
-                this.mainForm.k3ServiceName = this.goodsList[0].wallets[0].serviceId;
-        this.mainForm.k3ServiceId = this.goodsList[0].wallets[0].serviceId;
-            }
+
+
+        if (this.goodsList.length && this.goodsList[0].wallets.length) {
+          this.mainForm.k3ServiceName =
+            this.goodsList[0].wallets[0].serviceId || "";
+          this.mainForm.k3ServiceId =
+            this.goodsList[0].wallets[0].serviceId || "";
+        }
 
         this.goodsList.forEach((item) => {
           this.$set(item, "status1", "");
@@ -1145,6 +1214,7 @@ export default {
         this.$refs.singleTable.forEach((k) => {
           k.clearSelection();
         });
+
         // this.$refs.singleTable.clearSelection();
       } else {
         this.$errorMsg("请选择");
@@ -1158,6 +1228,7 @@ export default {
         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;
         data.retailOrderItemList.forEach((item) => {
@@ -1182,7 +1253,14 @@ export default {
         pageSize: -1,
         status: true,
       }).then((res) => {
-        this.screenForm.policyId = res.data.records[0].code;
+        if (this.policyId) {
+          this.screenForm.policyId = this.policyId
+          this.disabled = true
+
+        }else{
+           this.screenForm.policyId = res.data.records[0].code;
+        }
+
         this.policyList = res.data.records;
         if (this.policyList.length) {
           this.handlePolicy(this.screenForm.policyId);
@@ -1220,39 +1298,24 @@ 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;
-          data.records[i].userList = this.userList;
-        }
+          this.$set(
+          res.data.records[i],
+          "zong",
+          res.data.records[i].qty * res.data.records[i].price
+          );
+          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;
-      });
-    },
-    // 获取政策列表
-    getMaterialTypeList(val) {
-      getMaterialTypeList({
-        pageNum: 1,
-        pageSize: 10,
-        policyId: this.screenForm.policyId,
-        saleTypeCode: this.screenForm.saleTypeCode,
-        [val]: true,
-      }).then((res) => {
-        for (let i = 0; i < res.data.records.length; i++) {
-          res.data.records[i].qty = 1;
-          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;
-            }
-          }
         }
+
         this.dataList = res.data.records;
         this.total = res.data.total;
-        this.popDataArr = [];
-        this.popArr = [];
-        // // consloe(this.dataList, "kkkk");
       });
     },
+
     // 打开引用
     handleShow() {
       this.isShowDialog = true;
@@ -1504,7 +1567,8 @@ export default {
           //   ].dictValue;
           let params = {
             theTime: this.mainForm.date,
-
+            k3ServiceId: this.mainForm.k3ServiceId,
+            k3ServiceName: this.mainForm.k3ServiceName,
             remark: this.mainForm.remark,
             type: 2, // 1:普通零售单,2:政策零售单
             retailOrderItemList: this.goodsList,
@@ -1519,7 +1583,6 @@ export default {
             });
           } else {
             addData(params).then((res) => {
-              console.log(5585);
               this.$successMsg("添加成功");
               this.goBack();
               this.$parent.getList();

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

@@ -252,7 +252,11 @@
               prop="price"
               min-width="100"
               show-overflow-tooltip
-            ></el-table-column>
+            >
+                <template slot-scope="scope">
+                {{ scope.row.price | numToFixed }}
+              </template>
+            </el-table-column>
             <el-table-column
               align="center"
               label="金额"