Jelajahi Sumber

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

howie 3 tahun lalu
induk
melakukan
1e3eab99ad

+ 18 - 0
src/api/supply/engin.js

@@ -239,6 +239,15 @@ export function withdrawHome(params) {
   })
 }
 
+// 家用工程订单 - 弃审
+export function abandonHome(params) {
+  return request({
+    url: '/engin-order/home-abandon',
+    method: 'post',
+    params
+  })
+}
+
 // 家用工程订单 - 删除
 export function deleteHome(params) {
   return request({
@@ -351,6 +360,15 @@ export function withdrawCom(params) {
   })
 }
 
+// 商用工程订单 - 弃审
+export function abandonCom(params) {
+  return request({
+    url: '/engin-order/trade-abandon',
+    method: 'post',
+    params
+  })
+}
+
 // 商用工程订单 - 删除
 export function deleteCom(params) {
   return request({

+ 79 - 73
src/views/basic_data/material/components/modify_list-apply.vue

@@ -246,7 +246,7 @@
                     v-model="scope.row.walletRebateId"
                     placeholder="请选择返利类型"
                     @change="handelRebateList($event, scope.$index, scope.row)"
-                       @remove-tag="handleRemove2($event, scope.$index, scope.row)"
+                    @remove-tag="handleRemove2($event, scope.$index, scope.row)"
                   >
                     <el-option
                       v-for="(item, index) in scope.row.rebateList"
@@ -344,7 +344,9 @@
                       clearable
                       v-model="scope.row.walletsId"
                       @change="handelWallets($event, scope.$index, scope.row)"
-                      @remove-tag="handleRemove($event, scope.$index, scope.row)"
+                      @remove-tag="
+                        handleRemove($event, scope.$index, scope.row)
+                      "
                       placeholder="请选择现金钱包"
                     >
                       <el-option
@@ -361,7 +363,9 @@
                       clearable
                       v-model="scope.row.walletsId"
                       @change="handelWallets($event, scope.$index, scope.row)"
-                      @remove-tag="handleRemove($event, scope.$index, scope.row)"
+                      @remove-tag="
+                        handleRemove($event, scope.$index, scope.row)
+                      "
                       placeholder="请选择现金钱包"
                     >
                       <el-option
@@ -967,77 +971,74 @@ export default {
       this.$set(this.items[index], "rebateList", rebateList);
       // this.fang = false;
     },
-     resArr(arr1, arr2) {
+    resArr(arr1, arr2) {
       return arr1.filter((v) => arr2.every((val) => val.id != v.id));
     },
     // xua
-  handelWallets(e, index, row) {
-        console.log(row,'kjkj4545');
+    handelWallets(e, index, row) {
+      console.log(row, "kjkj4545");
       let id = row.cid || row.updPriceBillId;
-      if (e &&  e.length) {
-    for (let i = 0; i < e.length; i++) {
-      if (!this.wall1.includes(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])
-      }
-    }
+      if (e && e.length) {
+        for (let i = 0; i < e.length; i++) {
+          if (!this.wall1.includes(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]);
+          }
+        }
       }
     },
     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) {
+      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.wall1.splice(i, 1);
+          copxyWall.splice(i, 1);
         }
-        this.$set(row,'wallets',copxyWall)
-
+      }
+      this.$set(row, "wallets", copxyWall);
     },
-  handleRemove2(e, index, row) {
-         const copxyWall = JSON.parse(JSON.stringify(row.wallets))
-        for (let i = 0; i < row.wallets.length; i++) {
-        if (this.wall2.includes(e) && row.wallets[i].walletId==e) {
-                copxyWall.splice(i,1)
-                this.wall2.splice(i,1)
-              }
+    handleRemove2(e, index, row) {
+      const copxyWall = JSON.parse(JSON.stringify(row.wallets));
+      for (let i = 0; i < row.wallets.length; i++) {
+        if (this.wall2.includes(e) && row.wallets[i].walletId == e) {
+          copxyWall.splice(i, 1);
+          this.wall2.splice(i, 1);
         }
-        this.$set(row,'wallets',copxyWall)
-
-    }
-,
-  handelRebateList(e, index, row) {
-    console.log(row,'kjkj');
+      }
+      this.$set(row, "wallets", copxyWall);
+    },
+    handelRebateList(e, index, row) {
+      console.log(row, "kjkj");
       let id = row.cid || row.updPriceBillId;
-     if (e &&  e.length) {
-    for (let i = 0; i < e.length; i++) {
-     if (!this.wall2.includes(e[e.length - 1])) {
-        this.$set(row, "wallets", [
-          ...row.wallets,
-          {
-            type: "REBATE",
-            id: "",
-            updPriceBillId: id,
-            updPriceBillItemId: id,
-            walletId: e[e.length - 1],
-          },
-        ]);
-         this.wall2.push(e[e.length - 1])
+      if (e && e.length) {
+        for (let i = 0; i < e.length; i++) {
+          if (!this.wall2.includes(e[e.length - 1])) {
+            this.$set(row, "wallets", [
+              ...row.wallets,
+              {
+                type: "REBATE",
+                id: "",
+                updPriceBillId: id,
+                updPriceBillItemId: id,
+                walletId: e[e.length - 1],
+              },
+            ]);
+            this.wall2.push(e[e.length - 1]);
+          }
+        }
       }
-    }
-  }
     },
     handleUser(e) {
       const adminCompany = this.userList.filter((k) => {
@@ -1212,25 +1213,23 @@ export default {
 
             res.data.items[i].walletsId = [];
             res.data.items[i].walletRebateId = [];
-              res.data.items[i].rebateWallets = [];
+            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],'wallets',[
+                this.$set(res.data.items[i], "wallets", [
                   ...res.data.items[i].wallets,
-                  res.data.items[i].wallets2[p]
-                ])
+                  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],'rebateWallets',[
+                this.$set(res.data.items[i], "rebateWallets", [
                   ...res.data.items[i].rebateWallets,
-                  res.data.items[i].wallets2[p]
-                ])
+                  res.data.items[i].wallets2[p],
+                ]);
               }
             }
-            this.$set(res.data.items[i], "walletsId", walletIds);
-            this.$set(res.data.items[i], "walletRebateId", walletRebateIds);
 
             this.rebateList.forEach((k) => {
               k.saleTypes.forEach((j) => {
@@ -1238,18 +1237,26 @@ export default {
                   !linshi.includes(j.saleTypeId) &&
                   j.saleTypeId == res.data.items[i].saleTypeId
                 ) {
-                  console.log(res.data.items[i].saleTypeId, "saleTypeId");
+                  console.log(k, 998);
+
+                      for (let w = 0; w < walletRebateIds.length; w++) {
+
+                          if (walletRebateIds[w]!= k.walletRebateId) {
+                                walletRebateIds.splice(w,1)
+                          }
+                  }
+
                   rebateList.push(k);
                 }
               });
             });
-                    console.log(rebateList,res.data.items[i].walletRebateId);
+            this.$set(res.data.items[i], "walletsId", walletIds);
+            this.$set(res.data.items[i], "walletRebateId", walletRebateIds);
             res.data.items[i].walleList = this.walleList;
             res.data.items[i].rebateList = rebateList;
             res.data.items[i].fang = false;
           }
 
-
           this.items = res.data.items;
           this.base = res.data;
           this.listLoading = false;
@@ -1316,7 +1323,6 @@ export default {
       });
     },
     hanleSave() {
-
       // for (let i = 0; i < this.items.length; i++) {
       //     //   const  wallets = []
       //     //     if (this.items[i].wallets.length) {
@@ -1330,7 +1336,7 @@ export default {
 
       // }
       handleEdit({
-         ...this.base,
+        ...this.base,
         items: this.items,
         saleTypeId: this.saleTypeId,
         adminWebsitId: this.adminWebsitId,

+ 6 - 1
src/views/finance/components/receivable_list-add.vue

@@ -126,6 +126,7 @@
                 @change="changeCustomerFn($event, scope.$index)"
                 v-model="scope.row.customerId"
                 placeholder="请选择"
+                filterable
               >
                 <el-option
                   v-for="(item, i) in customerList"
@@ -178,7 +179,11 @@
             show-overflow-tooltip
           >
             <template slot-scope="scope">
-              <el-select v-model="scope.row.walletId" placeholder="请选择">
+              <el-select
+                filterable
+                v-model="scope.row.walletId"
+                placeholder="请选择"
+              >
                 <el-option
                   v-for="item in scope.row.walletList"
                   :key="item.customerWalletId"

+ 1 - 0
src/views/finance/receivable_list.vue

@@ -24,6 +24,7 @@
                   v-model="searchForm.source"
                   class="selectStyle"
                   placeholder="请选择"
+                  filterable
                 >
                   <el-option value="工程押金"> </el-option>
                   <el-option value="保证金"> </el-option>

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

@@ -139,6 +139,9 @@
                 </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="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
+                <el-popconfirm style="margin-left: 10px;" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.parentId)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
+                  <el-button slot="reference" type="text">弃审</el-button>
+                </el-popconfirm>
                 <el-button type="text" @click="toReturn(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles)">退订</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
                 <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" v-if="$checkBtnRole('del', $route.meta.roles)">
@@ -175,7 +178,7 @@
 </template>
 
 <script>
-import { getOrderList, applyCom, withdrawCom, deleteCom, editDateCom } from "@/api/supply/engin";
+import { getOrderList, applyCom, withdrawCom, deleteCom, editDateCom, abandonCom } from "@/api/supply/engin";
 import CommerceDetail from "@/views/supply/engin/components/commerce_detail";
 import CommerceForm from "@/views/supply/engin/components/commerce_form";
 import CommerceExamine from "@/views/supply/engin/components/commerce_examine";
@@ -382,6 +385,14 @@ export default {
       })
     },
 
+    // 弃审
+    handleAbandon(id) {
+      abandonCom({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+
     // 删除
     handleDelete(id) {
       deleteCom({ids: id}).then(res => {

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

@@ -158,11 +158,15 @@
         <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
         <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="price" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.price" size="small" type="number"></el-input>
+          </template>
+        </el-table-column>
         <el-table-column align="center" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
-            <el-input v-model="scope.row.qty" size="small"></el-input>
+            <el-input v-model="scope.row.qty" size="small" type="number"></el-input>
           </template>
         </el-table-column>
         <el-table-column align="center" label="订单金额" min-width="100" show-overflow-tooltip>

+ 12 - 1
src/views/supply/engin/home_list.vue

@@ -139,6 +139,9 @@
                 </el-popconfirm>
                 <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-popconfirm style="margin-left: 10px;" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.parentId)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
+                  <el-button slot="reference" type="text">弃审</el-button>
+                </el-popconfirm>
                 <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>
                 <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" v-if="$checkBtnRole('del', $route.meta.roles)">
@@ -175,7 +178,7 @@
 </template>
 
 <script>
-import { getOrderList, applyHome, withdrawHome, deleteHome, editDateHome } from "@/api/supply/engin";
+import { getOrderList, applyHome, withdrawHome, deleteHome, editDateHome, abandonHome } from "@/api/supply/engin";
 import HomeDetail from "@/views/supply/engin/components/home_detail";
 import HomeForm from "@/views/supply/engin/components/home_form";
 import HomeExamine from "@/views/supply/engin/components/home_examine";
@@ -376,6 +379,14 @@ export default {
       })
     },
 
+    // 弃审
+    handleAbandon(id) {
+      abandonHome({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+
     // 删除
     handleDelete(id) {
       deleteHome({ids: id}).then(res => {