Browse Source

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

yq1 10 months ago
parent
commit
8762681b1b

+ 10 - 1
src/api/pharmacy.js View File

146
     method:"get",
146
     method:"get",
147
     params:params,
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 View File

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

+ 44 - 5
src/xt_pages/stock/historyInventory.vue View File

119
                  {{scope.row.stock_count}}
119
                  {{scope.row.stock_count}}
120
               </template>
120
               </template>
121
             </el-table-column>
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
             <el-table-column label="盘点后数量"  align="center">
134
             <el-table-column label="盘点后数量"  align="center">
123
               <template slot-scope="scope">
135
               <template slot-scope="scope">
124
                 <el-input style="width:80px" v-model="scope.row.last_stock_count" type="number"></el-input>
136
                 <el-input style="width:80px" v-model="scope.row.last_stock_count" type="number"></el-input>
197
         goodList:[],
209
         goodList:[],
198
         manufacturerList:[],
210
         manufacturerList:[],
199
         user_name:this.$store.getters.xt_user.user.user_name,
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
     watch: {},
224
     watch: {},
245
      handleCurrentChange(val){
266
      handleCurrentChange(val){
246
        getGoodInventoryByGoodId(val.id).then(response=>{
267
        getGoodInventoryByGoodId(val.id).then(response=>{
247
           if(response.data.state ==1){
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
      UpdateWarehouseInfo(row){
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
          this.$message.error("该批次盘点后数量不能大于或等于入库数量!")
290
          this.$message.error("该批次盘点后数量不能大于或等于入库数量!")
256
          return false
291
          return false
257
        }
292
        }
260
             stock_count:parseInt(row.stock_count),
295
             stock_count:parseInt(row.stock_count),
261
             last_stock_count:parseInt(row.last_stock_count),
296
             last_stock_count:parseInt(row.last_stock_count),
262
             good_id:row.good_id,
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
        updateInventoryWarehouseInfo(params).then(response=>{
302
        updateInventoryWarehouseInfo(params).then(response=>{
266
           if(response.data.state ==1){
303
           if(response.data.state ==1){
267
             var msg = response.data.data.msg
304
             var msg = response.data.data.msg
268
             this.$message.success("保存成功!")
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 View File

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