Bladeren bron

11月14日 库存扣减更新

XMLWAN 3 jaren geleden
bovenliggende
commit
8c303bda75

+ 1 - 0
src/api/supply.js Bestand weergeven

9
 }
9
 }
10
 
10
 
11
 export function savePurchaseOrder(data, supplier_name, start_time, end_time, rate_of_concession, discount_amount) {
11
 export function savePurchaseOrder(data, supplier_name, start_time, end_time, rate_of_concession, discount_amount) {
12
+  console.log('data32323323232', data)
12
   return request({
13
   return request({
13
     url: '/api/supply/savepurchaseorder?supplier_name=' + supplier_name + '&start_time=' + start_time + '&end_time=' + end_time + '&rate_of_concession=' + rate_of_concession + '&discount_amount=' + discount_amount,
14
     url: '/api/supply/savepurchaseorder?supplier_name=' + supplier_name + '&start_time=' + start_time + '&end_time=' + end_time + '&rate_of_concession=' + rate_of_concession + '&discount_amount=' + discount_amount,
14
     method: 'post',
15
     method: 'post',

+ 4 - 1
src/router/modules/supply.js Bestand weergeven

37
       path: '/purchase/order/add',
37
       path: '/purchase/order/add',
38
       component: () => import('@/xt_pages/supply/components/addPurchaseOrder'),
38
       component: () => import('@/xt_pages/supply/components/addPurchaseOrder'),
39
       name: 'addPurchaseOrder',
39
       name: 'addPurchaseOrder',
40
-      meta: { title: 'addPurchaseOrder', noCache: true }
40
+      meta: { title: 'addPurchaseOrder', noCache: true },
41
+      hidden: true,
42
+      is_menu: false,
43
+      isChild: true
41
     }
44
     }
42
   ]
45
   ]
43
 }
46
 }

+ 1 - 1
src/xt_pages/hospitalStation/summary.vue Bestand weergeven

566
         }
566
         }
567
       },
567
       },
