motion-plan.vue
6.35 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<template>
<div style="min-height: 806px;" class="container resource close-left-menu contaNEW">
<div class="pop-banner clearfix w1003">
<!-- <div class="operate-btns">
<a class="fbtn fb-add" v-link="{path:'/basicMessageForm/0'}" href="javascript:;">批量添加</a>
</div> -->
<h3 class="current-module">自动生成计划</h3>
</div>
<!--purchase-return-goods start-->
<div class="purchase-return-goods">
<div class="step-tips step-3 clearfix">
<div class="step-item active"><span>1</span>选择库存紧缺商品</div>
<div class="step-item"><span>2</span>分配供应商</div>
<div class="step-item"><span>3</span>完成</div>
</div>
</div>
<div class="supply-productlist clearfix">
<div class="pd-form fast-search-form" style="padding:10px;">
<div class="group-row">
<div class="form-group">
<div class="control">
<input type="text" id="cn1" maxlength="50" v-rule v-model="goodsflag" placeholder="商品编码、商品名称、注册证号" title="商品编码、商品名称、注册证号">
</div>
</div>
<div class="form-group">
<div class="control select-style form-label">
<label class="label">库存量</label>
<select class="inp3" v-model='qtyflag'>
<option value="1"><下限的</option>
<option value="2">下限的25%</option>
<option value="3">下限的50%</option>
<option value="4">下限的75%</option>
</select>
</div>
</div>
</div>
<div class="group-row t-right">
<button class="fast-search-form-btn btn-d btn-d-lg btn-d-activate btn-d-circle" @click="getData">查 询</button>
</div>
</div>
<div class="search-result">
<div class="statistics">您当前共添加<em @click='list=newList'>{{newList.length}}</em>个商品</div>
</div>
<table class="itable itable-thead-13px itable-td-long-text">
<thead>
<tr>
<th class="w70">
<div class="checkbox-control">
<input type="checkbox" name="cb2" id="cn8" v-model="itemChecked">
<label class="checkbox mr-0" for="cn8" style='line-height: inherit;'>序号</label>
</div>
</th>
<th class="w280">商品</th>
<!--<th class="w140">商品</th>-->
<!--<th class="w140">生产<br>厂商</th>-->
<!--<th class="w130">注册证号/<br/>批准文号</th>-->
<th class="w100">存库量</th>
<th class="w30"></th>
<th class="w100">库存上下限</th>
<th class="w100">推荐量</th>
<th class="w100">采购量</th>
<th class="w120">单价</th>
<th class="w100">金额</th>
</tr>
</thead>
<tbody>
<tr v-if="list.length==0">
<td colspan="15" >
暂无符合条件的记录
</td>
</tr>
<!---->
<tr v-for='item in list'>
<td>
<div class="checkbox-control">
<input type="checkbox" :id="item.guid" v-model='item.checked'>
<label class="checkbox mr-0" :for="item.guid" style="line-height: inherit;">{{$index+1}}</label>
</div>
</td>
<td class="t-left">
<div class="goods_con"> {{item.goodscode}}
<br>
<span class="p-tit-green">{{item.goodsname}}</span>
<br> {{item.goodsspec}}
<br> {{item.unitstyle}}
<br> {{item.producer}}
<br> {{item.registkey}}
</div>
</td>
<!--<td class="t-left">-->
<!--{{item.goodsname}}-->
<!--<br>-->
<!--{{item.goodsspec}}-->
<!--<br>-->
<!--{{item.unitstyle}}-->
<!--</td>-->
<!--<td class='t-left'>{{item.producer}}</td>-->
<!--<td>{{item.registkey}}</td>-->
<td>{{item.stockQty}}</td>
<td>
<span class="table-detail-icon">上</span>
<span class="table-detail-icon mt-10">下</span>
</td>
<td class="t-right pr10">
<div>{{item.stockUpperLimit}}</div>
<div class="mt-10">{{item.stockLowerLimit}}</div>
</td>
<td class="t-right pr10">{{item.safetyStock}}</td>
<td><input type="text" v-model='item.poqty'></td>
<td>{{item.arriveprice}}元</td>
<td>{{item.arriveprice*item.poqty}}元</td>
</tr>
</tbody>
</table>
</div>
<div class="step-btn">
<a href="javascript:;" @click='next'>下一步,分配供应商>></a>
</div>
</div>
</template>
<script>
module.exports = {
data: function() {
return {
goodsflag:'',
qtyflag:1,
list:[],
itemChecked:false,
newList:[]
};
},
methods: {
getData:function(){
var self=this;
Ajax.post('/hospitalTrmedplan/listmedstockgoods',{'goodsflag':self.goodsflag,'qtyflag':self.qtyflag})
.then(function(response) {
var res = response.data.data;
if(response.data.errorCode==0){
for(var a=0;a<res.length;a++){
res[a].checked=false;
}
self.list=res;
}
});
},
next:function(){
var self=this;
console.log(self.newList);
if(self.newList.length==0){
layer.msg('请选择商品');
}else{
Ajax.post('/hospitalTrmedplan/saveAutoTrmedplan',{'mfmedstockgoodsList':self.newList})
.then(function(response) {
if(response.data.errorCode==0){
self.$router.go({'path':'/motionPlan2'})
}
});
}
},
},
// 画面初始化
route: {
activate: function() {
this.getData();
}
},
watch:{
'itemChecked':function(){
var self=this;
for(var a=0;a<self.list.length;a++){
self.$set('list['+a+']',Object.assign({}, self.list[a], { 'checked': self.itemChecked}));
}
},
'list':{
handler(checkbox){
var self=this;
self.newList=[];
for(var a=0;a<checkbox.length;a++){
if(checkbox[a].checked){
self.newList.push(checkbox[a]);
}
}
},
deep:true
}
}
};
</script>