added-purchase-template.vue
6.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<style scoped>
.pap-right{
width: 320px;
}
.pap-left{
padding-right: 30px;
}
.hei550{
height: 550px !important;
}
</style>
<template>
<div class="container resource close-left-menu contaNEW" style="min-height: 491px;">
<div class="pop-banner clearfix">
<div class="operate-btns">
<a href="javascript:history.go(-1)" class="fbtn fb-return">返回</a>
</div>
<h3 class="current-module">采购计划模板</h3>
</div>
<div class="purchase-add-plan">
<!-- :style='{"width":mfmedgoodsList.length*313+"px"}' -->
<div class="clearfix">
<div class="pap-right" style='width:340px;overflow-y:auto;padding-left:20px;' id="sortable" :class='{"hei550":listTrcollectionmedplandetail.length>=3}'>
<div class="product-item clearfix" v-for="item in listTrcollectionmedplandetail">
<div class="product-item-l" style='width:50px;'>
<div class="pro-pic pro-pic-lg" v-if="item.pictContent != null && item.pictContent != undefined && item.pictContent != ''">
<imagebox v-bind:imgarr="item.pictContent | original">
<img class="pro-pic pro-pic-lg" style="margin-top: 0px;" :src="item.pictContent | thumbnail">
<span class="pic-max blue-search">
</span>
</imagebox>
</div>
<div v-else>
<img class="pro-pic pro-pic-lg" src="/images/default.jpg">
</div>
</div>
<div class="product-item-r ml-20 fl" style='height: 150px;'>
<p>{{item.goodscode}} </p>
<p style="padding-bottom: 5px;"><span class="product-tit">{{item.goodsname}}</span></p>
<p>{{item.goodsspec}} </p>
<p>{{item.producer}} </p>
<p> {{item.registKey}}</p>
<p> 订货数 {{item.poqty == null ? 0 : item.poqty}} {{item.unit}}</p>
<a class="btn button-red fr" href="javascript:;" @click='delTrcollectionmedplandetail(item.guid,item.rowno)'>删除</a>
</div>
</div>
</div>
<div class="pap-left">
<div class="pap-min-h">
<table class="itable itable-td-long-text">
<thead>
<tr>
<th class="w50">序号</th>
<th class="w140">模板名称</th>
<th class="w90">订单条目数</th>
<th class="w90">收藏时间</th>
<!-- <th class="w60">收藏人</th> -->
<th class="w240">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="item in listTrcollectionmedplan">
<td>{{$index + 1}}</td>
<td class="t-left pr10"><a class='text-color-blue' @click="getData(item.guid)">{{item.name}}</a></td>
<td class="t-right pr10">{{item.num1}}条</td>
<td>{{item.collectiontime | getYMD}}<br>{{item.collectiontime | getHMS}}</td>
<!-- <td>{{trcollectionmedplan.collectionstaff}}</td> -->
<td>
<a class="btn button-green mr-20" href="javascript:;" v-link='{"path":"/addedPurchaseTemplate2/"+item.guid}'>生成订单</a><a class="btn button-red" href="javascript:;" @click='delTrcollectionmedplan(item.guid)'>删除模板</a>
</td>
</tr>
</tbody>
</table>
<pagination @page-change="getDD" :class="['m-20-0']" :page-no.sync="search.page" :total-pages.sync="search.totalPages">
</pagination>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
module.exports = {
data: function() {
return {
fifthStep:true,
listTrcollectionmedplan:[],
listTrcollectionmedplandetail:[],
search:{
pageSize:10,
page:1,
totalPages:0,
total:0
}
};
},
methods: {
// 检索的商品 选中
getData: function (guid) {
var self = this;
Ajax.get('/hospitalTrmedplan/listTrcollectionmedplandetail/' + guid)
.then(function (response) {
var data = response.data.data;
self.$set('listTrcollectionmedplandetail', data);
})
},
// 获得收藏模板汇总信息
getDD: function () {
var self = this;
var date = new Date();
var seperator1 = "-";
var seperator2 = ":";
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
// self.trmedplan.planbegindate = currentdate;
Ajax.get('/hospitalTrmedplan/listTrcollectionmedplan', this.search)
.then(function (response) {
var data = response.data.data;
if (response.data.errorCode == 0) {
self.$set("listTrcollectionmedplan", data.list);
self.search.totalPages = data.totalPages;
self.search.total = data.total;
self.getData(self.listTrcollectionmedplan[0].guid);
// self.activeTemp = [];
} else {
layer.msg(response.data.message);
}
});
},
// 删除模板
delTrcollectionmedplan:function(guid){
var self = this;
Ajax.post('/hospitalTrmedplan/delTrcollectionmedplan',{guid:guid} )
.then(function (response) {
var data = response.data.data;
if(response.data.errorCode==0){
layer.msg('删除成功');
self.getDD();
}else{
layer.msg(response.data.message);
}
})
},
delTrcollectionmedplandetail:function(guid,rowno){
var self = this;
Ajax.post('/hospitalTrmedplan/delTrcollectionmedplandetail',{guid:guid,rowno:rowno} )
.then(function (response) {
var data = response.data.data;
if(response.data.errorCode==0){
layer.msg('删除成功');
self.getDD();
}else{
layer.msg(response.data.message);
}
})
}
},
route: {
data: function() {
this.getDD();
},
},
};
</script>