factory-invoice.vue
12.4 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<template>
<section>
<div class="container resource close-left-menu contaNEW">
<div class="pop-banner clearfix">
<div class="operate-btns">
<a class="fbtn fb-create " v-link="{path : 'factoryInvoiceMake'}">新登记厂商发票</a>
</div>
<h3 class="current-module">生产厂商发票列表</h3>
</div>
<div class="pd-form fast-search-form">
<div class="group-row">
<div class="form-group">
<div class="control">
<input type="text" v-model="search.manufacturer" placeholder="生产厂商" title="生产厂商" maxlength="20" v-rule></div>
</div>
<div class="form-group">
<!-- <label for="cn1" class="label">采购单号</label> -->
<div class="control">
<input type="text" v-model="search.invoiceno" title='发票号' placeholder='发票号' maxlength="26" v-rule></div>
</div>
</div>
<div class="group-row">
<div class="form-group">
<label for="cn3" class="label">
</label>
<div class="control control-date" style="height:34px;overflow: inherit;">
<div style="width:44%;float:left;">
<datepicker :target.sync="search.startdate" :readonly="readonlyFlag" title='发票开始日期'
placeholder='发票开始日期'
styleobj="width:100% !important;border-radius:8px 0px 0px 8px !important;"></datepicker>
</div>
<span class="text-and">-</span>
<div style="width:48%;float:left;">
<datepicker :target.sync="search.enddate" :readonly="readonlyFlag" title='发票结束日期'
placeholder='发票结束日期'
styleobj="width:100% !important;border-radius:0px 8px 8px 0px !important;"></datepicker>
</div>
</div>
</div>
<div class="form-group">
<label for="cn1" class="label">业务状态</label>
<div class="control control-filtering control-filtering-green fl w350">
<a class="option" href="javascript:;" :class="{'all active':search.mirstate==''}"
v-on:click="search.mirstate=''">全部</a>
<a class="option" href="javascript:;" :class="{'all active':search.mirstate=='MS01'}"
v-on:click="search.mirstate='MS01'">新增</a>
<a class="option" href="javascript:;" :class="{'all active':search.mirstate=='MS02'}"
v-on:click="search.mirstate='MS02'">核销中</a>
<a class="option" href="javascript:;" :class="{'all active':search.mirstate=='MS03'}"
v-on:click="search.mirstate='MS03'">已核销</a>
</div>
</div>
</div>
<div class="group-row t-right">
<button v-on:click="getData()"
class="fast-search-form-btn btn-d btn-d-lg btn-d-activate btn-d-circle">查 询
</button>
</div>
</div>
<table class="itable itable-thead-13px">
<thead id="t_header">
<tr>
<th class="w50">序号</th>
<th class="w120">生产厂商</th>
<th class="w100">发票号</th>
<th class="w70">发票图片</th>
<th class="w80">发票日期</th>
<th class="w70">经手人</th>
<th class="w50">品规数</th>
<th class="w80">状态</th>
<th class="w80">总金额(元)</th>
<th class="w120">操作</th>
</tr>
</thead>
<tbody class="txt_v">
<tr>
<td colspan="10" v-if="mxList.length==0">
暂无符合条件的记录
</td>
</tr>
<tr v-for="trdo in mxList">
<td>{{$index+1}}</td>
<td class="t-left pr10">
<div class="p-lr-10">{{trdo.manufacturer}}</div>
</td>
<td>{{trdo.invoiceno}}</td>
<td>
<div class="toggle-image pro-pic">
<imagebox v-bind:imgarr="trdo.invoicepic | original">
<img style="width: 100%" :src="trdo.invoicepic|thumbnail">
<span class="pic-max blue-search"></span>
</imagebox>
</div>
<!--<img class="pro-pic pro-pic-lg" :src="trdo.invoicepic|picSrc">-->
</td>
<td>{{trdo.invoicedate| getYMD}}</td>
<td>{{trdo.operatorname}}</td>
<td>{{trdo.countsum}}条</td>
<td v-if="trdo.mirstate=='MS01'">{{trdo.mirstate|mirstate}}</td>
<td v-if="trdo.mirstate=='MS02'" style="color: #ee7a2f;">{{trdo.mirstate|mirstate}}</td>
<td style="color: #dc322e;"v-if="trdo.mirstate=='MS03'">{{trdo.mirstate|mirstate}}</td>
<td class="text-right pr10">{{trdo.invoicemoney| numDigit 2}}</td>
<td>
<div class="from-button" v-if="trdo.mirstate=='MS01'">
<a href="javascript:;" class="green-button p-lr-10"
v-link="{ path: '/factoryInvoiceDetail/' + trdo.guid+'/'+trdo.mirstate}">明细
<i>|</i>
</a>
<a href="javascript:;" class="red-button p-lr-10" v-on:click="dele(trdo.guid)">删除</a>
</div>
<div class="from-button" v-else>
<a href="javascript:;" class="green-button p-lr-10"
v-link="{ path: '/factoryInvoiceDetail/' + trdo.guid+'/'+trdo.mirstate}">明细
<i>|</i>
</a>
<a href="javascript:;" class="red-button p-lr-10 text-color-custom readonly-gray">删除</a>
</div>
<!-- <a v-else class="btn button-green" v-link="{ path: '/factoryInvoiceDetail/' + trdo.guid+'/'+trdo.mirstate}">明细</a> -->
</td>
</tr>
</tbody>
</table>
<div class="pagination m-20-0">
<pagination @page-change="getData" :page-no.sync="search.page" :total-pages.sync="search.totalPages">
</pagination>
</div>
</div>
</section>
</template>
<script>
module.exports = {
data: function () {
return {
// 明细数据
mxList: '',
// 查询条件
search: {
pageSize: 50,
page: 1,
totalPages: 0,
manufacturer: '', // 生产厂商
invoiceno: '', // 发票号
startdate: '', // 开始日期
enddate: '', // 结束日期
mirstate: '',
},
// 日期控件
readonlyFlag: false,
};
},
methods: {
getTime: function () {
var self = this;
// 结束日期
var nowdate = new Date();
var y = nowdate.getFullYear();
var m = nowdate.getMonth() + 1;
m = m >= 10 ? m : '0' + m;
var d = nowdate.getDate();
d = d >= 10 ? d : '0' + d;
self.search.enddate = y + '-' + m + '-' + d;
// 开始日期
nowdate.setMonth(nowdate.getMonth() - 1);
var yn = nowdate.getFullYear();
var mn = nowdate.getMonth() + 1;
mn = mn >= 10 ? mn : '0' + mn;
var dn = nowdate.getDate();
dn = dn >= 10 ? dn : '0' + dn;
self.search.startdate = yn + '-' + mn + '-' + dn;
},
// 获取数据
getData: function () {
var self = this;
Ajax.post('/supplierReport/findmirBysupplier', this.search)
.then(function (response) {
var data = response.data.data;
self.$set('mxList', data.list);
// self.search.pageno = data.pageno;
// self.search.totalPages = data.totalPages;
// self.search.total = data.total;
})
},
// 删除
delmirByguid: function (guid) {
var self = this;
Ajax.post('/supplierReport/delmirByguid', {
'guid': guid
})
.then(function (response) {
if (response.data.errorCode == 0) {
self.MessageBox({
title: '提示',
message: '删除成功',
type: 'alert'
}, function (action) {
self.getData();
});
} else {
self.MessageBox({
title: '警告',
message: response.data.message,
type: 'alert'
}, function (action) {
});
}
})
},
dele: function (guid) {
var self = this;
self.MessageBox({
title: '提示',
message: '确定删除',
type: 'alert',
showCancelButton: true
}, function (action) {
if (action == "confirm") {
self.delmirByguid(guid);
}
})
},
// 跳转到订单受理详情页面
goTRDoDetail: function (guid) {
var self = this;
// 根据执行状态跳转不同的页面 立继武
if (billstate == self.ctns.dobillstated03 || billstate == self.ctns.dobillstated02) {
//已提交 已完结 跳转已完结、已提交页面 立继武
self.$route.router.go('/trdo/orderOutall2/' + trdo_billno);
} else { // 未提交
// 未提交 billtype==self.ctns.billtype02 暂时注释 判断单据类型为高值
if (billtype == '02' && (trpo_billno != null || trpo_billno != '') || billtype == '03' && (trpo_billno != null || trpo_billno != '')) {
//进入高值页面 未提交页面
self.$route.router.go('/trdo/orderOutall2-3/' + ((trpo_billno || '') + "@" + (trdo_billno || '')));
} else {
//进入非高值页面 未提交页面
self.$route.router.go('/trdo/orderOutall2-2/' + ((trpo_billno || '') + "@" + (trdo_billno || '')));
}
}
},
},
watch: {
'search.mirstate': function (val) {
this.getData();
}
},
route: {
data: function (transition) {
this.search.invoiceno = window.sessionStorage.getItem('value');
window.sessionStorage.removeItem('value');
this.getData();
}
},
};
</script>