supply-relation3-2.vue
6.17 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
<template>
<div class="container resource close-left-menu contaNEW">
<div class="pop-banner clearfix">
<!-- <div class="operate-btns">
<a @click="getData" class="fbtn fb-refresh">刷新</a>
<a @click="edit" class="fbtn fb-modify">修改</a>
</div> -->
<h3 class="current-module">维护供应关系</h3>
</div>
<div class="step-tips step-3 clearfix">
<div class="step-item">
<span>1</span><span>选择方式</span>
</div>
<div class="step-item active">
<span>2</span><span>维护供应关系</span>
</div>
<div class="step-item">
<span>3</span><span>完成</span>
</div>
</div>
<div class="step-btn">
<div class="radio-control">
为<a style='text-decoration: none;cursor:default;margin: 0 20px;' href="javascript:;">{{goodsname}}</a>添加供应商
</div>
</div>
<div class="basic-card-show">
<div class="basic-data-inter3" v-if='falg'>
<div class="basic-data-inter3-left" style='padding-top:15px;width:500px;'>
<form class="search-bar mb-20" active="###">
<input type="text" placeholder="供应商名称" style='border:1px solid rgba(96,111,122,.2);' v-model='refer'>
<div class="search-btn">
<input type="button" @click='getData'>
</div>
</form>
<div class="basic-data-inter3-left-div">
<table class="itable basic-user-info data-ind-table table-bor-trl">
<thead>
<tr>
<th class="w60">序号</th>
<th class="w100">供应商编码</th>
<th class="w100">供应商名称</th>
<th class="">操作</th>
</tr>
</thead>
<tbody v-for="item in supplierList | filterBy refer">
<tr>
<td>{{$index+1 | getIndex}}</td>
<td class="t-left pr10">{{item.medsuppliercode}}</td>
<td class="t-left pr10">{{item.suppliername}}</td>
<td>
<!-- <a class="btn-d btn-d-activate" v-if='editList'>配置</a> -->
<a @click="add($index)" class="btn button-green mar-none">添加</a>
</td>
</tr>
</tbody>
</table>
<span class="basic-data-inter3-left-prev"><<</span>
</div>
<pagination
@page-change="getData"
:class="['m-20-0']"
:page-no.sync="search.page"
:total-pages.sync="search.totalPages"></pagination>
</div>
<div class="basic-data-inter3-right" style='width:450px;'>
<form class="search-bar mb-20" active="###">
<input type="text" placeholder="供应商名称" style='border:1px solid rgba(96,111,122,.2);' v-model='refer2'>
<div class="search-btn">
<input type="button">
</div>
</form>
<h3>待选列表</h3>
<div class="bor_btm_1"></div>
<table class="itable basic-user-info data-inc-table data-ind-table">
<thead>
<tr>
<th class="w80">序号</th>
<th class="w120">供应商编码</th>
<th class="w130">供应商名称</th>
<th class="w100">操作</th>
</tr>
</thead>
<tbody v-for="item in supplier | filterBy refer2">
<tr>
<td id="wait.code">{{$index+1 | getIndex}}</td>
<td class="text-left">{{item.medsuppliercode}}</td>
<td>{{item.suppliername}}</td>
<td>
<a class="btn button-red mar-none">
<span v-else @click="del($index)">删除</span>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="step-btn">
<a href="javascript:history.go(-1)">上一步,重新选择</a>
<a href="javascript:;" @click='next'>下一步,生成供应关系</a>
</div>
</div>
</template>
<script>
module.exports={
data:function(){
return{
falg:'',
search:{
pageSize: 50,
page: 1,
totalPages: 0,
supplierguid:'',
searchValue:'',
guid:''
},
supplierList:[],
supplier:[],
goodsname:'',
refer:'',
refer2:'',
}
},
methods:{
getData:function(){
var self = this;
self.supplier=[];
Ajax.post('supplyProduct/querySupplierList',self.search).then(function(response){
var res=response.data.data;
self.$set('supplierList',res.list);
self.search.totalPages = res.totalPages;
});
},
add:function(index){
var self =this;
var arr=[];
self.supplier.push(self.supplierList[index]);
self.supplierList.splice(index,1);
},
del:function(index){
var self=this;
self.supplierList.push(self.supplier[index]);
self.supplier.splice(index,1);
},
next:function(){
var self=this;
localStorage.setItem('supplier',JSON.stringify(self.supplier));
self.$set('supplier',[]);
localStorage.setItem('medGoodsGuid',JSON.stringify(self.medGoodsGuidList));
localStorage.setItem('guid',JSON.stringify(self.search.guid));
self.$router.go({ 'path': '/supplyRelation4/'+self.falg +'/'+'11'});
}
},
route :{
data: function (transition) {
this.search.guid=transition.to.params.guid;
this.falg=transition.to.params.falg;
this.search.supplierguid=transition.to.params.supplierguid;
this.goodsname=decodeURIComponent(transition.to.params.goodsname);
this.getData();
},
},
}
</script>