568
       toPrint(row) {
568
       toPrint(row) {
569
-        if (this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10028 || (scope.row.order_status == 2 && $store.getters.xt_user.org_id == 10138)) {
569
+        if (this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10028 || (scope.row.order_status == 2 && $store.getters.xt_user.org_id == 10138) || (scope.row.order_status == 2 && $store.getters.xt_user.org_id == 10278)) {
570
           this.statementVisible9504 = true
570
           this.statementVisible9504 = true
571
           let obj = {
571
           let obj = {
572
             order_id: row.id,
572
             order_id: row.id,

+ 6 - 1
src/xt_pages/outpatientDoctorStation/prescriptionTemplatedetail.vue Bestand weergeven

129
                                                 <template slot-scope="scope">{{ scope.row.drug_name }}</template>
129
                                                 <template slot-scope="scope">{{ scope.row.drug_name }}</template>
130
                                             </el-table-column>
130
                                             </el-table-column>
131
                                             <el-table-column label="规格" width="60">
131
                                             <el-table-column label="规格" width="60">
132
-                                                <template slot-scope="scope">{{ scope.row.drug_spec }}</template>
132
+                                                <template slot-scope="scope">
133
+                                                  <!-- {{ scope.row.drug_spec }} -->
134
+                                                   <span
135
+                                                       v-if="scope.row.min_unit != scope.row.dose_unit">{{ scope.row.dose }}{{ scope.row.dose_unit }}&nbsp;* &nbsp;</span>
136
+                                                       {{ scope.row.min_number }}{{ scope.row.min_unit }}/{{ scope.row.max_unit }}
137
+                                                  </template>
133
                                             </el-table-column>
138
                                             </el-table-column>
134
                                             <el-table-column label="单价" width="40">
139
                                             <el-table-column label="单价" width="40">
135
                                                 <template slot-scope="scope">{{ scope.row.retail_price }}</template>
140
                                                 <template slot-scope="scope">{{ scope.row.retail_price }}</template>

+ 109 - 51
src/xt_pages/supply/components/addPurchaseOrder.vue Bestand weergeven

6
 <div class="app-container ">
6
 <div class="app-container ">
7
     <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
7
     <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
8
     <div>
8
     <div>
9
-        <span>供应商:</span>
9
+        <span style="color:red">*</span><span>供应商:</span>
10
         <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择"
10
         <el-select v-model="supplier_name" style="width:140px;margin-right:10px;" placeholder="请选择"
11
         @change="changeTypeName">
11
         @change="changeTypeName">
12
         <el-option
12
         <el-option
48
    
48
    
49
     </div>
49
     </div>
50
     <div>
50
     <div>
51
-        <el-button size="small" type="primary" @click="savePurchaseOrder">保存</el-button>
51
+        <el-button size="small" type="primary" @click="savePurchaseOrder" v-show="showTwo">保存</el-button>
52
+        <el-button size="small" type="primary" @click="updatePurchaseOrder" v-show="showOne">修改</el-button>
52
     </div>
53
     </div>
53
     </div>
54
     </div>
54
 
55
 
55
-
56
+   <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
56
     <el-table
57
     <el-table
57
     :row-style="{ color: '#303133' }"
58
     :row-style="{ color: '#303133' }"
58
     :header-cell-style="{
59
     :header-cell-style="{
59
         backgroundColor: 'rgb(245, 247, 250)',
60
         backgroundColor: 'rgb(245, 247, 250)',
60
         color: '#606266'
61
         color: '#606266'
61
     }"
62
     }"
62
-    :data="tableList"
63
+    :data="recordInfo.tableList"
63
     :class="signAndWeighBoxPatients"
64
     :class="signAndWeighBoxPatients"
64
     border
65
     border
65
     style="width: 100%"
66
     style="width: 100%"
66
     max-height="450"
67
     max-height="450"
67
     >
68
     >
68
-    <el-table-column label="商品" align="center" width="200px">
69
+    <el-table-column align="center" width="200px">
70
+        <template slot="header" slot-scope="scope">
71
+            <span>商品<span style="color: red">*</span></span>
72
+        </template>
69
         <template slot-scope="scope">
73
         <template slot-scope="scope">
74
+           <el-form-item required prop="name"> 
70
             <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)">
75
             <el-select v-model="scope.row.name" style="width:160px;" filterable placeholder="请选择" @change="changeName"   @input="changeGoodName(scope.$index)">
71
-            <el-option
72
-                v-for="(item,index) in tabList"
73
-                :key="index"
74
-                :label="item.supply_name"
75
-                :value="item">
76
-            </el-option>
77
-            </el-select>
76
+                <el-option
77
+                    v-for="(item,index) in tabList"
78
+                    :key="index"
79
+                    :label="item.supply_name"
80
+                    :value="item">
81
+                </el-option>
82
+             </el-select>
83
+           </el-form-item> 
78
         </template>
84
         </template>
79
     </el-table-column>
85
     </el-table-column>
80
-    <el-table-column label="商品类别" align="center" width="150px">
86
+    <el-table-column  align="center" width="150px">
87
+        <template slot="header" slot-scope="scope">
88
+            <span>商品类别</span>
89
+        </template>
81
         <template slot-scope="scope">
90
         <template slot-scope="scope">
82
             <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
91
             <el-input v-model="scope.row.supply_type" style="width:120px" :disabled="true"></el-input>
83
         </template>
92
         </template>
93
         </template>
102
         </template>
94
     </el-table-column>
103
     </el-table-column>
95
     <el-table-column label="数量" align="center" width="120px">
104
     <el-table-column label="数量" align="center" width="120px">
105
+        <template slot="header" slot-scope="scope">
106
+            <span>数量<span style="color: red">*</span></span>
107
+        </template>
96
         <template slot-scope="scope">
108
         <template slot-scope="scope">
97
-        <el-input v-model="scope.row.supply_count" style="width:80px"></el-input>
109
+          <el-form-item :rules="tableRules.supply_count" required prop="supply_count">
110
+          <el-input v-model="scope.row.supply_count" style="width:80px"></el-input>
111
+          </el-form-item>  
98
         </template>
112
         </template>
99
     </el-table-column>
113
     </el-table-column>
100
 
114
 
151
         </template>
165
         </template>
152
     </el-table-column>
166
     </el-table-column>
153
   </el-table>
167
   </el-table>
168
+</el-form>
154
    <div style="margin-top:10px">
169
    <div style="margin-top:10px">
155
         <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
170
         <span>优惠率:<el-input style="width:100px" v-model="rate_of_concession"></el-input>%</span>
156
         
171
         
164
 <script>
179
 <script>
165
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
180
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
166
 
181
 
167
-import {getInitOrder} from "@/api/supply"
182
+import {getInitOrder,savePurchaseOrder} from "@/api/supply"
168
 export default {
183
 export default {
169
 name: "addPurchaseOrder",
184
 name: "addPurchaseOrder",
170
 created() {
185
 created() {
188
 data() {
203
 data() {
189
 return {
204
 return {
190
     crumbs: [
205
     crumbs: [
191
-    { path: false, name: "购货订单" },
192
-    { path: "/spply/query", name: "新增购货订单" }
206
+       { path: false, name: "购货订单" },
207
+       { path: "/spply/query", name: "新增购货订单" }
193
     ],
208
     ],
209
+    showTwo:true,
210
+    showOne:false,
211
+    recordInfo: {
212
+      tableList:[],  
213
+    },
194
     keywords: "",
214
     keywords: "",
195
     total: 0,
215
     total: 0,
196
     multipleSelection: [],
216
     multipleSelection: [],
203
     goodInfo: [],
223
     goodInfo: [],
204
     org_id:0,
224
     org_id:0,
205
     types:[],
225
     types:[],
206
-    tableList:[],
207
     tyep_name:"",
226
     tyep_name:"",
208
     form:{
227
     form:{
209
     manufacturer_id:"",
228
     manufacturer_id:"",
217
     supplyList:[],
236
     supplyList:[],
218
     rate_of_concession:"",
237
     rate_of_concession:"",
219
     discount_amount:"",
238
     discount_amount:"",
239
+    start_time:new Date(),
240
+    end_time:new Date(),
241
+    tableRules: {
242
+     name: [{ required: true, message: '商品不能为空', trigger: 'blur' }],
243
+     supply_count: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
244
+ },
220
 };
245
 };
221
 },
246
 },
222
 methods:{
247
 methods:{
248
+
223
 getInitOrder(){
249
 getInitOrder(){
224
     getInitOrder().then(response=>{
250
     getInitOrder().then(response=>{
225
     if(response.data.state == 1){
251
     if(response.data.state == 1){
293
 },
319
 },
294
 changeName(val){
320
 changeName(val){
295
     
321
     
296
-   for(let i=0;i<this.tableList.length;i++){
322
+   for(let i=0;i<this.recordInfo.tableList.length;i++){
297
     if(this.currentIndex == i){
323
     if(this.currentIndex == i){
298
-        this.tableList[i].id = val.id
299
-        this.tableList[i].type = val.type
300
-        this.tableList[i].name = val.name
301
-        this.tableList[i].supply_name = val.supply_name
302
-        this.tableList[i].supply_type = val.supply_type
303
-        this.tableList[i].supply_specification_name = val.supply_specification_name
304
-        this.tableList[i].supply_total = val.supply_total
305
-        this.tableList[i].supply_count = val.supply_count
306
-        this.tableList[i].supply_price = val.supply_price
307
-        this.tableList[i].supply_total_price = val.supply_total_price
308
-        this.tableList[i].supply_manufacturer = val.supply_manufacturer
309
-        this.tableList[i].supply_license_number = val.supply_license_number
310
-        this.tableList[i].supply_remake = val.supply_remake
324
+        this.recordInfo.tableList[i].id = val.id
325
+        this.recordInfo.tableList[i].type = val.type
326
+        this.recordInfo.tableList[i].name = val.name
327
+        this.recordInfo.tableList[i].supply_name = val.supply_name
328
+        this.recordInfo.tableList[i].supply_type = val.supply_type
329
+        this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name
330
+        this.recordInfo.tableList[i].supply_total = val.supply_total
331
+        if(val.supply_count == NaN){
332
+           this.recordInfo.tableList[i].supply_count = ""
333
+        }else{
334
+          this.recordInfo.tableList[i].supply_count = val.supply_count?val.supply_count:""
335
+        }
336
+       
337
+        this.recordInfo.tableList[i].supply_price = val.supply_price?val.supply_price:""
338
+        this.recordInfo.tableList[i].supply_total_price = val.supply_total_price?val.supply_total_price:""
339
+        this.recordInfo.tableList[i].supply_manufacturer = val.supply_manufacturer
340
+        this.recordInfo.tableList[i].supply_license_number = val.supply_license_number
341
+        this.recordInfo.tableList[i].supply_remake = val.supply_remake
311
      }
342
      }
312
     }
343
     }
313
     
344
     
319
     tempObj['supply_name'] = ""
350
     tempObj['supply_name'] = ""
320
     tempObj['supply_type'] = ""
351
     tempObj['supply_type'] = ""
321
     tempObj['supply_specification_name'] = ''
352
     tempObj['supply_specification_name'] = ''
322
-    tempObj['supply_total'] = ''
323
-    tempObj['supply_count'] = ''
324
-    tempObj['supply_price'] = ''
325
-    tempObj['supply_total_price'] = ''
353
+    tempObj['supply_total'] = ""
354
+    tempObj['supply_count'] = ""
355
+    tempObj['supply_price'] = ""
356
+    tempObj['supply_total_price'] = ""
326
     tempObj['supply_manufacturer'] = ''
357
     tempObj['supply_manufacturer'] = ''
327
     tempObj['supply_license_number'] = ''
358
     tempObj['supply_license_number'] = ''
328
     tempObj['supply_remake'] = ''
359
     tempObj['supply_remake'] = ''
329
     tempObj['type'] = 0
360
     tempObj['type'] = 0
330
-    this.tableList.push(tempObj)  
361
+    this.recordInfo.tableList.push(tempObj)  
331
 },
362
 },
332
 handleDelete: function(index, row) {
363
 handleDelete: function(index, row) {
333
-  if (this.tableList.length <= 1) {
364
+  if (this.recordInfo.tableList.length <= 1) {
334
         this.$message.error('只有一条记录的时候无法删除')
365
         this.$message.error('只有一条记录的时候无法删除')
335
         return
366
         return
336
    } else {
367
    } else {
337
-        this.tableList.splice(index, 1)
368
+        this.recordInfo.tableList.splice(index, 1)
338
    }
369
    }
339
 },
370
 },
371
+
372
+
340
 savePurchaseOrder(){
373
 savePurchaseOrder(){
341
-     
342
-     var params = {
374
+   console.log("tablelsit323232",this.recordInfo.tableList)
375
+   console.log("hhh232323",this.$refs)
376
+    this.$refs["tableForm"].validate((valid)=>{
377
+      if(valid){
378
+        var params = {
343
         supplier_name:this.supplier_name,
379
         supplier_name:this.supplier_name,
344
         start_time:this.start_time,
380
         start_time:this.start_time,
345
         end_time:this.end_time,
381
         end_time:this.end_time,
346
         rate_of_concession:this.rate_of_concession,
382
         rate_of_concession:this.rate_of_concession,
347
         discount_amount:this.discount_amount,
383
         discount_amount:this.discount_amount,
348
-     }
349
-    console.log("partam2332232332",params)
350
-    console.log("tablelsit323232",this.tabList)
351
-    savePurchaseOrder(this.tabList,this.supplier_name,this.start_time,this.end_time,this.rate_of_concession,this.discount_amount).then(response=>{
384
+        }
385
+        console.log("partam2332232332",params)
386
+        console.log("tablelsit323232",this.recordInfo.tableList)
387
+        for(let i=0;i<this.recordInfo.tableList.length;i++){
388
+            this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count) 
389
+            for(let j=0;j<this.manufactuerList.length;j++){
390
+                if(this.recordInfo.tableList[i].supply_manufacturer == this.manufactuerList[j].manufacturer_name){
391
+                this.recordInfo.tableList[i].manufacturer_id = this.manufactuerList[j].id 
392
+                }
352
 
393
 
353
-    })  
394
+            } 
395
+        }
396
+        return
397
+        savePurchaseOrder(this.recordInfo.tableList,this.supplier_name,this.start_time,this.end_time,this.rate_of_concession,this.discount_amount).then(response=>{
398
+            if(response.data.state == 1){
399
+                var order =  response.data.data.order
400
+                this.$message.success("保存成功!")
401
+                this.showTwo = false
402
+                this.showOne = true
403
+            }
404
+        }) 
405
+      }  
406
+
407
+   })  
408
+   
354
 },
409
 },
355
 
410
 
356
 changeTypeName(){
411
 changeTypeName(){
408
     }
463
     }
409
     return Math.round(parseFloat(val) * 100) / 100;
464
     return Math.round(parseFloat(val) * 100) / 100;
410
   },
465
   },
466
+ updatePurchaseOrder(){
467
+
468
+ }
411
 },
469
 },
412
 created(){
470
 created(){
413
     const tempObj = {}
471
     const tempObj = {}
416
     tempObj['supply_name'] = ""
474
     tempObj['supply_name'] = ""
417
     tempObj['supply_type'] = ""
475
     tempObj['supply_type'] = ""
418
     tempObj['supply_specification_name'] = ''
476
     tempObj['supply_specification_name'] = ''
419
-    tempObj['supply_total'] = ''
420
-    tempObj['supply_count'] = ''
421
-    tempObj['supply_price'] = ''
422
-    tempObj['supply_total_price'] = ''
477
+    tempObj['supply_total'] = ""
478
+    tempObj['supply_count'] = ""
479
+    tempObj['supply_price'] = ""
480
+    tempObj['supply_total_price'] = ""
423
     tempObj['supply_manufacturer'] = ''
481
     tempObj['supply_manufacturer'] = ''
424
     tempObj['supply_license_number'] = ''
482
     tempObj['supply_license_number'] = ''
425
     tempObj['supply_remake'] = ''
483
     tempObj['supply_remake'] = ''
426
     tempObj['type'] = 0
484
     tempObj['type'] = 0
427
-    this.tableList.push(tempObj)  
485
+    this.recordInfo.tableList.push(tempObj)  
428
     this.getInitOrder()  
486
     this.getInitOrder()  
429
 }
487
 }
430
 };
488
 };

+ 22 - 6
src/xt_pages/supply/purchaseOrderQuery.vue Bestand weergeven

161
       >
161
       >
162
       </el-pagination>
162
       </el-pagination>
163
 
163
 
164
-       <add-supply ref="addSupply"></add-supply>
165
     </div>
164
     </div>
166
   </div>
165
   </div>
167
 </template>
166
 </template>
168
 
167
 
169
 <script>
168
 <script>
170
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
169
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
171
-import addSupply from "./components/addSupply.vue"
170
+
172
 
171
 
173
 export default {
172
 export default {
174
   name: "stockIn",
173
   name: "stockIn",
175
    components: {
174
    components: {
176
-     addSupply
175
+     
177
    },
176
    },
178
   created() {
177
   created() {
179
     this.org_id =  this.$store.getters.xt_user.org_id
178
     this.org_id =  this.$store.getters.xt_user.org_id
212
       org_id:0,
211
       org_id:0,
213
       types:[],
212
       types:[],
214
       tableList:[],
213
       tableList:[],
215
-      tyep_name:"",
214
+      type_name:"",
216
     };
215
     };
217
   },
216
   },
218
   methods:{
217
   methods:{
219
      toAdd(){
218
      toAdd(){
220
-       console.log("res32323232323223",this.$refs)  
221
-       this.$refs.addSupply.show()  
219
+       this.$router.push({path:"/purchase/order/add"})
220
+     },
221
+     changeTypeName(){
222
+
223
+     },
224
+     startTimeChange(){
225
+
226
+     },
227
+     endTimeChange(){
228
+
229
+     },
230
+     search(){
231
+
232
+     },
233
+     handleSizeChange(){
234
+
235
+     },
236
+     handleCurrentChange(){
237
+
222
      } 
238
      } 
223
   }
239
   }
224
 };
240
 };