|
@@ -92,11 +92,17 @@
|
92
|
92
|
</el-table-column>
|
93
|
93
|
|
94
|
94
|
<el-table-column align="center" prop="name" label="追溯码">
|
95
|
|
- <template slot-scope="scope">{{scope.row.drug_code}}</template>
|
|
95
|
+ <template slot-scope="scope">
|
|
96
|
+ <div @click="getDrugCode(scope.row.advice_id,scope.row.drug_code,scope.$index)"><el-input style="width: 100;" v-model="scope.row.drug_code"></el-input></div>
|
|
97
|
+ </template>
|
|
98
|
+ <!-- <template slot-scope="scope">{{scope.row.drug_code}}</template> -->
|
96
|
99
|
</el-table-column>
|
97
|
100
|
|
98
|
101
|
<el-table-column align="center" prop="name" label="患者姓名">
|
99
|
|
- <template slot-scope="scope">{{scope.row.p.name}}</template>
|
|
102
|
+ <template slot-scope="scope">
|
|
103
|
+ <!-- {{scope.row.p.name}} -->
|
|
104
|
+ {{ getPatientName(scope.row.patient_id) }}
|
|
105
|
+ </template>
|
100
|
106
|
</el-table-column>
|
101
|
107
|
|
102
|
108
|
<el-table-column align="center" prop="name" label="批号">
|
|
@@ -217,6 +223,26 @@
|
217
|
223
|
|
218
|
224
|
</el-table>
|
219
|
225
|
|
|
226
|
+ <el-dialog
|
|
227
|
+ title="药品追溯码"
|
|
228
|
+ :visible.sync="dialogVisibleOne"
|
|
229
|
+ width="40%">
|
|
230
|
+ <span>
|
|
231
|
+ <el-input
|
|
232
|
+ @keyup.native="changeText"
|
|
233
|
+ type="textarea"
|
|
234
|
+ placeholder="请输入内容"
|
|
235
|
+ v-model="textarea"
|
|
236
|
+ :rows="10"
|
|
237
|
+ >
|
|
238
|
+ </el-input>
|
|
239
|
+ </span>
|
|
240
|
+ <span slot="footer" class="dialog-footer">
|
|
241
|
+ <el-button @click="dialogVisibleOne = false">取 消</el-button>
|
|
242
|
+ <el-button type="primary" @click="saveTextArea()">确 定</el-button>
|
|
243
|
+ </span>
|
|
244
|
+ </el-dialog>
|
|
245
|
+
|
220
|
246
|
</div>
|
221
|
247
|
|
222
|
248
|
<!-- </div> -->
|
|
@@ -228,6 +254,7 @@ import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
228
|
254
|
import { GetDrugChangeStock } from '../../api/new_stock/stock'
|
229
|
255
|
import { getDictionaryDataConfig } from "@/utils/data";
|
230
|
256
|
import { uParseTime } from '@/utils/tools'
|
|
257
|
+import { changeDrugCode } from "@/api/pharmacy";
|
231
|
258
|
import axios from 'axios'
|
232
|
259
|
const moment = require('moment')
|
233
|
260
|
export default {
|
|
@@ -255,10 +282,48 @@ export default {
|
255
|
282
|
changes: [
|
256
|
283
|
{ id: 1, name: '已变更' },
|
257
|
284
|
{ id: 2, name: '未变更' },
|
258
|
|
- ]
|
|
285
|
+ ],
|
|
286
|
+ textarea:'',
|
|
287
|
+ dialogVisibleOne:false,
|
|
288
|
+ currentRow:{},
|
|
289
|
+ currentIndex:0,
|
|
290
|
+ patientList:[]
|
259
|
291
|
}
|
260
|
292
|
},
|
261
|
293
|
methods: {
|
|
294
|
+ changeText(event){
|
|
295
|
+ // 检查是否为特定的按键,例如回车键,来确认扫码枪输入完成
|
|
296
|
+ if (event.key === 'Enter') {
|
|
297
|
+ var textarea = ""
|
|
298
|
+ textarea += this.textarea + ","
|
|
299
|
+ this.textarea = textarea
|
|
300
|
+ }
|
|
301
|
+ },
|
|
302
|
+ getDrugCode(id,DrugCode,index){
|
|
303
|
+ this.id = id
|
|
304
|
+ this.textarea = DrugCode
|
|
305
|
+ this.currentIndex = index
|
|
306
|
+ this.dialogVisibleOne = true
|
|
307
|
+ },
|
|
308
|
+ saveTextArea(){
|
|
309
|
+ var params = {
|
|
310
|
+ id:this.id,
|
|
311
|
+ data_source:1,
|
|
312
|
+ drug_code:this.textarea,
|
|
313
|
+ }
|
|
314
|
+ console.log("paramss",params)
|
|
315
|
+ changeDrugCode(params).then(response=>{
|
|
316
|
+ if(response.data.state == 1){
|
|
317
|
+ this.$message.success("保存成功!")
|
|
318
|
+ for(let i=0;i<this.tableData.length;i++){
|
|
319
|
+ if(this.currentIndex == i){
|
|
320
|
+ this.tableData[i].drug_code = this.textarea
|
|
321
|
+ }
|
|
322
|
+ }
|
|
323
|
+ this.dialogVisibleOne = false
|
|
324
|
+ }
|
|
325
|
+ })
|
|
326
|
+ },
|
262
|
327
|
deleteStock(row){
|
263
|
328
|
let ids = row.id
|
264
|
329
|
var that = this;
|
|
@@ -446,6 +511,7 @@ export default {
|
446
|
511
|
return false
|
447
|
512
|
} else {
|
448
|
513
|
this.value = response.data.data.total
|
|
514
|
+ this.patientList = response.data.data.patientList
|
449
|
515
|
for(let i =0; i < response.data.data.info.length; i++){
|
450
|
516
|
let obj = {
|
451
|
517
|
id:response.data.data.info[i].id,
|
|
@@ -460,7 +526,10 @@ export default {
|
460
|
526
|
is_sale:response.data.data.info[i].is_sale,
|
461
|
527
|
pc_date:response.data.data.info[i].pc_date,
|
462
|
528
|
is_bg:response.data.data.info[i].is_change,
|
463
|
|
- unit:response.data.data.info[i].Unit
|
|
529
|
+ unit:response.data.data.info[i].Unit,
|
|
530
|
+ patient_id:response.data.data.info[i].patient_id,
|
|
531
|
+ drug_code:response.data.data.info[i].his_advice_info.drug_code,
|
|
532
|
+ advice_id:response.data.data.info[i].his_advice_info.id
|
464
|
533
|
}
|
465
|
534
|
this.tableData.push(obj)
|
466
|
535
|
}
|
|
@@ -471,6 +540,17 @@ export default {
|
471
|
540
|
|
472
|
541
|
|
473
|
542
|
},
|
|
543
|
+ getPatientName(id){
|
|
544
|
+ console.log("id=-=--------------",id)
|
|
545
|
+ console.log("patinetlist===========",this.patientList)
|
|
546
|
+ var name = ""
|
|
547
|
+ for(let i=0;i<this.patientList.length;i++){
|
|
548
|
+ if(id == this.patientList[i].id){
|
|
549
|
+ name = this.patientList[i].name
|
|
550
|
+ }
|
|
551
|
+ }
|
|
552
|
+ return name
|
|
553
|
+ }
|
474
|
554
|
},
|
475
|
555
|
created() {
|
476
|
556
|
var drugTypeList = getDictionaryDataConfig("system", "drug_type");
|