瀏覽代碼

Merge branch 'feature/Feature-basic_data' of https://gogs.zfire.top/zfire-front/supply-front into feature/Feature-basic_data

chen 3 年之前
父節點
當前提交
4050cff96b

+ 8 - 0
src/api/basic_data/material.js

@@ -15,6 +15,14 @@ export function getCategoryList(params) {
   })
 }
 
+export function editCategory(params) {
+  return request({
+    url: '/k3/material/edit',
+    method: 'post',
+    data:params
+  })
+}
+
 
 export function getMaterialList(params) {
   return request({

+ 257 - 0
src/components/Common/print-foshan.vue

@@ -0,0 +1,257 @@
+<template>
+  <div class="detail-container">
+    <div class="print-form-1">
+      <el-row :gutter="0">
+        <el-col :span="6" class="item">
+          <div class="label">经销商编码:</div>
+          <div class="value">{{detailData.customerId}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">出库日期:</div>
+          <div class="value">{{nowDate}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">仓库:</div>
+          <div class="value">{{detailData.correspondName}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">信息密钥:</div>
+          <div class="value">{{detailData.informationKey}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">经销商:</div>
+          <div class="value">{{detailData.customerName}}</div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div class="print-table-1">
+      <div class="head">
+        <el-row :gutter="20">
+          <el-col :span="4">发货单号/订单号</el-col>
+          <el-col :span="3">销售类型</el-col>
+          <el-col :span="3">文件编号</el-col>
+          <el-col :span="8">规格型号</el-col>
+          <el-col :span="3">单位</el-col>
+          <el-col :span="3">数量</el-col>
+        </el-row>
+      </div>
+      <div class="body">
+        <div v-for="(item, index) in detailData.invoicePickBeans" :key="index">
+          <el-row :gutter="20">
+            <el-col :span="4">{{ item.invoiceId || '' }}</el-col>
+            <el-col :span="3">{{ item.saleTypeName || '' }}</el-col>
+            <el-col :span="3">{{ item.fileNo || '' }}</el-col>
+            <el-col :span="8">{{ item.specification || '' }}</el-col>
+            <el-col :span="3">{{ item.unit || '' }}</el-col>
+            <el-col :span="3">{{ item.refundableQty || 0 }}</el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="4">{{ item.invoiceId || '' }}</el-col>
+            <el-col :span="2">发货日期</el-col>
+            <el-col :span="4">{{ item.theTime || '' }}</el-col>
+            <el-col :span="2">工程编号</el-col>
+            <el-col :span="4">{{ item.refEnginRecordNo || '' }}</el-col>
+            <el-col :span="2">备注</el-col>
+            <el-col :span="6">{{ item.remark || '' }}</el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="foot">
+        <el-row :gutter="20">
+          <el-col :span="21">合计</el-col>
+          <el-col :span="3">{{total}}</el-col>
+        </el-row>
+      </div>
+    </div>
+
+    <div class="print-form-2">
+      <el-row :gutter="30">
+        <el-col :span="8" class="item">
+          <div class="label">销售公司</div>
+          <div class="value">
+            <el-input readonly></el-input>
+          </div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">仓库</div>
+          <div class="value">
+            <el-input readonly></el-input>
+          </div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商</div>
+          <div class="value">
+            <el-input readonly></el-input>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
+
+  </div>
+</template>
+
+<script>
+
+export default {
+  name: 'PrintGuangzhou',
+  props: {
+    detailData: {
+      type: Object,
+      default: null
+    }
+  },
+
+  computed: {
+    nowDate() {
+      var date = new Date();
+      var seperator1 = "-";
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var strDate = date.getDate();
+      if (month >= 1 && month <= 9) {
+          month = "0" + month;
+      }
+      if (strDate >= 0 && strDate <= 9) {
+          strDate = "0" + strDate;
+      }
+      var currentdate = year + seperator1 + month + seperator1 + strDate;
+      return currentdate;
+    },
+
+    total() {
+      if(!this.detailData.invoicePickBeans) {
+        return false;
+      }
+      let num = 0;
+      this.detailData.invoicePickBeans.forEach(item => {
+        num = num + item.refundableQty;
+      });
+      return num;
+    }
+  },
+
+  methods: {
+
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .detail-container {
+    width: 100%;
+    height: 100%;
+  }
+  .print-form-1 {
+    .item {
+      display: flex;
+      padding-right: 10px;
+      .label {
+        height: 40px;
+        display: flex;
+        align-items: center;
+        box-sizing: border-box;
+        font-size: 14px;
+        color: #333333;
+        flex-shrink: 0;
+      }
+      .value {
+        flex: 1;
+        height: 40px;
+        display: flex;
+        align-items: center;
+        box-sizing: border-box;
+        font-size: 14px;
+        color: #333333;
+        input {
+          border: none;
+          padding: 0;
+        }
+      }
+    }
+  }
+
+  .print-table-1 {
+    font-size: 14px;
+    margin-top: 20px;
+    margin-bottom: 40px;
+    .el-row {
+      margin-left: 0 !important;
+      margin-right: 0 !important;
+      border: 1px solid #EBEEF5;
+      border-right: none;
+    }
+    .el-col {
+      padding-top: 14px;
+      padding-bottom: 14px;
+      border-right: 1px solid #EBEEF5;
+    }
+    .head {
+      color: #909399;
+      font-weight: bold;
+      .el-col {
+        padding: 0;
+        display: flex;
+        height: 40px;
+        align-items: center;
+      }
+    }
+    .body {
+      color: #333333;
+      .el-row {
+        border-top: none;
+      }
+      .el-col {
+        padding: 0;
+        display: flex;
+        height: 40px;
+        align-items: center;
+        word-break: break-all;
+      }
+    }
+    .foot {
+      color: #333333;
+      margin-top: 20px;
+      border-right: 1px solid #EBEEF5;
+      .el-col {
+        padding: 0;
+        display: flex;
+        height: 40px;
+        align-items: center;
+        word-break: break-all;
+      }
+    }
+  }
+
+  .print-form-2 {
+    .item {
+      display: flex;
+      padding-right: 10px;
+      .label {
+        height: 40px;
+        display: flex;
+        align-items: center;
+        box-sizing: border-box;
+        font-size: 14px;
+        color: #333333;
+        flex-shrink: 0;
+      }
+      .value {
+        flex: 1;
+        height: 40px;
+        display: flex;
+        align-items: center;
+        box-sizing: border-box;
+        font-size: 14px;
+        color: #333333;
+        ::v-deep .el-input input {
+          height: 30px;
+          border: none;
+          border-bottom: 1px solid #EBEEF5;
+          padding: 0 10px;
+        }
+      }
+    }
+  }
+
+</style>

+ 17 - 3
src/views/basic_data/material/components/material_list-detail.vue

@@ -607,14 +607,14 @@
                 </el-select>
               </el-form-item>
               <el-form-item label="是否允许置换" size="small">
-                <el-select v-model="zhihuan">
+                <el-select v-model="isDisplace">
                   <el-option label="是" :value="true"> </el-option>
                   <el-option label="否" :value="false"> </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
           </el-row>
-          <!-- <el-button >保存</el-button> -->
+          <el-button  @click="handleSave">保存</el-button>
         </div>
       </el-card>
     </el-form>
@@ -622,6 +622,10 @@
 </template>
 
 <script>
+import {
+ editCategory
+} from "@/api/basic_data/material";
+
 export default {
   props: {
     detail: {
@@ -633,17 +637,27 @@ export default {
     return {
       value1: "是",
       dinghuo: true,
-      zhihuan: true,
+      isDisplace:''
     };
   },
   created() {
     console.log(this.detail);
+    this.isDisplace = this.detail.isDisplace
   },
   methods: {
     goBack() {
       console.log(this.$parent);
       this.$parent.isShow = true;
     },
+    handleSave(){
+      editCategory({
+        id:this.detail.id,
+        isDisplace:this.isDisplace
+      }).then(res=>{
+        this.$successMsg('编辑成功')
+          this.$parent.isShow = true;
+      })
+    }
   },
 };
 </script>

+ 107 - 98
src/views/basic_data/material/components/modify_list-apply.vue

@@ -246,6 +246,7 @@
                     v-model="scope.row.walletRebateId"
                     placeholder="请选择返利类型"
                     @change="handelRebateList($event, scope.$index, scope.row)"
+                       @remove-tag="handleRemove2($event, scope.$index, scope.row)"
                   >
                     <el-option
                       v-for="(item, index) in scope.row.rebateList"
@@ -343,6 +344,7 @@
                       clearable
                       v-model="scope.row.walletsId"
                       @change="handelWallets($event, scope.$index, scope.row)"
+                      @remove-tag="handleRemove($event, scope.$index, scope.row)"
                       placeholder="请选择现金钱包"
                     >
                       <el-option
@@ -359,6 +361,7 @@
                       clearable
                       v-model="scope.row.walletsId"
                       @change="handelWallets($event, scope.$index, scope.row)"
+                      @remove-tag="handleRemove($event, scope.$index, scope.row)"
                       placeholder="请选择现金钱包"
                     >
                       <el-option
@@ -964,59 +967,75 @@ export default {
       this.$set(this.items[index], "rebateList", rebateList);
       // this.fang = false;
     },
+     resArr(arr1, arr2) {
+      return arr1.filter((v) => arr2.every((val) => val.id != v.id));
+    },
     // xua
     handelWallets(e, index, row) {
-      let id = row.cid;
-
+      let id = row.cid || row.id;
+      if (e &&  e.length) {
+    for (let i = 0; i < e.length; i++) {
       if (!this.wall1.includes(e[e.length - 1])) {
-        this.items[index].wallets.push({
-          type: "COMMONLY",
-          id: "",
-          updPriceBillId: id,
-          updPriceBillItemId: id,
-          walletId: e[e.length - 1],
-        });
+        this.$set(row, 'wallets',[
+          ...row.wallets,
+          {
+            type: "COMMONLY",
+            id: "",
+            updPriceBillId: id,
+            updPriceBillItemId: id,
+            walletId: e[e.length - 1],
+          },
+        ]);
+        this.wall1.push(e[e.length - 1])
+      }
+    }
       }
     },
-    handelRebateList(e, index, row) {
-      let id = row.cid;
-      if (!this.wall2.includes(e[e.length - 1])) {
-        this.items[index].rebateWallets.push({
-          type: "REBATE",
-          id: "",
-          updPriceBillId: id,
-          updPriceBillItemId: id,
-          walletId: e[e.length - 1],
-        });
+    handleRemove(e, index, row) {
+      console.log(e);
+         const copxyWall = JSON.parse(JSON.stringify(row.wallets))
+        for (let i = 0; i < row.wallets.length; i++) {
+        if (this.wall1.includes(e) && row.wallets[i].walletId==e) {
+          console.log(454);
+
+                this.wall1.splice(i,1)
+                  copxyWall.splice(i,1)
+              }
+        }
+        this.$set(row,'wallets',copxyWall)
+
+    },
+  handleRemove2(e, index, row) {
+         const copxyWall = JSON.parse(JSON.stringify(row.rebateWallets))
+        for (let i = 0; i < row.rebateWallets.length; i++) {
+        if (this.wall2.includes(e) && row.rebateWallets[i].walletId==e) {
+                copxyWall.splice(i,1)
+                this.wall2.splice(i,1)
+              }
+        }
+        this.$set(row,'rebateWallets',copxyWall)
+
+    }
+,
+  handelRebateList(e, index, row) {
+      let id = row.cid || row.id;
+     if (e &&  e.length) {
+    for (let i = 0; i < e.length; i++) {
+     if (!this.wall2.includes(e[e.length - 1])) {
+        this.$set(row, "rebateWallets", [
+          ...row.rebateWallets,
+          {
+            type: "REBATE",
+            id: "",
+            updPriceBillId: id,
+            updPriceBillItemId: id,
+            walletId: e[e.length - 1],
+          },
+        ]);
+         this.wall2.push(e[e.length - 1])
       }
-      // for (let i = 0; i < e.length; i++) {
-      //   if (this.items[index].wallets.length) {
-      //     for (let j = 0; j < this.items[index].wallets.length; j++) {
-      //       if (e[i] !== this.items[index].wallets[j].walletId) {
-      //         this.$set(this.items[index], "wallets", [
-      //           ...this.items[index].wallets,
-      //           {
-      //             type: "REBATE",
-      //             id: "",
-      //             updPriceBillId: row.cid,
-      //             updPriceBillItemId: row.cid,
-      //             walletId: e[i],
-      //           },
-      //         ]);
-      //       }
-      //     }
-      //   } else {
-      //     this.$set(this.items[index], "rebateWallets", [
-      //       {
-      //         type: "REBATE",
-      //         id: "",
-      //         updPriceBillId: row.id,
-      //         updPriceBillItemId: row.id,
-      //         walletId: e[0],
-      //       },
-      //     ]);
-      //   }
-      // }
+    }
+  }
     },
     handleUser(e) {
       const adminCompany = this.userList.filter((k) => {
@@ -1161,13 +1180,13 @@ export default {
       }
       this.walleList = wall.data;
 
-      let linshi = [];
       if (this.$parent.show == 5) {
-        let rebateList = [];
         getProductRriceDetail({ id: this.cid }).then((res) => {
-          //  this.editData = res.data;
-
           for (let i = 0; i < res.data.items.length; i++) {
+            let linshi = [];
+            let rebateList = [];
+            let walletIds = [];
+            let walletRebateIds = [];
             res.data.items[i].isPublishArr = [
               {
                 value: "是",
@@ -1189,62 +1208,48 @@ export default {
               },
             ];
 
-            let walletIds = [];
-            let walletRebateIds = [];
-            res.data.items[i].wallets = [];
             res.data.items[i].walletsId = [];
             res.data.items[i].walletRebateId = [];
+              res.data.items[i].rebateWallets = [];
+            res.data.items[i].wallets = [];
             for (let p = 0; p < res.data.items[i].wallets2.length; p++) {
               if (res.data.items[i].wallets2[p].type == "COMMONLY") {
                 walletIds.push(res.data.items[i].wallets2[p].walletId);
-                this.$set(res.data.items[i], "walletsId", walletIds);
-                res.data.items[i].wallets.push({
-                  type: "REBATE",
-                  id: "",
-                  updPriceBillId: res.data.items[i].updPriceBillId,
-                  updPriceBillItemId: res.data.items[i].updPriceBillId,
-                  walletId: res.data.items[i].wallets2[p].walletId,
-                });
-              } else {
-                res.data.items[i].wallets.push({
-                  type: "COMMONLY",
-                  id: "",
-                  updPriceBillId: res.data.items[i].updPriceBillId,
-                  updPriceBillItemId: res.data.items[i].updPriceBillId,
-                  walletId: res.data.items[i].wallets2[p].walletId,
-                });
+                this.$set(res.data.items[i],'wallets',[
+                  ...res.data.items[i].wallets,
+                  res.data.items[i].wallets2[p]
+                ])
+              } else if (res.data.items[i].wallets2[p].type == "REBATE") {
                 walletRebateIds.push(res.data.items[i].wallets2[p].walletId);
-                this.$set(res.data.items[i], "walletRebateId", walletRebateIds);
+                this.$set(res.data.items[i],'rebateWallets',[
+                  ...res.data.items[i].rebateWallets,
+                  res.data.items[i].wallets2[p]
+                ])
               }
             }
-
+            this.$set(res.data.items[i], "walletsId", walletIds);
+            this.$set(res.data.items[i], "walletRebateId", walletRebateIds);
+            console.log(res.data.items[i].walletRebateId);
             this.rebateList.forEach((k) => {
               k.saleTypes.forEach((j) => {
-                console.log(
-                  j.saleTypeId == res.data.items[i].saleTypeId,
-                  "545454"
-                );
                 if (
                   !linshi.includes(j.saleTypeId) &&
                   j.saleTypeId == res.data.items[i].saleTypeId
                 ) {
+                  console.log(res.data.items[i].saleTypeId, "saleTypeId");
                   rebateList.push(k);
                 }
               });
             });
-            console.log(rebateList, "444878787");
-            res.data.items[i].rebateWallets = [];
 
-            res.data.items[i].wallets = [];
             res.data.items[i].walleList = this.walleList;
             res.data.items[i].rebateList = rebateList;
-
-            this.items = res.data.items;
-            this.base = res.data;
-
             res.data.items[i].fang = false;
           }
 
+
+          this.items = res.data.items;
+          this.base = res.data;
           this.listLoading = false;
         });
       } else {
@@ -1281,21 +1286,18 @@ export default {
       // 如果没有返回值则默认返回false(全部无法选中)
     },
     hanleSbumit() {
-      for (let i = 0; i < this.items.length; i++) {
-        if (!this.cid) {
-          this.items[i].wallets = [
-            ...this.items[i].rebateWallets,
-            ...this.items[i].wallets,
-          ];
-        } else {
-        }
+      console.log(this.items, 45454);
+      // for (let i = 0; i < this.items.length; i++) {
+      //   this.items[i].wallets = [
+      //     ...this.items[i].rebateWallets,
+      //     ...this.items[i].wallets,
+      //   ];
 
-        console.log(this.items, 45454);
-        if (!this.items[i].mainId) {
-          this.$errorMsg("请选择销售类型");
-          return;
-        }
-      }
+      //   if (!this.items[i].mainId) {
+      //     this.$errorMsg("请选择销售类型");
+      //     return;
+      //   }
+      // }
       const params = {
         ...this.base,
         items: this.items,
@@ -1312,8 +1314,15 @@ export default {
       });
     },
     hanleSave() {
+      console.log(this.items);
       handleEdit({
-        ...this.base,
+         ...this.base,
+        items: this.items,
+        saleTypeId: this.saleTypeId,
+        adminWebsitId: this.adminWebsitId,
+        serviceId: this.serviceId,
+        adminCompanyName: this.adminCompanyName,
+        serviceName: this.nickName,
       }).then((res) => {
         this.$successMsg("成功");
         this.$parent.cid = "";

+ 1 - 1
src/views/basic_data/material/components/modify_list-detail.vue

@@ -278,7 +278,7 @@ export default {
       saleName: "",
       status: "",
     };
-    console.log(this.detail,545454);
+    console.log(this.detail);
     getTypeList(params).then((res) => {
       this.typeList = res.data.records;
     });

+ 7 - 2
src/views/engin_deposit/components/deposit_list-detail.vue

@@ -241,10 +241,15 @@
             <div class="value">{{ details.checkDate }}</div>
           </el-col>
           <el-col :xs="12" :sm="12" :lg="12" class="item">
-            <div class="label">是否退押</div>
+            <div class="label" >是否退押</div>
             <div class="value">
-              {{ details.isRefundDeposit == true ? "是" : "否" }}
+
+              <template v-if="!(details.examineStatus =='WAIT' || details.examineStatus == 'SAVE' )">
+                {{ details.isRefundDeposit == true ? "是" : "否" }}
+                </template>
+
             </div>
+
           </el-col>
           <el-col :xs="12" :sm="12" :lg="12" class="item">
             <div class="label">审批结果</div>

+ 1 - 1
src/views/supply/engin/commerce_list.vue

@@ -95,7 +95,7 @@
               <template slot-scope="scope">
                 <div>
                   <span>{{scope.row.orderDate | dateToDayFilter}}</span>
-                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" v-if="scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT'" ></el-button>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" v-if="$checkBtnRole('date', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT')" ></el-button>
                 </div>
               </template>
             </el-table-column>

+ 4 - 4
src/views/supply/engin/components/home_detail.vue

@@ -77,14 +77,14 @@
             <div class="label">业务员</div>
             <div class="value">{{detailData.serviceName}}</div>
           </el-col>
-          <el-col :span="24" class="item">
+          <!-- <el-col :span="24" class="item">
             <div class="label">格力回复</div>
             <div class="value">{{detailData.note1}}</div>
           </el-col>
           <el-col :span="24" class="item">
             <div class="label">格力内部备注</div>
             <div class="value">{{detailData.note2}}</div>
-          </el-col>
+          </el-col> -->
           <el-col :span="24" class="item">
             <div class="label">备注</div>
             <div class="value">{{detailData.remark}}</div>
@@ -150,7 +150,7 @@
           </el-table-column>
           <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="使用返利金额" prop="rebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="使用返利金额" prop="payRebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
@@ -226,7 +226,7 @@
           </el-table-column>
           <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="实际返利金额" prop="rebateAmount" min-width="110" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="实际返利金额" prop="payRebateAmount" min-width="110" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>

+ 2 - 2
src/views/supply/engin/components/home_examine.vue

@@ -78,7 +78,7 @@
           <div class="label">业务员</div>
           <div class="value">{{detailData.serviceName}}</div>
         </el-col>
-        <el-col :span="24" class="item">
+        <!-- <el-col :span="24" class="item">
           <div class="label">格力回复</div>
           <div class="value">
             <el-input v-model="detailData.note1" placeholder="请输入格力回复"></el-input>
@@ -89,7 +89,7 @@
           <div class="value">
             <el-input v-model="detailData.note2" placeholder="请输入格力内部备注"></el-input>
           </div>
-        </el-col>
+        </el-col> -->
         <el-col :span="24" class="item">
           <div class="label">备注</div>
           <div class="value">{{detailData.remark}}</div>

+ 2 - 2
src/views/supply/engin/components/home_form.vue

@@ -98,7 +98,7 @@
             <el-input v-model="mainForm.address" placeholder="请输入安装地址" disabled></el-input>
           </el-form-item>
         </el-col>
-        <el-col :xs="24" :sm="24" :lg="24">
+        <!-- <el-col :xs="24" :sm="24" :lg="24">
           <el-form-item label="格力内部备注" prop="greeRemark">
             <el-input v-model="mainForm.greeRemark" placeholder="请输入格力内部备注"></el-input>
           </el-form-item>
@@ -107,7 +107,7 @@
           <el-form-item label="格力回复" prop="greeReply">
             <el-input v-model="mainForm.greeReply" placeholder="请输入格力回复"></el-input>
           </el-form-item>
-        </el-col>
+        </el-col> -->
         <el-col :xs="24" :sm="24" :lg="24">
           <el-form-item label="备注" prop="remark">
             <el-input v-model="mainForm.remark" placeholder="请输入备注"></el-input>

+ 2 - 2
src/views/supply/engin/components/home_return.vue

@@ -80,14 +80,14 @@
           <div class="label">格力回复</div>
           <div class="value">{{detailData.note1}}</div>
         </el-col>
-        <el-col :span="24" class="item">
+        <!-- <el-col :span="24" class="item">
           <div class="label">格力内部备注</div>
           <div class="value">{{detailData.note2}}</div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">备注</div>
           <div class="value">{{detailData.remark}}</div>
-        </el-col>
+        </el-col> -->
         <el-col :span="6" class="item">
           <div class="label">制单人</div>
           <div class="value">{{detailData.createName}}</div>

+ 1 - 1
src/views/supply/engin/engin_list.vue

@@ -93,7 +93,7 @@
               <template slot-scope="scope">
                 <div>
                   <span>{{scope.row.orderDate | dateToDayFilter}}</span>
-                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" v-if="scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT'" ></el-button>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" v-if="$checkBtnRole('date', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT')" ></el-button>
                 </div>
               </template>
             </el-table-column>

+ 2 - 2
src/views/supply/engin/home_list.vue

@@ -95,7 +95,7 @@
               <template slot-scope="scope">
                 <div>
                   <span>{{scope.row.orderDate | dateToDayFilter}}</span>
-                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" v-if="scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT'" ></el-button>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" v-if="$checkBtnRole('date', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT')" ></el-button>
                 </div>
               </template>
             </el-table-column>
@@ -137,7 +137,7 @@
                 <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.parentId)" v-if="scope.row.examineStatus === 'WAIT'" >
                   <el-button slot="reference" type="text">撤回</el-button>
                 </el-popconfirm>
-                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL')">编辑</el-button>
                 <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
                 <el-button type="text" @click="toReturn(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus !== 'FAIL'">退订</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>

+ 53 - 19
src/views/supply/pickup/check.vue

@@ -59,13 +59,13 @@
 
       <div class="mymain-container">
         <div class="table">
-          <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe @selection-change="handleSelectionChange">
-            <!-- <el-table-column align="center" type="selection" width="55"></el-table-column> -->
-            <el-table-column align="center" label="操作" width="100" fixed="left">
+          <el-table ref="table" v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe @select="handleSelect">
+            <el-table-column align="center" type="selection" width="55"></el-table-column>
+            <!-- <el-table-column align="center" label="操作" width="100" fixed="left">
               <template slot-scope="scope">
                 <el-button type="text" @click="toPrint(scope.row)">打印</el-button>
               </template>
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column align="center" label="状态" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.printNum ? '已打单(' + scope.row.printNum + ')' : '未打单' }}
@@ -109,7 +109,7 @@
           </el-table>
         </div>
       </div>
-      <div class="pagination clearfix">
+      <!-- <div class="pagination clearfix">
         <div class="fr">
           <el-pagination
             @size-change="handleSizeChange"
@@ -121,13 +121,13 @@
             :total="listTotal">
           </el-pagination>
         </div>
-      </div>
+      </div> -->
 
-      <!-- <div class="page-footer">
+      <div class="page-footer">
         <div class="footer">
-          <el-button type="primary" @click="toPrint" :disabled="multipleSelection.length < 1">打印发货单</el-button>
+          <el-button type="primary" @click="toPrint" :disabled="tableSelection.length < 1">打印发货单</el-button>
         </div>
-      </div> -->
+      </div>
 
     </div>
 
@@ -201,7 +201,7 @@ export default {
       countDown: 60,
 			timer: null,
 
-      multipleSelection: [],
+      tableSelection: [],
 
       queryItem: {},
       isShowPrint: false,
@@ -279,8 +279,8 @@ export default {
       this.listLoading = true;
 
       let params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
+        pageNum: 1,
+        pageSize: -1,
         takerId: this.screenForm.manId,
         status: this.screenForm.status,
       };
@@ -309,23 +309,57 @@ export default {
       this.isShowPrint = false;
     },
 
-    handleSelectionChange(val) {
-      this.multipleSelection = val;
+    handleSelect(selection, row) {
+      this.$refs.table.toggleRowSelection(row);
+      this.dataList.forEach(item => {
+        if (item.informationKey === row.informationKey) {
+          this.$refs.table.toggleRowSelection(item);
+        }
+      })
+      this.tableSelection = this.$refs.table.selection;
+    },
+
+    // 检查是否一致
+    isAllEqual(array) {
+      if (array.length > 0) {
+        return !array.some(function(item, index) {
+          return item.informationKey !== array[0].informationKey;
+        });
+      } else {
+        return true;
+      }
     },
 
     // 点击打印
-    toPrint(item) {
-      if(!item.printNum) {
-        this.queryItem = item;
+    toPrint() {
+      if(!this.isAllEqual(this.tableSelection)) {
+        return this.$errorMsg('只能选择同一个提货订单');
+      }
+
+      if(!this.tableSelection[0].printNum) {
+        this.queryItem = this.tableSelection;
         this.isShowPrint = true;
       }else {
-        this.queryItem = item;
+        this.queryItem = this.tableSelection;
         this.dialogForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
         this.dialogForm.createDate = this.getDate();
         this.isShowDialog = true;
       }
     },
 
+    // 点击打印
+    // toPrint(item) {
+    //   if(!item.printNum) {
+    //     this.queryItem = item;
+    //     this.isShowPrint = true;
+    //   }else {
+    //     this.queryItem = item;
+    //     this.dialogForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
+    //     this.dialogForm.createDate = this.getDate();
+    //     this.isShowDialog = true;
+    //   }
+    // },
+
     // 关闭弹窗
     cancelDialogForm(){
       this.isShowDialog = false;
@@ -337,7 +371,7 @@ export default {
       this.$refs.dialogForm.validate((valid) => {
         if (valid) {
           let params = {
-            shipId: this.queryItem.invoiceId,
+            shipId: this.queryItem[0].invoiceId,
             password: this.dialogForm.password
           }
           checkPassword(params).then(res => {

+ 23 - 221
src/views/supply/pickup/components/pickup_print.vue

@@ -1,102 +1,15 @@
 <template>
   <div class="detail-container">
-    <div id="printMe">
-      <div class="print-form-1">
-        <el-row :gutter="0">
-          <el-col :span="6" class="item">
-            <div class="label">经销商编码:</div>
-            <div class="value">{{detailData.customerId}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">出库日期:</div>
-            <div class="value">{{getDate()}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">仓库:</div>
-            <div class="value">{{detailData.correspondName}}</div>
-          </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">信息密钥:</div>
-            <div class="value">{{detailData.informationKey}}</div>
-          </el-col>
-          <el-col :span="24" class="item">
-            <div class="label">经销商:</div>
-            <div class="value">{{detailData.customerName}}</div>
-          </el-col>
-        </el-row>
-      </div>
+    <div class="top-container">
+      <el-radio-group v-model="currentType" size="medium" @change="changeType()">
+        <el-radio-button v-for="(item, index) in typeList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
+      </el-radio-group>
+    </div>
 
-      <div class="print-table-1">
-        <div class="head">
-          <el-row :gutter="20">
-            <el-col :span="3">发货单号/订单号</el-col>
-            <el-col :span="2">销售类型</el-col>
-            <el-col :span="3">文件编号</el-col>
-            <el-col :span="6">规格型号</el-col>
-            <el-col :span="2">数量</el-col>
-            <el-col :span="2">单位</el-col>
-            <el-col :span="2">单价</el-col>
-            <el-col :span="2">金额</el-col>
-            <el-col :span="2">折让</el-col>
-          </el-row>
-        </div>
-        <div class="body">
-          <div v-for="(item, index) in detailData.invoicePickBeans" :key="index">
-            <el-row :gutter="20">
-              <el-col :span="3">{{ item.invoiceId || '' }}</el-col>
-              <el-col :span="2">{{ item.saleTypeName || '' }}</el-col>
-              <el-col :span="3">{{ item.fileNo || '' }}</el-col>
-              <el-col :span="6">{{ item.specification || '' }}</el-col>
-              <el-col :span="2">{{ item.refundableQty || 0 }}</el-col>
-              <el-col :span="2">{{ item.unit || '' }}</el-col>
-              <el-col :span="2">{{ item.price || 0 }}</el-col>
-              <el-col :span="2">{{ item.payAmount || 0 }}</el-col>
-              <el-col :span="2">{{ item.totalDiscAmount || 0 }}</el-col>
-            </el-row>
-            <el-row :gutter="20">
-              <el-col :span="3">{{ item.invoiceId || '' }}</el-col>
-              <el-col :span="2">发货日期</el-col>
-              <el-col :span="4">{{ item.theTime || '' }}</el-col>
-              <el-col :span="2">工程编号</el-col>
-              <el-col :span="3">{{ item.refEnginRecordNo || '' }}</el-col>
-              <el-col :span="2">备注</el-col>
-              <el-col :span="8">{{ item.remark || '' }}</el-col>
-            </el-row>
-          </div>
-        </div>
-        <div class="foot">
-          <el-row :gutter="20">
-            <el-col :span="14">合计</el-col>
-            <el-col :span="2">{{ 0 }}</el-col>
-            <el-col :span="2"></el-col>
-            <el-col :span="2">{{ 0 }}</el-col>
-            <el-col :span="2"></el-col>
-          </el-row>
-        </div>
-      </div>
+    <div id="printMe">
+      
+      <PrintFoshan :detailData="detailData" v-if="currentType === 1" />
 
-      <div class="print-form-2">
-        <el-row :gutter="30">
-          <el-col :span="8" class="item">
-            <div class="label">销售公司</div>
-            <div class="value">
-              <el-input readonly></el-input>
-            </div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">仓库</div>
-            <div class="value">
-              <el-input readonly></el-input>
-            </div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">经销商</div>
-            <div class="value">
-              <el-input readonly></el-input>
-            </div>
-          </el-col>
-        </el-row>
-      </div>
     </div>
     
     <div class="page-footer">
@@ -112,16 +25,26 @@
 <script>
 import print from 'vue-print-nb'
 import { getDetail, addPrint } from "@/api/supply/pickup";
+import PrintFoshan from "@/components/Common/print-foshan";
 
 export default {
   name: 'ReturnDetail',
   componentName: 'ReturnDetail',
   props: ['listItem'],
+  components: {
+    PrintFoshan
+  },
   directives: {
     print
   },
   data() {
     return {
+      currentType: 1,
+      typeList: [
+        { label: '佛山', value: 1 },
+        { label: '广州', value: 2 },
+        { label: '韶关', value: 3 },
+      ],
       printObj: {
         id: 'printMe',
         closeCallback: () => {
@@ -142,32 +65,20 @@ export default {
       this.$emit('backListFormDetail');
     },
 
-    getDate() {
-      var date = new Date();
-      var seperator1 = "-";
-      var year = date.getFullYear();
-      var month = date.getMonth() + 1;
-      var strDate = date.getDate();
-      if (month >= 1 && month <= 9) {
-          month = "0" + month;
-      }
-      if (strDate >= 0 && strDate <= 9) {
-          strDate = "0" + strDate;
-      }
-      var currentdate = year + seperator1 + month + seperator1 + strDate;
-      return currentdate;
+    changeType() {
+
     },
 
     // 获取详情
     getDetail() {
-      getDetail({id: this.listItem.id}).then(res => {
+      getDetail({id: this.listItem[0].id}).then(res => {
         this.detailData = res.data;
       })
     },
 
     // 添加次数
     addPrint() {
-      addPrint({ids: this.listItem.invoiceOrderId}).then(res => {
+      addPrint({ids: this.listItem[0].invoiceOrderId}).then(res => {
         // this.$successMsg('提交成功');
         this.$parent.getList();
       })
@@ -181,116 +92,7 @@ export default {
     width: 100%;
     height: 100%;
   }
-  .print-form-1 {
-    .item {
-      display: flex;
-      padding-right: 10px;
-      .label {
-        height: 40px;
-        display: flex;
-        align-items: center;
-        box-sizing: border-box;
-        font-size: 14px;
-        color: #333333;
-        flex-shrink: 0;
-      }
-      .value {
-        flex: 1;
-        height: 40px;
-        display: flex;
-        align-items: center;
-        box-sizing: border-box;
-        font-size: 14px;
-        color: #333333;
-        input {
-          border: none;
-          padding: 0;
-        }
-      }
-    }
-  }
-
-  .print-table-1 {
-    font-size: 14px;
-    margin-top: 20px;
+  .top-container {
     margin-bottom: 20px;
-    .el-row {
-      margin-left: 0 !important;
-      margin-right: 0 !important;
-      border: 1px solid #EBEEF5;
-      border-right: none;
-    }
-    .el-col {
-      padding-top: 14px;
-      padding-bottom: 14px;
-      border-right: 1px solid #EBEEF5;
-    }
-    .head {
-      color: #909399;
-      font-weight: bold;
-      .el-col {
-        padding: 0;
-        display: flex;
-        height: 40px;
-        align-items: center;
-      }
-    }
-    .body {
-      color: #333333;
-      .el-row {
-        border-top: none;
-      }
-      .el-col {
-        padding: 0;
-        display: flex;
-        height: 40px;
-        align-items: center;
-        word-break: break-all;
-      }
-    }
-    .foot {
-      color: #333333;
-      margin-top: 20px;
-      border-right: 1px solid #EBEEF5;
-      .el-col {
-        padding: 0;
-        display: flex;
-        height: 40px;
-        align-items: center;
-        word-break: break-all;
-      }
-    }
   }
-
-  .print-form-2 {
-    .item {
-      display: flex;
-      padding-right: 10px;
-      .label {
-        height: 40px;
-        display: flex;
-        align-items: center;
-        box-sizing: border-box;
-        font-size: 14px;
-        color: #333333;
-        flex-shrink: 0;
-      }
-      .value {
-        flex: 1;
-        height: 40px;
-        display: flex;
-        align-items: center;
-        box-sizing: border-box;
-        font-size: 14px;
-        color: #333333;
-        ::v-deep .el-input input {
-          height: 30px;
-          border: none;
-          border-bottom: 1px solid #EBEEF5;
-          padding: 0 10px;
-        }
-      }
-    }
-  }
-
 </style>

+ 17 - 9
src/views/supply/policy/components/retail_form2.vue

@@ -877,8 +877,9 @@ export default {
     },
     //引用销售政策搜索
     handlePolicyTypeList() {
-      if (this.screenForm.factorId) {
+      if (this.screenForm.factorId && this.screenForm.factorId) {
         this.getConditionList(this.policyConditionId, this.cusIndex + 1);
+        this.dataList = []
       } else {
         // sProvision = true
         this.getMaterialTypeList("sProvision");
@@ -895,7 +896,7 @@ export default {
       }).then((res) => {
         const datas = res.data.records;
         this.total = res.data.total;
-        console.log(this.goodsList.length, 223424);
+
         if (this.goodsList.length) {
           for (let p = 0; p < this.goodsList.length; p++) {
             for (let q = 0; q < datas.length; q++) {
@@ -920,15 +921,27 @@ export default {
     },
     // 下一步获取某个政策条件比例数据
     handleCondition() {
+
       if (this.multipleSelection.length) {
         this.cusIndex += 1;
         this.disabled = true;
         this.multipleData.push(this.multipleSelection);
-        console.log(this.multipleData, "push", this.cusIndex);
         this.getConditionList(this.policyConditionId, this.cusIndex + 1);
       } else {
         this.$errorMsg("请选择");
       }
+       console.log(this.cusIndex,'下');
+    },
+       // 上一步
+    handleShang() {
+
+      this.cusIndex == 0 ? (this.disabled = false) : "";
+      this.multipleData.splice(this.cusIndex, 1);
+
+          this.popDataArr.splice(this.cusIndex, 1);
+
+      this.cusIndex -= 1;
+       console.log(this.cusIndex,'上');
     },
     /**
      * 根据条件禁用行复选框
@@ -963,12 +976,7 @@ export default {
       // 如果没有返回值则默认返回false(全部无法选中)
     },
 
-    // 上一步
-    handleShang() {
-      this.cusIndex -= 1;
-      this.cusIndex == 0 ? (this.disabled = false) : "";
-      this.multipleData.splice(this.cusIndex, 1);
-    },
+
     // 条件数据多选
     handleSelectionChange(val) {
       this.multipleSelection = val;

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

@@ -169,6 +169,7 @@
                 <div>
                   <span>{{ scope.row.theTime | dateToDayFilter }}</span>
                   <el-button
+                  v-if="$checkBtnRole('date', $route.meta.roles)"
                     type="text"
                     icon="el-icon-edit"
                     style="padding: 0; margin-left: 6px"

+ 16 - 0
src/views/supply/reserve/components/reserve_form.vue

@@ -53,6 +53,7 @@
     <div style="margin-top: 20px">
       <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog" v-if="!listItem">添加引用</el-button>
       <el-button type="danger" size="small" icon="el-icon-minus" @click="deleteGoods" :disabled="tableSelection.length < 1" v-if="!listItem">批量删除</el-button>
+      <el-button size="small" icon="el-icon-edit" @click="batchChangeNum" :disabled="tableSelection.length < 1" v-if="!listItem">批量设置预留数量</el-button>
     </div>
     <div class="table" style="margin-top: 20px">
       <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400" @selection-change="tableSelectionChange">
@@ -492,6 +493,21 @@ export default {
       }
     },
 
+    // 批量修改数量
+    batchChangeNum() {
+      this.$prompt('请输入预留数量', '批量设置', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        inputValidator: function(value) {
+          if(!value) return '请输入预留数量'
+        },
+      }).then(({ value }) => {
+        this.tableSelection.forEach(item => {
+          item.reservedNum = value;
+        })
+      }).catch(() => {});
+    },
+
     // 添加产品
     addGoods() {
       this.goodsList.push({

+ 1 - 1
src/views/supply/reserve/reserve_list.vue

@@ -100,7 +100,7 @@
             <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="预留数量" prop="reservedNum" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="单数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="经销商编码" prop="customerId" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>

+ 1 - 1
src/views/supply/retail/retail_list.vue

@@ -98,7 +98,7 @@
               <template slot-scope="scope">
                 <div>
                   <span>{{scope.row.theTime | dateToDayFilter}}</span>
-                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" ></el-button>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" v-if="$checkBtnRole('date', $route.meta.roles)" @click="editDate(scope.row)" ></el-button>
                 </div>
               </template>
             </el-table-column>