|
@@ -23,14 +23,14 @@
|
23
|
23
|
>
|
24
|
24
|
<el-date-picker
|
25
|
25
|
size="small"
|
26
|
|
- v-model="value1"
|
|
26
|
+ v-model="start_time"
|
27
|
27
|
type="date"
|
28
|
28
|
style="margin-left:5px;width:140px;"
|
29
|
29
|
placeholder="选择日期">
|
30
|
30
|
</el-date-picker>
|
31
|
31
|
<el-date-picker
|
32
|
32
|
size="small"
|
33
|
|
- v-model="value2"
|
|
33
|
+ v-model="end_time"
|
34
|
34
|
type="date"
|
35
|
35
|
style="margin-left:5px;width:140px;"
|
36
|
36
|
placeholder="选择日期">
|
|
@@ -89,117 +89,132 @@
|
89
|
89
|
</el-pagination>
|
90
|
90
|
</div>
|
91
|
91
|
<el-dialog
|
92
|
|
- title="库房调价"
|
|
92
|
+ title="耗材报损"
|
93
|
93
|
:visible.sync="dialogVisible"
|
94
|
94
|
width="1200px"
|
95
|
|
- :before-close="handleClose">
|
|
95
|
+ >
|
96
|
96
|
<el-form :model="form" class="modifyDialog" label-width="120px">
|
97
|
97
|
<el-form-item label="耗材ID">
|
98
|
|
- <el-input v-model="form.name"></el-input>
|
|
98
|
+ <el-input v-model="form.good_id"></el-input>
|
99
|
99
|
</el-form-item>
|
100
|
|
- <el-form-item label="药品名称">
|
101
|
|
- <el-input v-model="form.name"></el-input>
|
|
100
|
+ <el-form-item label="耗材名称">
|
|
101
|
+ <el-autocomplete
|
|
102
|
+ class="checkSearch"
|
|
103
|
+ popper-class="my-autocomplete"
|
|
104
|
+ v-model="form.good_name"
|
|
105
|
+ :fetch-suggestions="querySearchAsync"
|
|
106
|
+ :trigger-on-focus="true"
|
|
107
|
+ placeholder="请输入耗材名称"
|
|
108
|
+ @select="handleSelect"
|
|
109
|
+ @input="changeGoodName(scope.$index)"
|
|
110
|
+ style="width:160px;"
|
|
111
|
+ >
|
|
112
|
+ <i class="el-icon-search el-input__icon" slot="suffix"></i>
|
|
113
|
+ <template slot-scope="{ item }">
|
|
114
|
+ <div class="name">{{ item.good_name +" " +item.specification_name + " "+item.manufacturer }}</div>
|
|
115
|
+ </template>
|
|
116
|
+ </el-autocomplete>
|
102
|
117
|
</el-form-item>
|
103
|
118
|
<el-form-item label="规格">
|
104
|
|
- <el-input v-model="form.name"></el-input>
|
|
119
|
+ <el-input v-model="form.specification_name"></el-input>
|
105
|
120
|
</el-form-item>
|
106
|
121
|
<el-form-item label="单位">
|
107
|
|
- <el-input v-model="form.name"></el-input>
|
|
122
|
+ <el-input v-model="form.warehousing_unit"></el-input>
|
108
|
123
|
</el-form-item>
|
109
|
124
|
<el-form-item label="进货价">
|
110
|
|
- <el-input v-model="form.name"></el-input>
|
|
125
|
+ <el-input v-model="form.buy_price"></el-input>
|
111
|
126
|
</el-form-item>
|
112
|
127
|
<el-form-item label="零售价">
|
113
|
|
- <el-input v-model="form.name"></el-input>
|
|
128
|
+ <el-input v-model="form.packing_price"></el-input>
|
|
129
|
+ </el-form-item>
|
|
130
|
+ <el-form-item label="新零售价">
|
|
131
|
+ <el-input v-model="form.new_price"></el-input>
|
114
|
132
|
</el-form-item>
|
115
|
133
|
<el-form-item label="报损数量">
|
116
|
|
- <el-input v-model="form.name"></el-input>
|
|
134
|
+ <el-input v-model="form.count"></el-input>
|
117
|
135
|
</el-form-item>
|
118
|
136
|
<el-form-item label="库存">
|
119
|
|
- <el-input v-model="form.name"></el-input>
|
|
137
|
+ <el-input v-model="form.total"></el-input>
|
120
|
138
|
</el-form-item>
|
121
|
139
|
<el-form-item label="产地">
|
122
|
|
- <el-input v-model="form.name"></el-input>
|
|
140
|
+ <el-input v-model="form.good_origin_place"></el-input>
|
123
|
141
|
</el-form-item>
|
124
|
142
|
<el-form-item label="批准文号">
|
125
|
|
- <el-input v-model="form.name"></el-input>
|
|
143
|
+ <el-input v-model="form.license_number"></el-input>
|
126
|
144
|
</el-form-item>
|
127
|
145
|
<el-form-item label="生产厂商">
|
128
|
|
- <el-input v-model="form.name"></el-input>
|
|
146
|
+ <el-input v-model="form.manufacturer"></el-input>
|
129
|
147
|
</el-form-item>
|
130
|
148
|
<el-form-item label="备注">
|
131
|
149
|
<div style="display:flex;">
|
132
|
|
- <el-input v-model="form.name"></el-input>
|
133
|
|
- <el-button style="margin-left:5px;" type="primary">添加</el-button>
|
|
150
|
+ <el-input v-model="form.remark"></el-input>
|
|
151
|
+ <el-button style="margin-left:5px;" type="primary" @click="addStock">添加</el-button>
|
134
|
152
|
</div>
|
135
|
153
|
</el-form-item>
|
136
|
154
|
</el-form>
|
137
|
155
|
<el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
|
138
|
|
- <el-table-column
|
139
|
|
- prop="date"
|
140
|
|
- label="耗材ID"
|
141
|
|
- width="100">
|
|
156
|
+ <el-table-column prop="date" label="耗材ID" width="100">
|
|
157
|
+ <template slot-scope="scope">
|
|
158
|
+ {{scope.row.good_id}}
|
|
159
|
+ </template>
|
142
|
160
|
</el-table-column>
|
143
|
|
- <el-table-column
|
144
|
|
- prop="date"
|
145
|
|
- label="耗材名称"
|
146
|
|
- width="100">
|
|
161
|
+ <el-table-column prop="date" label="耗材名称" width="100">
|
|
162
|
+ <template slot-scope="scope">
|
|
163
|
+ {{scope.row.good_name}}
|
|
164
|
+ </template>
|
147
|
165
|
</el-table-column>
|
148
|
|
- <el-table-column
|
149
|
|
- prop="name"
|
150
|
|
- label="规格"
|
151
|
|
- width="100">
|
|
166
|
+ <el-table-column prop="name" label="规格" width="100">
|
|
167
|
+ <template slot-scope="scope">
|
|
168
|
+ {{scope.row.specification_name}}
|
|
169
|
+ </template>
|
152
|
170
|
</el-table-column>
|
153
|
|
- <el-table-column
|
154
|
|
- prop="name"
|
155
|
|
- label="单位"
|
156
|
|
- width="100">
|
|
171
|
+ <el-table-column prop="name" label="单位" width="100">
|
|
172
|
+ <template slot-scope="scope">
|
|
173
|
+ {{scope.row.warehousing_unit}}
|
|
174
|
+ </template>
|
157
|
175
|
</el-table-column>
|
158
|
|
- <el-table-column
|
159
|
|
- prop="name"
|
160
|
|
- label="调价数量"
|
161
|
|
- width="100">
|
|
176
|
+ <el-table-column prop="name" label="报损数量" width="100">
|
|
177
|
+ <template slot-scope="scope">
|
|
178
|
+ {{scope.row.count}}
|
|
179
|
+ </template>
|
162
|
180
|
</el-table-column>
|
163
|
|
- <el-table-column
|
164
|
|
- prop="name"
|
165
|
|
- label="原进货价"
|
166
|
|
- width="100">
|
|
181
|
+ <el-table-column prop="name" label="原进货价" width="100">
|
|
182
|
+ <template slot-scope="scope">
|
|
183
|
+ {{scope.row.buy_price}}
|
|
184
|
+ </template>
|
167
|
185
|
</el-table-column>
|
168
|
|
- <el-table-column
|
169
|
|
- prop="name"
|
170
|
|
- label="原零售价"
|
171
|
|
- width="100">
|
|
186
|
+ <el-table-column prop="name" label="原零售价" width="100">
|
|
187
|
+ <template slot-scope="scope">
|
|
188
|
+ {{scope.row.packing_price}}
|
|
189
|
+ </template>
|
172
|
190
|
</el-table-column>
|
173
|
|
- <el-table-column
|
174
|
|
- prop="name"
|
175
|
|
- label="新零售价"
|
176
|
|
- width="100">
|
|
191
|
+ <el-table-column prop="name" label="新零售价" width="100">
|
|
192
|
+ <template slot-scope="scope">
|
|
193
|
+ {{scope.row.new_price}}
|
|
194
|
+ </template>
|
177
|
195
|
</el-table-column>
|
178
|
|
- <el-table-column
|
179
|
|
- prop="name"
|
180
|
|
- label="生产厂商"
|
181
|
|
- width="100">
|
|
196
|
+ <el-table-column prop="name" label="生产厂商" width="100">
|
|
197
|
+ <template slot-scope="scope">
|
|
198
|
+ {{scope.row.manufacturer}}
|
|
199
|
+ </template>
|
182
|
200
|
</el-table-column>
|
183
|
|
- <el-table-column
|
184
|
|
- prop="name"
|
185
|
|
- label="产地"
|
186
|
|
- width="100">
|
|
201
|
+ <el-table-column prop="name" label="产地" width="100">
|
|
202
|
+ <template slot-scope="scope">
|
|
203
|
+ {{scope.row.good_origin_place}}
|
|
204
|
+ </template>
|
187
|
205
|
</el-table-column>
|
188
|
|
- <el-table-column
|
189
|
|
- prop="name"
|
190
|
|
- label="批准文号"
|
191
|
|
- width="100">
|
|
206
|
+ <el-table-column prop="name" label="批准文号" width="100">
|
|
207
|
+ <template slot-scope="scope">
|
|
208
|
+ {{scope.row.license_number}}
|
|
209
|
+ </template>
|
192
|
210
|
</el-table-column>
|
193
|
|
- <el-table-column
|
194
|
|
- prop="name"
|
195
|
|
- label="备注"
|
196
|
|
- width="100">
|
|
211
|
+ <el-table-column prop="name" label="备注" width="100">
|
|
212
|
+ <template slot-scope="scope">
|
|
213
|
+ {{scope.row.remark}}
|
|
214
|
+ </template>
|
197
|
215
|
</el-table-column>
|
198
|
|
- <el-table-column
|
199
|
|
- fixed="right"
|
200
|
|
- width="100"
|
201
|
|
- label="操作">
|
202
|
|
- <template slot-scope="scope">
|
|
216
|
+ <el-table-column fixed="right" width="100" label="操作">
|
|
217
|
+ <template slot-scope="scope">
|
203
|
218
|
<el-button type="text" size="small">删除</el-button>
|
204
|
219
|
<el-button type="text" size="small">编辑</el-button>
|
205
|
220
|
</template>
|
|
@@ -207,7 +222,7 @@
|
207
|
222
|
</el-table>
|
208
|
223
|
<span slot="footer" class="dialog-footer">
|
209
|
224
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
210
|
|
- <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
|
225
|
+ <el-button type="primary" @click="saveReportStock">确 定</el-button>
|
211
|
226
|
</span>
|
212
|
227
|
</el-dialog>
|
213
|
228
|
|
|
@@ -216,7 +231,8 @@
|
216
|
231
|
|
217
|
232
|
<script>
|
218
|
233
|
import BreadCrumb from "../components/bread-crumb";
|
219
|
|
-
|
|
234
|
+import { uParseTime } from '@/utils/tools'
|
|
235
|
+import { postSearchGoodWarehouseList,saveReportStock} from "@/api/stock"
|
220
|
236
|
export default {
|
221
|
237
|
name: "stockModifyPrice",
|
222
|
238
|
components:{
|
|
@@ -232,28 +248,35 @@ export default {
|
232
|
248
|
searchKey:'',
|
233
|
249
|
value1:'',
|
234
|
250
|
value2:'',
|
235
|
|
- tableData: [{
|
236
|
|
- date: '2016-05-02',
|
237
|
|
- name: '王小虎',
|
238
|
|
- address: '上海市普陀区金沙江路 1518 弄'
|
239
|
|
- }, {
|
240
|
|
- date: '2016-05-04',
|
241
|
|
- name: '王小虎',
|
242
|
|
- address: '上海市普陀区金沙江路 1517 弄'
|
243
|
|
- }, {
|
244
|
|
- date: '2016-05-01',
|
245
|
|
- name: '王小虎',
|
246
|
|
- address: '上海市普陀区金沙江路 1519 弄'
|
247
|
|
- }, {
|
248
|
|
- date: '2016-05-03',
|
249
|
|
- name: '王小虎',
|
250
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
251
|
|
- }],
|
|
251
|
+ tableData: [],
|
252
|
252
|
dialogVisible:false,
|
253
|
253
|
form: {
|
254
|
|
- name: '',
|
|
254
|
+ id:"",
|
|
255
|
+ good_name: '',
|
|
256
|
+ packing_price:'',
|
|
257
|
+ new_price:"",
|
|
258
|
+ count:"",
|
|
259
|
+ remark:"",
|
|
260
|
+ warehousing_order:"",
|
|
261
|
+ manufacturer:"",
|
|
262
|
+ dealer:"",
|
|
263
|
+ license_number:"",
|
|
264
|
+ warehousing_unit:"",
|
|
265
|
+ specification_name:"",
|
|
266
|
+ buy_price:"",
|
|
267
|
+ good_id:"",
|
|
268
|
+ packing_unit:"",
|
|
269
|
+ good_origin_place:"",
|
|
270
|
+ report_count:"",
|
|
271
|
+ total:"",
|
255
|
272
|
},
|
256
|
273
|
total: 0,
|
|
274
|
+ currentIndex: 0,
|
|
275
|
+ manufacturerList:[],
|
|
276
|
+ dealerList:[],
|
|
277
|
+ goodList:[],
|
|
278
|
+ start_time:"",
|
|
279
|
+ end_time:"",
|
257
|
280
|
}
|
258
|
281
|
},
|
259
|
282
|
methods:{
|
|
@@ -265,10 +288,115 @@ export default {
|
265
|
288
|
|
266
|
289
|
},
|
267
|
290
|
handleSizeChange(){},
|
268
|
|
- handleCurrentChange(){}
|
|
291
|
+ handleCurrentChange(){},
|
|
292
|
+ changeGoodName(val){
|
|
293
|
+ this.currentIndex = val
|
|
294
|
+ },
|
|
295
|
+ querySearchAsync(keyword, cb) {
|
|
296
|
+ let key = '';
|
|
297
|
+ if (keyword != undefined) {
|
|
298
|
+ key = keyword
|
|
299
|
+ }
|
|
300
|
+ postSearchGoodWarehouseList(key).then(response => {
|
|
301
|
+ if (response.data.state == 1) {
|
|
302
|
+
|
|
303
|
+ var list = response.data.data.list
|
|
304
|
+ console.log("列表数据",list)
|
|
305
|
+ this.goodList = list
|
|
306
|
+ var manufacturerList = response.data.data.manufacturerList
|
|
307
|
+ this.manufacturerList = manufacturerList
|
|
308
|
+ var dealer = response.data.data.dealerList
|
|
309
|
+ this.dealerList = dealer
|
|
310
|
+ for(let i=0;i<this.goodList.length;i++){
|
|
311
|
+ for(let j=0;j<this.manufacturerList.length;j++){
|
|
312
|
+ if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
|
|
313
|
+ this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
|
|
314
|
+ }
|
|
315
|
+ }
|
|
316
|
+ }
|
|
317
|
+
|
|
318
|
+ for(let i=0;i<this.goodList.length;i++){
|
|
319
|
+ for(let j=0;j<this.dealerList.length;j++){
|
|
320
|
+ if(this.goodList[i].dealer == this.dealerList[j].id){
|
|
321
|
+ this.goodList[i].dealer = this.dealerList[j].dealer_name
|
|
322
|
+ }
|
|
323
|
+ }
|
|
324
|
+ }
|
|
325
|
+
|
|
326
|
+ cb(this.goodList)
|
|
327
|
+ } else {
|
|
328
|
+ cb([])
|
|
329
|
+ }
|
|
330
|
+ })
|
|
331
|
+ },
|
|
332
|
+ handleSelect(val){
|
|
333
|
+ console.log("val23232323",val)
|
|
334
|
+ this.form.id = val.id
|
|
335
|
+ this.form.good_id = val.good_id,
|
|
336
|
+ this.form.good_name = val.good_name
|
|
337
|
+ this.form.packing_price = val.packing_price
|
|
338
|
+ this.form.warehousing_order = val.warehousing_order
|
|
339
|
+ this.form.license_number = val.license_number
|
|
340
|
+ this.form.dealer = val.dealer
|
|
341
|
+ this.form.manufacturer = val.manufacturer
|
|
342
|
+ this.form.specification_name = val.specification_name
|
|
343
|
+ this.form.remark = val.remark
|
|
344
|
+ this.form.buy_price = val.buy_price
|
|
345
|
+ this.form.warehousing_unit = val.packing_unit
|
|
346
|
+ this.form.total = val.total
|
|
347
|
+ this.form.new_price = val.new_price
|
|
348
|
+ },
|
|
349
|
+ addStock(){
|
|
350
|
+ var obj = {
|
|
351
|
+ good_id:this.form.good_id,
|
|
352
|
+ good_name:this.form.good_name,
|
|
353
|
+ specification_name:this.form.specification_name,
|
|
354
|
+ warehousing_unit:this.form.warehousing_unit,
|
|
355
|
+ count:parseInt(this.form.count),
|
|
356
|
+ buy_price:this.form.buy_price.toString(),
|
|
357
|
+ packing_price:this.form.packing_price.toString(),
|
|
358
|
+ manufacturer:this.form.manufacturer,
|
|
359
|
+ good_origin_place:this.form.good_origin_place,
|
|
360
|
+ license_number:this.form.license_number,
|
|
361
|
+ remark:this.form.remark,
|
|
362
|
+ new_price:this.form.new_price.toString(),
|
|
363
|
+ warehousing_order:this.form.warehousing_order,
|
|
364
|
+ dealer:this.form.dealer,
|
|
365
|
+ start_time:this.getTime(new Date()),
|
|
366
|
+ }
|
|
367
|
+ this.tableData.push(obj)
|
|
368
|
+ },
|
|
369
|
+ saveReportStock(){
|
|
370
|
+ var params = {
|
|
371
|
+ tableData:this.tableData,
|
|
372
|
+ }
|
|
373
|
+ console.log("params",params)
|
|
374
|
+ saveReportStock(params).then(response=>{
|
|
375
|
+ if(response.data.state == 1){
|
|
376
|
+ var msg = response.data.data.msg
|
|
377
|
+ this.$message.success("保存成功")
|
|
378
|
+ this.dialogVisible = false
|
|
379
|
+ }
|
|
380
|
+ })
|
|
381
|
+ },
|
|
382
|
+ getTime(val) {
|
|
383
|
+ if(val < 0){
|
|
384
|
+ return ""
|
|
385
|
+ }
|
|
386
|
+ if(val == ""){
|
|
387
|
+ return ""
|
|
388
|
+ }else {
|
|
389
|
+ return uParseTime(val, '{y}-{m}-{d}')
|
|
390
|
+ }
|
|
391
|
+ },
|
|
392
|
+ getlist(){
|
|
393
|
+ getReportStockList().then(response=>{
|
269
|
394
|
|
|
395
|
+ })
|
|
396
|
+ }
|
270
|
397
|
},
|
271
|
398
|
created(){
|
|
399
|
+ this.getlist()
|
272
|
400
|
},
|
273
|
401
|
mounted() {
|
274
|
402
|
},
|