|
@@ -3,49 +3,61 @@
|
3
|
3
|
<div class="position">
|
4
|
4
|
<bread-crumb :crumbs="crumbs"></bread-crumb>
|
5
|
5
|
</div>
|
6
|
|
- <div class="app-container ">
|
7
|
|
- <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
|
|
6
|
+ <div class="app-container">
|
|
7
|
+ <div
|
|
8
|
+ style="
|
|
9
|
+ justify-content: space-between;
|
|
10
|
+ margin: 0px 0 12px 0;
|
|
11
|
+ display: flex;
|
|
12
|
+ align-items: center;
|
|
13
|
+ "
|
|
14
|
+ >
|
8
|
15
|
<div>
|
9
|
|
-
|
10
|
16
|
<el-date-picker
|
11
|
17
|
size="small"
|
12
|
18
|
v-model="start_time"
|
13
|
19
|
prefix-icon="el-icon-date"
|
14
|
20
|
:editable="false"
|
15
|
|
- style="width: 196px;"
|
|
21
|
+ style="width: 196px"
|
16
|
22
|
type="date"
|
17
|
23
|
placeholder="选择日期时间"
|
18
|
24
|
align="right"
|
19
|
25
|
format="yyyy-MM-dd"
|
20
|
26
|
value-format="yyyy-MM-dd"
|
21
|
27
|
@change="startTimeChange"
|
22
|
|
- ></el-date-picker>-
|
23
|
|
- <el-date-picker
|
24
|
|
- size="small"
|
25
|
|
- v-model="end_time"
|
26
|
|
- prefix-icon="el-icon-date"
|
27
|
|
- :editable="false"
|
28
|
|
- style="width: 196px;"
|
29
|
|
- type="date"
|
30
|
|
- placeholder="选择日期时间"
|
31
|
|
- align="right"
|
32
|
|
- format="yyyy-MM-dd"
|
33
|
|
- value-format="yyyy-MM-dd"
|
34
|
|
- @change="endTimeChange"
|
|
28
|
+ ></el-date-picker
|
|
29
|
+ >-
|
|
30
|
+ <el-date-picker
|
|
31
|
+ size="small"
|
|
32
|
+ v-model="end_time"
|
|
33
|
+ prefix-icon="el-icon-date"
|
|
34
|
+ :editable="false"
|
|
35
|
+ style="width: 196px"
|
|
36
|
+ type="date"
|
|
37
|
+ placeholder="选择日期时间"
|
|
38
|
+ align="right"
|
|
39
|
+ format="yyyy-MM-dd"
|
|
40
|
+ value-format="yyyy-MM-dd"
|
|
41
|
+ @change="endTimeChange"
|
35
|
42
|
></el-date-picker>
|
36
|
43
|
<span>审核状态:</span>
|
37
|
|
- <el-select v-model="check_id" style="width:140px;margin-right:10px;" placeholder="请选择"
|
38
|
|
- @change="changeTypeName">
|
|
44
|
+ <el-select
|
|
45
|
+ v-model="check_id"
|
|
46
|
+ style="width: 140px; margin-right: 10px"
|
|
47
|
+ placeholder="请选择"
|
|
48
|
+ @change="changeTypeName"
|
|
49
|
+ >
|
39
|
50
|
<el-option
|
40
|
|
- v-for="item in checkList"
|
41
|
|
- :key="item.id"
|
42
|
|
- :label="item.name"
|
43
|
|
- :value="item.id">
|
|
51
|
+ v-for="item in checkList"
|
|
52
|
+ :key="item.id"
|
|
53
|
+ :label="item.name"
|
|
54
|
+ :value="item.id"
|
|
55
|
+ >
|
44
|
56
|
</el-option>
|
45
|
57
|
</el-select>
|
46
|
58
|
<el-input
|
47
|
59
|
size="small"
|
48
|
|
- style="width: 200px;margin-left:10px;"
|
|
60
|
+ style="width: 200px; margin-left: 10px"
|
49
|
61
|
class="filter-item"
|
50
|
62
|
v-model.trim="keywords"
|
51
|
63
|
placeholder="订单编号或供应商名称"
|
|
@@ -64,12 +76,11 @@
|
64
|
76
|
</div>
|
65
|
77
|
</div>
|
66
|
78
|
|
67
|
|
-
|
68
|
|
- <el-table
|
|
79
|
+ <el-table
|
69
|
80
|
:row-style="{ color: '#303133' }"
|
70
|
81
|
:header-cell-style="{
|
71
|
82
|
backgroundColor: 'rgb(245, 247, 250)',
|
72
|
|
- color: '#606266'
|
|
83
|
+ color: '#606266',
|
73
|
84
|
}"
|
74
|
85
|
:data="tableList"
|
75
|
86
|
:class="signAndWeighBoxPatients"
|
|
@@ -77,98 +88,99 @@
|
77
|
88
|
>
|
78
|
89
|
<el-table-column label="订单日期" align="center">
|
79
|
90
|
<template slot-scope="scope">
|
80
|
|
- <span>{{getTimes(scope.row.document_date)}}</span>
|
81
|
|
- </template>
|
|
91
|
+ <span>{{ getTimes(scope.row.document_date) }}</span>
|
|
92
|
+ </template>
|
82
|
93
|
</el-table-column>
|
83
|
94
|
<el-table-column label="订单编号" align="center">
|
84
|
95
|
<template slot-scope="scope">
|
85
|
|
- <span>{{scope.row.number}}</span>
|
|
96
|
+ <span>{{ scope.row.number }}</span>
|
86
|
97
|
</template>
|
87
|
98
|
</el-table-column>
|
88
|
99
|
<el-table-column label="供应商" align="center">
|
89
|
|
- <template slot-scope="scope">
|
90
|
|
- <span>{{getName(scope.row.supplier_id)}}</span>
|
91
|
|
- </template>
|
92
|
|
- </el-table-column>
|
93
|
|
- <el-table-column label="关联采购单号" align="center">
|
94
|
100
|
<template slot-scope="scope">
|
95
|
|
- <div style="width:100%;height:100%">
|
96
|
|
- <tr class="annotation-rs cluster-rs" v-for="(item,index) in scope.row.orderOut" :key="index">
|
|
101
|
+ <span>{{ getName(scope.row.supplier_id) }}</span>
|
|
102
|
+ </template>
|
|
103
|
+ </el-table-column>
|
|
104
|
+ <el-table-column label="关联采购单号" align="center" width="150">
|
|
105
|
+ <template slot-scope="scope">
|
|
106
|
+ <div style="width: 100%; height: 100%">
|
|
107
|
+ <tr class="color" v-for="(item,index) in scope.row.orderOut" :key="index">
|
97
|
108
|
<td>{{item.good_number}}</td>
|
98
|
109
|
</tr>
|
|
110
|
+
|
99
|
111
|
</div>
|
100
|
112
|
</template>
|
101
|
113
|
</el-table-column>
|
102
|
114
|
<el-table-column label="采购金额" align="center">
|
103
|
115
|
<template slot-scope="scope">
|
104
|
|
- <span v-if="getAllBuyPrice(scope.row.orderInfo)>0">{{getAllBuyPrice(scope.row.orderInfo)}}</span>
|
|
116
|
+ <span v-if="getAllBuyPrice(scope.row.orderInfo) > 0">{{
|
|
117
|
+ getAllBuyPrice(scope.row.orderInfo)
|
|
118
|
+ }}</span>
|
|
119
|
+ </template>
|
|
120
|
+ </el-table-column>
|
|
121
|
+
|
|
122
|
+ <el-table-column label="数量" align="center">
|
|
123
|
+ <template slot-scope="scope">
|
|
124
|
+ {{ getAllCount(scope.row.orderInfo) }}
|
|
125
|
+ </template>
|
|
126
|
+ </el-table-column>
|
|
127
|
+ <el-table-column label="订单状态" align="center">
|
|
128
|
+ <template slot-scope="scope">
|
|
129
|
+ <span v-if="scope.row.is_warehouse == 1">全部入库</span>
|
|
130
|
+ <span v-if="scope.row.is_warehouse == 2">未入库</span>
|
|
131
|
+ <span v-if="scope.row.is_warehouse == 3">部分入库</span>
|
105
|
132
|
</template>
|
106
|
133
|
</el-table-column>
|
107
|
134
|
|
108
|
|
- <el-table-column label="数量" align="center">
|
109
|
|
- <template slot-scope="scope">
|
110
|
|
- {{getAllCount(scope.row.orderInfo)}}
|
111
|
|
- </template>
|
112
|
|
- </el-table-column>
|
113
|
|
- <el-table-column label="订单状态" align="center">
|
114
|
|
- <template slot-scope="scope">
|
115
|
|
- <span v-if="scope.row.is_warehouse == 1">全部入库</span>
|
116
|
|
- <span v-if="scope.row.is_warehouse == 2">未入库</span>
|
117
|
|
- <span v-if="scope.row.is_warehouse == 3">部分入库</span>
|
118
|
|
- </template>
|
119
|
|
- </el-table-column>
|
120
|
|
-
|
121
|
135
|
<el-table-column label="交货日期" align="center">
|
122
|
|
- <template slot-scope="scope">
|
123
|
|
- {{getTimes(scope.row.delivery_date)}}
|
124
|
|
- </template>
|
125
|
|
- </el-table-column>
|
126
|
|
-
|
127
|
|
-
|
128
|
|
- <el-table-column label="制单人" align="center">
|
129
|
|
- <template slot-scope="scope">
|
130
|
|
- {{getDocName(scope.row.creater)}}
|
131
|
|
- </template>
|
132
|
|
- </el-table-column>
|
|
136
|
+ <template slot-scope="scope">
|
|
137
|
+ {{ getTimes(scope.row.delivery_date) }}
|
|
138
|
+ </template>
|
|
139
|
+ </el-table-column>
|
133
|
140
|
|
134
|
|
- <el-table-column label="审核人" align="center">
|
135
|
|
- <template slot-scope="scope">
|
136
|
|
- {{getDocName(scope.row.checker)}}
|
137
|
|
- </template>
|
138
|
|
- </el-table-column>
|
|
141
|
+ <el-table-column label="制单人" align="center">
|
|
142
|
+ <template slot-scope="scope">
|
|
143
|
+ {{ getDocName(scope.row.creater) }}
|
|
144
|
+ </template>
|
|
145
|
+ </el-table-column>
|
139
|
146
|
|
140
|
|
- <el-table-column label="操作" align="center" width="200px">
|
|
147
|
+ <el-table-column label="审核人" align="center">
|
141
|
148
|
<template slot-scope="scope">
|
142
|
|
- <el-button
|
143
|
|
- icon="el-icon-edit-outline"
|
144
|
|
- size="small"
|
145
|
|
- type="primary"
|
146
|
|
- @click="toClick(scope.row.id)"
|
|
149
|
+ {{ getDocName(scope.row.checker) }}
|
|
150
|
+ </template>
|
|
151
|
+ </el-table-column>
|
|
152
|
+
|
|
153
|
+ <el-table-column label="操作" align="center" width="200px">
|
|
154
|
+ <template slot-scope="scope">
|
|
155
|
+ <el-button
|
|
156
|
+ icon="el-icon-edit-outline"
|
|
157
|
+ size="small"
|
|
158
|
+ type="primary"
|
|
159
|
+ @click="toClick(scope.row.id)"
|
147
|
160
|
>编辑
|
148
|
|
- </el-button>
|
149
|
|
- <el-button
|
150
|
|
- icon="el-icon-delete"
|
151
|
|
- size="small"
|
152
|
|
- type="danger"
|
153
|
|
- @click="toDelete(scope.row,scope.$index)"
|
|
161
|
+ </el-button>
|
|
162
|
+ <el-button
|
|
163
|
+ icon="el-icon-delete"
|
|
164
|
+ size="small"
|
|
165
|
+ type="danger"
|
|
166
|
+ @click="toDelete(scope.row, scope.$index)"
|
154
|
167
|
>删除
|
155
|
|
- </el-button>
|
|
168
|
+ </el-button>
|
156
|
169
|
</template>
|
157
|
170
|
</el-table-column>
|
158
|
171
|
</el-table>
|
159
|
172
|
<el-pagination
|
160
|
173
|
@size-change="handleSizeChange"
|
161
|
174
|
@current-change="handleCurrentChange"
|
162
|
|
- :page-sizes="[10, 50, 100,200,500,1000]"
|
|
175
|
+ :page-sizes="[10, 50, 100, 200, 500, 1000]"
|
163
|
176
|
:page-size="10"
|
164
|
177
|
background
|
165
|
178
|
align="right"
|
166
|
|
- style="margin-top:20px;"
|
|
179
|
+ style="margin-top: 20px"
|
167
|
180
|
layout="total, sizes, prev, pager, next, jumper"
|
168
|
181
|
:total="total"
|
169
|
182
|
>
|
170
|
183
|
</el-pagination>
|
171
|
|
-
|
172
|
184
|
</div>
|
173
|
185
|
</div>
|
174
|
186
|
</template>
|
|
@@ -176,216 +188,229 @@
|
176
|
188
|
<script>
|
177
|
189
|
import BreadCrumb from "@/xt_pages/components/bread-crumb";
|
178
|
190
|
|
179
|
|
-import {getAllSupply,getAllPurchaseOrderList,deletePurchaseOrder} from "@/api/supply"
|
180
|
|
-import {uParseTime } from '@/utils/tools'
|
|
191
|
+import {
|
|
192
|
+ getAllSupply,
|
|
193
|
+ getAllPurchaseOrderList,
|
|
194
|
+ deletePurchaseOrder,
|
|
195
|
+} from "@/api/supply";
|
|
196
|
+import { uParseTime } from "@/utils/tools";
|
181
|
197
|
export default {
|
182
|
198
|
name: "stockIn",
|
183
|
|
- components: {
|
184
|
|
-
|
185
|
|
- },
|
|
199
|
+ components: {},
|
186
|
200
|
components: {
|
187
|
|
- BreadCrumb
|
|
201
|
+ BreadCrumb,
|
188
|
202
|
},
|
189
|
203
|
data() {
|
190
|
204
|
return {
|
|
205
|
+ isActive: false,
|
|
206
|
+ aa: ["111111", "22222"],
|
|
207
|
+ Color_txt: true,
|
191
|
208
|
crumbs: [
|
192
|
209
|
{ path: false, name: "采购管理" },
|
193
|
|
- { path: "/supply/query", name: "采购订单" }
|
|
210
|
+ { path: "/supply/query", name: "采购订单" },
|
194
|
211
|
],
|
195
|
212
|
keywords: "",
|
196
|
213
|
total: 0,
|
197
|
214
|
multipleSelection: [],
|
198
|
215
|
signAndWeighBoxPatients: "sign-and-weigh-box-patients",
|
199
|
216
|
start_time: "",
|
200
|
|
- end_time:"",
|
|
217
|
+ end_time: "",
|
201
|
218
|
page: 1,
|
202
|
219
|
limit: 10,
|
203
|
220
|
goodType: [],
|
204
|
221
|
goodInfo: [],
|
205
|
|
- org_id:0,
|
206
|
|
- types:[],
|
207
|
|
- tableList:[{}],
|
208
|
|
- type_name:"",
|
209
|
|
- checkList:[
|
210
|
|
- {id:0,name:"请选择"},
|
211
|
|
- {id:1,name:"已审核"},
|
212
|
|
- {id:2,name:"未审核"},
|
|
222
|
+ org_id: 0,
|
|
223
|
+ types: [],
|
|
224
|
+ tableList: [{}],
|
|
225
|
+ type_name: "",
|
|
226
|
+ checkList: [
|
|
227
|
+ { id: 0, name: "请选择" },
|
|
228
|
+ { id: 1, name: "已审核" },
|
|
229
|
+ { id: 2, name: "未审核" },
|
213
|
230
|
],
|
214
|
|
- supplyList:[],
|
215
|
|
- check_id:0,
|
216
|
|
- doctorList:[],
|
|
231
|
+ supplyList: [],
|
|
232
|
+ check_id: 0,
|
|
233
|
+ doctorList: [],
|
217
|
234
|
};
|
218
|
235
|
},
|
219
|
|
- methods:{
|
220
|
|
- toAdd(){
|
221
|
|
- this.$router.push({path:"/purchase/order/add"})
|
222
|
|
- },
|
223
|
|
- changeTypeName(){
|
224
|
|
- this.getlist()
|
225
|
|
- },
|
226
|
|
- startTimeChange(){
|
227
|
|
- this.getlist()
|
228
|
|
- },
|
229
|
|
- endTimeChange(){
|
230
|
|
- this.getlist()
|
231
|
|
- },
|
232
|
|
- search(){
|
233
|
|
- this.getlist()
|
234
|
|
- },
|
235
|
|
- handleSizeChange(val){
|
236
|
|
- this.limit = val
|
237
|
|
- this.getlist()
|
238
|
|
- },
|
239
|
|
- handleCurrentChange(val){
|
240
|
|
- this.page = val
|
241
|
|
- this.getlist()
|
242
|
|
- },
|
243
|
|
- getAllSupply(){
|
244
|
|
- getAllSupply().then(response=>{
|
245
|
|
- if(response.data.state == 1){
|
246
|
|
- var supplyList = response.data.data.supplyList
|
247
|
|
- this.doctorList = response.data.data.doctorList
|
248
|
|
- for(let i=0;i<supplyList.length;i++){
|
249
|
|
- this.supplyList.push(supplyList[i])
|
250
|
|
- }
|
251
|
|
- }
|
252
|
|
- })
|
253
|
|
- },
|
254
|
|
- getTimes(time) {
|
255
|
|
- if (time === '') {
|
256
|
|
- return ''
|
|
236
|
+ methods: {
|
|
237
|
+ toAdd() {
|
|
238
|
+ this.$router.push({ path: "/purchase/order/add" });
|
|
239
|
+ },
|
|
240
|
+ changeTypeName() {
|
|
241
|
+ this.getlist();
|
|
242
|
+ },
|
|
243
|
+ startTimeChange() {
|
|
244
|
+ this.getlist();
|
|
245
|
+ },
|
|
246
|
+ endTimeChange() {
|
|
247
|
+ this.getlist();
|
|
248
|
+ },
|
|
249
|
+ search() {
|
|
250
|
+ this.getlist();
|
|
251
|
+ },
|
|
252
|
+ handleSizeChange(val) {
|
|
253
|
+ this.limit = val;
|
|
254
|
+ this.getlist();
|
|
255
|
+ },
|
|
256
|
+ handleCurrentChange(val) {
|
|
257
|
+ this.page = val;
|
|
258
|
+ this.getlist();
|
|
259
|
+ },
|
|
260
|
+ getAllSupply() {
|
|
261
|
+ getAllSupply().then((response) => {
|
|
262
|
+ if (response.data.state == 1) {
|
|
263
|
+ var supplyList = response.data.data.supplyList;
|
|
264
|
+ this.doctorList = response.data.data.doctorList;
|
|
265
|
+ for (let i = 0; i < supplyList.length; i++) {
|
|
266
|
+ this.supplyList.push(supplyList[i]);
|
|
267
|
+ }
|
|
268
|
+ }
|
|
269
|
+ });
|
|
270
|
+ },
|
|
271
|
+ getTimes(time) {
|
|
272
|
+ if (time === "") {
|
|
273
|
+ return "";
|
257
|
274
|
}
|
258
|
|
- return uParseTime(time, '{y}-{m}-{d}')
|
259
|
|
- },
|
260
|
|
- getlist(){
|
261
|
|
- var params = {
|
262
|
|
- check_id:this.check_id,
|
263
|
|
- start_time:this.start_time,
|
264
|
|
- end_time:this.end_time,
|
265
|
|
- keyword:this.keywords,
|
266
|
|
- page:this.page,
|
267
|
|
- limit:this.limit,
|
|
275
|
+ return uParseTime(time, "{y}-{m}-{d}");
|
|
276
|
+ },
|
|
277
|
+ getlist() {
|
|
278
|
+ console.log("hhhhhh", this.end_time);
|
|
279
|
+ var params = {
|
|
280
|
+ check_id: this.check_id,
|
|
281
|
+ start_time: this.start_time,
|
|
282
|
+ end_time: this.end_time,
|
|
283
|
+ keyword: this.keywords,
|
|
284
|
+ page: this.page,
|
|
285
|
+ limit: this.limit,
|
|
286
|
+ };
|
|
287
|
+ console.log("params2332232332", params);
|
|
288
|
+ getAllPurchaseOrderList(params).then((response) => {
|
|
289
|
+ if (response.data.state == 1) {
|
|
290
|
+ var list = response.data.data.list;
|
|
291
|
+ this.tableList = list;
|
|
292
|
+ var total = response.data.data.total;
|
|
293
|
+ this.total = total;
|
268
|
294
|
}
|
269
|
|
- console.log("params2332232332",params)
|
270
|
|
- getAllPurchaseOrderList(params).then(response=>{
|
271
|
|
- if(response.data.state == 1){
|
272
|
|
- var list = response.data.data.list
|
273
|
|
- this.tableList = list
|
274
|
|
- var total = response.data.data.total
|
275
|
|
- this.total = total
|
276
|
|
- }
|
277
|
|
- })
|
278
|
|
- },
|
279
|
|
- getName(id){
|
280
|
|
- var name = ""
|
281
|
|
- for(let i=0;i<this.supplyList.length;i++){
|
282
|
|
- if(id == this.supplyList[i].id){
|
283
|
|
- name = this.supplyList[i].supplier_name
|
284
|
|
- }
|
285
|
|
- }
|
286
|
|
- return name
|
287
|
|
- },
|
288
|
|
- getDocName(id){
|
289
|
|
- var user_name = ""
|
290
|
|
- for(let i=0;i<this.doctorList.length;i++){
|
291
|
|
- if(id == this.doctorList[i].admin_user_id){
|
292
|
|
- user_name = this.doctorList[i].user_name
|
|
295
|
+ });
|
|
296
|
+ },
|
|
297
|
+ getName(id) {
|
|
298
|
+ var name = "";
|
|
299
|
+ for (let i = 0; i < this.supplyList.length; i++) {
|
|
300
|
+ if (id == this.supplyList[i].id) {
|
|
301
|
+ name = this.supplyList[i].supplier_name;
|
293
|
302
|
}
|
294
|
303
|
}
|
295
|
|
- return user_name
|
296
|
|
- },
|
297
|
|
- getAllBuyPrice(arr){
|
298
|
|
- var buy_price = 0
|
299
|
|
- if(arr!=undefined && arr.length > 0){
|
300
|
|
- for(let i=0;i<arr.length;i++){
|
301
|
|
- buy_price += (arr[i].count * arr[i].price)
|
302
|
|
- }
|
303
|
|
- }
|
304
|
|
- return buy_price.toFixed(2)
|
305
|
|
- },
|
306
|
|
- getAllCount(arr){
|
307
|
|
- var count = 0
|
308
|
|
- if(arr!=undefined && arr.length > 0){
|
309
|
|
- for(let i=0;i<arr.length;i++){
|
310
|
|
- count += parseInt(arr[i].count)
|
311
|
|
- }
|
312
|
|
- }
|
313
|
|
- if(count == 0){
|
314
|
|
- return ""
|
315
|
|
- }
|
316
|
|
- if(count > 0){
|
317
|
|
- return count
|
318
|
|
- }
|
319
|
|
-
|
320
|
|
- },
|
321
|
|
- toClick(id){
|
322
|
|
- this.$router.push({path:"/purchase/order/edit?id="+id})
|
323
|
|
- },
|
324
|
|
- toDelete(val,index){
|
325
|
|
- if(val.is_check == 1){
|
326
|
|
- this.$message.error("已审核单据,不能删除!")
|
327
|
|
- return false
|
328
|
|
- }
|
329
|
|
- if(val.orderOut.length >0 ){
|
330
|
|
- this.$message.error("已关联单据,不能删除!")
|
331
|
|
- return false
|
332
|
|
- }
|
333
|
|
- this.$confirm('确认删除吗?', '删除', {
|
334
|
|
- confirmButtonText: '确 定',
|
335
|
|
- cancelButtonText: '取 消',
|
336
|
|
- type: 'warning'
|
337
|
|
- }).then(() => {
|
338
|
|
-
|
339
|
|
- deletePurchaseOrder(val.id).then(response => {
|
|
304
|
+ return name;
|
|
305
|
+ },
|
|
306
|
+ getDocName(id) {
|
|
307
|
+ var user_name = "";
|
|
308
|
+ for (let i = 0; i < this.doctorList.length; i++) {
|
|
309
|
+ if (id == this.doctorList[i].admin_user_id) {
|
|
310
|
+ user_name = this.doctorList[i].user_name;
|
|
311
|
+ }
|
|
312
|
+ }
|
|
313
|
+ return user_name;
|
|
314
|
+ },
|
|
315
|
+ getAllBuyPrice(arr) {
|
|
316
|
+ var buy_price = 0;
|
|
317
|
+ if (arr != undefined && arr.length > 0) {
|
|
318
|
+ for (let i = 0; i < arr.length; i++) {
|
|
319
|
+ buy_price += arr[i].count * arr[i].price;
|
|
320
|
+ }
|
|
321
|
+ }
|
|
322
|
+ return buy_price.toFixed(2);
|
|
323
|
+ },
|
|
324
|
+ getAllCount(arr) {
|
|
325
|
+ var count = 0;
|
|
326
|
+ if (arr != undefined && arr.length > 0) {
|
|
327
|
+ for (let i = 0; i < arr.length; i++) {
|
|
328
|
+ count += parseInt(arr[i].count);
|
|
329
|
+ }
|
|
330
|
+ }
|
|
331
|
+ if (count == 0) {
|
|
332
|
+ return "";
|
|
333
|
+ }
|
|
334
|
+ if (count > 0) {
|
|
335
|
+ return count;
|
|
336
|
+ }
|
|
337
|
+ },
|
|
338
|
+ toClick(id) {
|
|
339
|
+ this.$router.push({ path: "/purchase/order/edit?id=" + id });
|
|
340
|
+ },
|
|
341
|
+ toDelete(val, index) {
|
|
342
|
+ if (val.is_check == 1) {
|
|
343
|
+ this.$message.error("已审核单据,不能删除!");
|
|
344
|
+ return false;
|
|
345
|
+ }
|
|
346
|
+ if (val.orderOut.length > 0) {
|
|
347
|
+ this.$message.error("已关联单据,不能删除!");
|
|
348
|
+ return false;
|
|
349
|
+ }
|
|
350
|
+ this.$confirm("确认删除吗?", "删除", {
|
|
351
|
+ confirmButtonText: "确 定",
|
|
352
|
+ cancelButtonText: "取 消",
|
|
353
|
+ type: "warning",
|
|
354
|
+ })
|
|
355
|
+ .then(() => {
|
|
356
|
+ deletePurchaseOrder(val.id).then((response) => {
|
340
|
357
|
if (response.data.state == 1) {
|
341
|
|
- var msg = response.data.data.msg
|
342
|
|
- this.tableList.splice(index, 1);
|
343
|
|
- this.$message.success("删除成功")
|
|
358
|
+ var msg = response.data.data.msg;
|
|
359
|
+ this.tableList.splice(index, 1);
|
|
360
|
+ this.$message.success("删除成功");
|
344
|
361
|
} else {
|
345
|
|
- this.$message.error("删除失败")
|
|
362
|
+ this.$message.error("删除失败");
|
346
|
363
|
}
|
347
|
|
- })
|
|
364
|
+ });
|
348
|
365
|
})
|
349
|
|
- .catch(() => {
|
350
|
|
- })
|
351
|
|
- }
|
|
366
|
+ .catch(() => {});
|
|
367
|
+ },
|
|
368
|
+ // 动态改变表格样式
|
|
369
|
+ Color_Change() {
|
|
370
|
+ this.Color_txt = true;
|
|
371
|
+ console.log(this.Color_txt, "op");
|
|
372
|
+ },
|
|
373
|
+
|
|
374
|
+ Color_Changeleave() {
|
|
375
|
+ this.Color_txt = false;
|
|
376
|
+ console.log(this.Color_txt, "false");
|
|
377
|
+ },
|
352
|
378
|
},
|
353
|
379
|
created() {
|
354
|
|
- var now = new Date(); //当前日期
|
355
|
|
- var nowMonth = now.getMonth(); //当前月
|
356
|
|
- var nowYear = now.getFullYear(); //当前年
|
|
380
|
+ var now = new Date(); //当前日期
|
|
381
|
+ var nowMonth = now.getMonth(); //当前月
|
|
382
|
+ var nowYear = now.getFullYear(); //当前年
|
357
|
383
|
//本月的开始时间
|
358
|
|
- var monthStartDate = new Date(nowYear, nowMonth, 1);
|
359
|
|
- this.start_time = this.getTimes(monthStartDate)
|
360
|
|
- this.end_time = this.getTimes(new Date())
|
361
|
|
- this.org_id = this.$store.getters.xt_user.org_id
|
362
|
|
- this.getAllSupply()
|
363
|
|
- this.getlist()
|
|
384
|
+ var monthStartDate = new Date(nowYear, nowMonth, 1);
|
|
385
|
+ this.start_time = this.getTimes(monthStartDate);
|
|
386
|
+ this.end_time = this.getTimes(new Date());
|
|
387
|
+ this.org_id = this.$store.getters.xt_user.org_id;
|
|
388
|
+ this.getAllSupply();
|
|
389
|
+ this.getlist();
|
364
|
390
|
},
|
365
|
|
-
|
366
|
391
|
};
|
367
|
392
|
</script>
|
368
|
393
|
<style lang="scss">
|
369
|
|
- .cluster-rs {
|
|
394
|
+.cluster-rs {
|
|
395
|
+ text-align: center;
|
|
396
|
+}
|
|
397
|
+.annotation-rs {
|
|
398
|
+ width: 100%;
|
|
399
|
+ height: 100%;
|
|
400
|
+ border: none;
|
|
401
|
+ td {
|
|
402
|
+ width: 155px;
|
|
403
|
+ padding: 5px;
|
|
404
|
+ border-right: none;
|
370
|
405
|
text-align: center;
|
|
406
|
+ vertical-align: middle;
|
371
|
407
|
}
|
372
|
|
- .annotation-rs{
|
373
|
|
- width: 100%;
|
374
|
|
- height: 100%;
|
375
|
|
- border: none;
|
376
|
|
- td{
|
377
|
|
- width: 155px;
|
378
|
|
- padding: 5px;
|
379
|
|
- border-right: none;
|
380
|
|
- text-align: center;
|
381
|
|
- vertical-align: middle;
|
382
|
|
- }
|
383
|
|
- }
|
384
|
|
- tr:last-child{
|
385
|
|
- td{
|
386
|
|
- border-bottom: none;
|
387
|
|
- }
|
|
408
|
+}
|
|
409
|
+tr:last-child {
|
|
410
|
+ td {
|
|
411
|
+ border-bottom: none;
|
388
|
412
|
}
|
|
413
|
+}
|
389
|
414
|
</style>
|
390
|
415
|
|
391
|
416
|
<style rel="stylesheet/css" lang="scss" scoped>
|
|
@@ -439,4 +464,9 @@ export default {
|
439
|
464
|
background-color: #d0d3da;
|
440
|
465
|
}
|
441
|
466
|
|
|
467
|
+.color {
|
|
468
|
+ background: none !important;
|
|
469
|
+ display: flex;
|
|
470
|
+ flex-direction: column;
|
|
471
|
+}
|
442
|
472
|
</style>
|