Selaa lähdekoodia

Merge remote-tracking branch 'origin/20230223_pc_vue_new_branch' into 20230223_pc_vue_new_branch

yq1 10 kuukautta sitten
vanhempi
commit
8762681b1b

+ 10 - 1
src/api/pharmacy.js Näytä tiedosto

@@ -146,4 +146,13 @@ export function updateInventoryWarehouseInfo(params){
146 146
     method:"get",
147 147
     params:params,
148 148
   })
149
-} 
149
+} 
150
+
151
+export function getDrugInventoryList(params){
152
+
153
+  return request({
154
+    url:"/api/pharmacy/getdruginventoryList",
155
+    method:"Get",
156
+    params:params,
157
+  })
158
+}

+ 8 - 2
src/xt_pages/stock/drugs/drugInventory.vue Näytä tiedosto

@@ -12,9 +12,10 @@
12 12
         style="height: 100%; display: flex; flex-direction: column"
13 13
         @tab-click="handleClick"
14 14
       >
15
-       <el-tab-pane label="药品盘点(模式一)" name="first">
15
+         <el-tab-pane label="药品盘点(模式一)" name="first">
16 16
           <drug-inventory></drug-inventory>
17
-        </el-tab-pane>
17
+           <!-- <historyDrugInvetory ref="childFirst"></historyDrugInvetory> -->
18
+         </el-tab-pane>
18 19
          <el-tab-pane label="药品盘点(模式二)" name="four">
19 20
           <drug-new-inventory ref="childFour"></drug-new-inventory>
20 21
         </el-tab-pane>
@@ -36,6 +37,7 @@ import drugInventory from "./inventory";
36 37
 import drugNewInventory from "./newDrugInventory"
37 38
 import inventoryDetails from "./inventoryDetails";
38 39
 import drugDamaged from "./drugDamaged.vue";
40
+import historyDrugInvetory from "./historyDrugInvetory";
39 41
 export default {
40 42
   name: "stockModifyPrice",
41 43
   components: {
@@ -44,6 +46,7 @@ export default {
44 46
     inventoryDetails,
45 47
     drugDamaged,
46 48
     drugNewInventory,
49
+    historyDrugInvetory,
47 50
   },
48 51
   data() {
49 52
     return {
@@ -60,6 +63,9 @@ export default {
60 63
   },
61 64
   methods: {
62 65
     handleClick() {
66
+      if (this.activeName == "first") {
67
+        this.$refs.childFirst.getDrugInventoryList();
68
+      }
63 69
      if (this.activeName == "four") {
64 70
         this.$refs.childFour.getlist();
65 71
       }

+ 44 - 5
src/xt_pages/stock/historyInventory.vue Näytä tiedosto

@@ -119,6 +119,18 @@
119 119
                  {{scope.row.stock_count}}
120 120
               </template>
121 121
             </el-table-column>
122
+            <el-table-column prop="name" label="盘点原因" width="180"  align="center">
123
+                <template slot-scope="scope">
124
+                   <el-select v-model="scope.row.type" placeholder="请选择">
125
+                      <el-option
126
+                        v-for="item in reasonList"
127
+                        :key="item.id"
128
+                        :label="item.name"
129
+                        :value="item.id">
130
+                      </el-option>
131
+                    </el-select>
132
+                 </template> 
133
+              </el-table-column>
122 134
             <el-table-column label="盘点后数量"  align="center">
123 135
               <template slot-scope="scope">
124 136
                 <el-input style="width:80px" v-model="scope.row.last_stock_count" type="number"></el-input>
@@ -197,7 +209,16 @@
197 209
         goodList:[],
198 210
         manufacturerList:[],
199 211
         user_name:this.$store.getters.xt_user.user.user_name,
200
-        infoList:[]
212
+        infoList:[],
213
+        reasonList:[
214
+          {id:6,name:"默认"},
215
+          {id:1,name:"到期退货"},
216
+          {id:2,name:"异常退货"},
217
+          {id:3,name:"退货"},
218
+          {id:4,name:"损坏"},
219
+          {id:5,name:"不计入报损分析"},
220
+          {id:7,name:"有效期到期"},
221
+         ],
201 222
       };
202 223
     },
203 224
     watch: {},
@@ -245,13 +266,27 @@
245 266
      handleCurrentChange(val){
246 267
        getGoodInventoryByGoodId(val.id).then(response=>{
247 268
           if(response.data.state ==1){
248
-             var obj = {}
249
-             this.infoList = response.data.data.infoList
269
+             
270
+             this.infoList = []
271
+             var infoList = response.data.data.infoList
272
+             for(let i=0;i<infoList.length;i++){
273
+               infoList[i].type = 6
274
+               infoList[i].last_stock_count = infoList[i].stock_count
275
+               this.infoList.push(infoList[i])
276
+             }
277
+            
278
+             console.log("infoList====================",this.infoList)
279
+            
280
+
250 281
           }
251 282
        })
252 283
      },
253 284
      UpdateWarehouseInfo(row){
254
-       if(parseInt(row.last_stock_count) >=parseInt(row.stock_count)){
285
+       if(parseInt(row.last_stock_count)<0){
286
+        this.$message.error("盘点后数量不能为负数!")
287
+        return false
288
+       }
289
+       if(parseInt(row.last_stock_count) >=parseInt(row.warehousing_count)){
255 290
          this.$message.error("该批次盘点后数量不能大于或等于入库数量!")
256 291
          return false
257 292
        }
@@ -260,12 +295,16 @@
260 295
             stock_count:parseInt(row.stock_count),
261 296
             last_stock_count:parseInt(row.last_stock_count),
262 297
             good_id:row.good_id,
263
-            storehouse_id:parseInt(val.storehouse_id), 
298
+            storehouse_id:parseInt(row.storehouse_id), 
299
+            is_type:parseInt(row.type)
264 300
         }
301
+        console.log("params22222222222222",params)
265 302
        updateInventoryWarehouseInfo(params).then(response=>{
266 303
           if(response.data.state ==1){
267 304
             var msg = response.data.data.msg
268 305
             this.$message.success("保存成功!")
306
+            row.id =row.good_id
307
+            this.handleCurrentChange(row)
269 308
           }
270 309
        })
271 310
      }

+ 9 - 7
src/xt_pages/stock/stockInventory.vue Näytä tiedosto

@@ -5,15 +5,16 @@
5 5
     </div>
6 6
     <div class="app-container">
7 7
         <el-tabs v-model="activeName" @tab-click="handleClick">
8
-            <el-tab-pane label="耗材盘点(模式一)" name="first">
8
+            <!-- <el-tab-pane label="耗材盘点(模式一)" name="first">
9 9
                 <inventory></inventory>
10
+            </el-tab-pane> -->
11
+            <el-tab-pane label="耗材盘点(模式一)" name="first">
12
+                <history-inventory ref="childFive"></history-inventory>
10 13
             </el-tab-pane>
11 14
             <el-tab-pane label="耗材盘点(模式二)" name="four">
12 15
                 <new-inventory ref="childFour"></new-inventory>
13 16
             </el-tab-pane>
14
-            <!-- <el-tab-pane label="耗材盘点(模式三)" name="five">
15
-                <history-inventory ref="childFive"></history-inventory>
16
-            </el-tab-pane> -->
17
+          
17 18
             <el-tab-pane label="盘点列表" name="second">
18 19
                 <inventory-details ref="child"></inventory-details>
19 20
             </el-tab-pane>
@@ -57,6 +58,9 @@ export default {
57 58
     },
58 59
     methods:{
59 60
       handleClick(){
61
+      if(this.activeName == "first"){
62
+        this.$refs.childFive.getGoodInventoryList()
63
+      }
60 64
        if(this.activeName == "four"){
61 65
          this.$refs.childFour.open()
62 66
         }
@@ -66,9 +70,7 @@ export default {
66 70
         if(this.activeName =="three"){
67 71
           this.$refs.childOne.getlist()
68 72
         }
69
-        if(this.activeName == "five"){
70
-          this.$refs.childFive.getGoodInventoryList()
71
-        }
73
+       
72 74
       }
73 75
     },
74 76
     created(){