|
@@ -16,7 +16,8 @@
|
16
|
16
|
icon="el-icon-circle-plus-outline"
|
17
|
17
|
type="primary"
|
18
|
18
|
@click="showInfoDialog"
|
19
|
|
- >新增</el-button
|
|
19
|
+ >新增
|
|
20
|
+ </el-button
|
20
|
21
|
>
|
21
|
22
|
</div>
|
22
|
23
|
|
|
@@ -34,7 +35,8 @@
|
34
|
35
|
type="primary"
|
35
|
36
|
icon="el-icon-search"
|
36
|
37
|
@click="search"
|
37
|
|
- >搜索</el-button
|
|
38
|
+ >搜索
|
|
39
|
+ </el-button
|
38
|
40
|
>
|
39
|
41
|
</div>
|
40
|
42
|
|
|
@@ -134,428 +136,439 @@
|
134
|
136
|
</template>
|
135
|
137
|
|
136
|
138
|
<script>
|
137
|
|
-import GoodInfoDailog from "../Dialog/goodInfoDailog";
|
138
|
|
-import {
|
139
|
|
- createGoodInfo,
|
140
|
|
- deleteGoodInfo,
|
141
|
|
- GetAllDeals,
|
142
|
|
- GetAllGoodType,
|
143
|
|
- GetAllManufacturer,
|
144
|
|
- GetGoodInfo,
|
145
|
|
- GetGoodInfoByGoodId,
|
146
|
|
- getGoodInfoList,
|
147
|
|
- modifyGoodInfo
|
148
|
|
-} from "@/api/stock";
|
|
139
|
+ import GoodInfoDailog from '../Dialog/goodInfoDailog'
|
|
140
|
+ import {
|
|
141
|
+ createGoodInfo,
|
|
142
|
+ deleteGoodInfo,
|
|
143
|
+ GetAllDeals,
|
|
144
|
+ GetAllGoodType,
|
|
145
|
+ GetAllManufacturer,
|
|
146
|
+ GetGoodInfo,
|
|
147
|
+ GetGoodInfoByGoodId,
|
|
148
|
+ getGoodInfoList,
|
|
149
|
+ modifyGoodInfo
|
|
150
|
+ } from '@/api/stock'
|
149
|
151
|
|
150
|
|
-export default {
|
151
|
|
- components: {
|
152
|
|
- GoodInfoDailog
|
153
|
|
- },
|
154
|
|
- name: "goodInfo",
|
155
|
|
- data() {
|
156
|
|
- return {
|
157
|
|
- signAndWeighBoxPatients: "sign-and-weigh-box-patients",
|
158
|
|
- total: 0,
|
159
|
|
- pageTotal: 0,
|
160
|
|
- pageSelect: 0,
|
161
|
|
- page: 1,
|
162
|
|
- limit: 10,
|
163
|
|
- keywords: "",
|
164
|
|
- goodInfo: {
|
165
|
|
- loading: false,
|
166
|
|
- goodInfoData: [],
|
167
|
|
- good_code: "",
|
168
|
|
- editGoodId: "",
|
169
|
|
- editGoodIndex: "",
|
170
|
|
- goodInfoDialog: {
|
171
|
|
- goodInfoTitle: "新增商品信息",
|
172
|
|
- isCreated: 1, //1.创建 2.编辑 3.查看详情
|
173
|
|
- formValue: {
|
174
|
|
- good_id: "",
|
175
|
|
- specification_name: "",
|
176
|
|
- buy_price: "",
|
177
|
|
- sell_price: "",
|
178
|
|
- remark: "",
|
179
|
|
- manufacturer: "",
|
180
|
|
- good_type_id: "",
|
181
|
|
- dealer: "",
|
182
|
|
- expiry_date_warn_day_count: "",
|
183
|
|
- stock_warn_count: "",
|
184
|
|
- is_reuse: "2",
|
185
|
|
- dealers: [],
|
186
|
|
- manufacturers: [],
|
187
|
|
- goodType: [],
|
188
|
|
- goodUnit: []
|
189
|
|
- },
|
|
152
|
+ export default {
|
|
153
|
+ components: {
|
|
154
|
+ GoodInfoDailog
|
|
155
|
+ },
|
|
156
|
+ name: 'goodInfo',
|
|
157
|
+ data() {
|
|
158
|
+ return {
|
|
159
|
+ signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
|
|
160
|
+ total: 0,
|
|
161
|
+ pageTotal: 0,
|
|
162
|
+ pageSelect: 0,
|
|
163
|
+ page: 1,
|
|
164
|
+ limit: 10,
|
|
165
|
+ keywords: '',
|
|
166
|
+ goodInfo: {
|
|
167
|
+ loading: false,
|
|
168
|
+ goodInfoData: [],
|
|
169
|
+ good_code: '',
|
|
170
|
+ editGoodId: '',
|
|
171
|
+ editGoodIndex: '',
|
|
172
|
+ goodInfoDialog: {
|
|
173
|
+ goodInfoTitle: '新增商品信息',
|
|
174
|
+ isCreated: 1, //1.创建 2.编辑 3.查看详情
|
|
175
|
+ formValue: {
|
|
176
|
+ good_id: '',
|
|
177
|
+ specification_name: '',
|
|
178
|
+ buy_price: '',
|
|
179
|
+ sell_price: '',
|
|
180
|
+ remark: '',
|
|
181
|
+ manufacturer: '',
|
|
182
|
+ good_type_id: '',
|
|
183
|
+ dealer: '',
|
|
184
|
+ expiry_date_warn_day_count: '',
|
|
185
|
+ stock_warn_count: '',
|
|
186
|
+ is_reuse: '2',
|
|
187
|
+ dealers: [],
|
|
188
|
+ manufacturers: [],
|
|
189
|
+ goodType: [],
|
|
190
|
+ goodUnit: []
|
|
191
|
+ },
|
190
|
192
|
|
191
|
|
- isVisibility: false
|
|
193
|
+ isVisibility: false
|
|
194
|
+ }
|
192
|
195
|
}
|
193
|
196
|
}
|
194
|
|
- };
|
195
|
|
- },
|
196
|
|
- methods: {
|
197
|
|
- search: function() {
|
198
|
|
- this.getList();
|
199
|
197
|
},
|
200
|
|
- handleGoodInfoEdit: function(index, row) {
|
201
|
|
- this.getAllDealer();
|
202
|
|
- this.getAllManufacturer();
|
203
|
|
- this.getAllGoodType();
|
204
|
|
- this.goodInfo.editGoodId = row.id;
|
205
|
|
- this.goodInfo.editGoodIndex = index;
|
206
|
|
-
|
207
|
|
- let params = {
|
208
|
|
- id: row.id
|
209
|
|
- };
|
210
|
|
- GetGoodInfo(params).then(response => {
|
211
|
|
- if (response.data.state == 0) {
|
212
|
|
- this.$message.error(response.data.msg);
|
213
|
|
- return false;
|
214
|
|
- } else {
|
215
|
|
- console.log(response.data.data.goodInfo);
|
216
|
|
-
|
217
|
|
- if (response.data.data.goodInfo.good_unit <= 0) {
|
218
|
|
- this.goodInfo.goodInfoDialog.formValue.good_unit = "";
|
219
|
|
- } else {
|
220
|
|
- this.goodInfo.goodInfoDialog.formValue.good_unit =
|
221
|
|
- response.data.data.goodInfo.good_unit;
|
222
|
|
- }
|
|
198
|
+ methods: {
|
|
199
|
+ search: function() {
|
|
200
|
+ this.getList()
|
|
201
|
+ },
|
|
202
|
+ handleGoodInfoEdit: function(index, row) {
|
|
203
|
+ this.getAllDealer()
|
|
204
|
+ this.getAllManufacturer()
|
|
205
|
+ this.getAllGoodType()
|
|
206
|
+ this.goodInfo.editGoodId = row.id
|
|
207
|
+ this.goodInfo.editGoodIndex = index
|
223
|
208
|
|
224
|
|
- if (response.data.data.goodInfo.manufacturer <= 0) {
|
225
|
|
- this.goodInfo.goodInfoDialog.formValue.manufacturer = "";
|
|
209
|
+ let params = {
|
|
210
|
+ id: row.id
|
|
211
|
+ }
|
|
212
|
+ GetGoodInfo(params).then(response => {
|
|
213
|
+ if (response.data.state == 0) {
|
|
214
|
+ this.$message.error(response.data.msg)
|
|
215
|
+ return false
|
226
|
216
|
} else {
|
227
|
|
- this.goodInfo.goodInfoDialog.formValue.manufacturer =
|
228
|
|
- response.data.data.goodInfo.manufacturer;
|
229
|
|
- }
|
|
217
|
+ console.log(response.data.data.goodInfo)
|
230
|
218
|
|
231
|
|
- if (response.data.data.goodInfo.dealer <= 0) {
|
232
|
|
- this.goodInfo.goodInfoDialog.formValue.dealer = "";
|
233
|
|
- } else {
|
234
|
|
- this.goodInfo.goodInfoDialog.formValue.dealer =
|
235
|
|
- response.data.data.goodInfo.dealer;
|
236
|
|
- }
|
|
219
|
+ if (response.data.data.goodInfo.good_unit <= 0) {
|
|
220
|
+ this.goodInfo.goodInfoDialog.formValue.good_unit = ''
|
|
221
|
+ } else {
|
|
222
|
+ this.goodInfo.goodInfoDialog.formValue.good_unit =
|
|
223
|
+ response.data.data.goodInfo.good_unit
|
|
224
|
+ }
|
237
|
225
|
|
238
|
|
- this.goodInfo.goodInfoDialog.formValue.specification_name =
|
239
|
|
- response.data.data.goodInfo.specification_name;
|
240
|
|
- this.goodInfo.goodInfoDialog.formValue.buy_price =
|
241
|
|
- response.data.data.goodInfo.buy_price;
|
242
|
|
- this.goodInfo.goodInfoDialog.formValue.sell_price =
|
243
|
|
- response.data.data.goodInfo.sell_price;
|
244
|
|
- this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count =
|
245
|
|
- response.data.data.goodInfo.expiry_date_warn_day_count;
|
246
|
|
- this.goodInfo.goodInfoDialog.formValue.stock_warn_count =
|
247
|
|
- response.data.data.goodInfo.stock_warn_count;
|
248
|
|
- this.goodInfo.goodInfoDialog.formValue.is_reuse = response.data.data.goodInfo.is_reuse.toString();
|
249
|
|
- this.goodInfo.goodInfoDialog.formValue.remark =
|
250
|
|
- response.data.data.goodInfo.remark;
|
251
|
|
- this.goodInfo.goodInfoDialog.isCreated = 2;
|
252
|
|
- this.goodInfo.good_code = response.data.data.goodInfo.good_code;
|
253
|
|
- this.goodInfo.goodInfoDialog.formValue.good_id =
|
254
|
|
- response.data.data.goodInfo.good_type_id;
|
255
|
|
- this.$refs.dialog.show();
|
256
|
|
- }
|
257
|
|
- });
|
258
|
|
- },
|
259
|
|
- handleGoodInfoDelete: function(index, row) {
|
260
|
|
- this.$confirm("确认删除这条商品信息?", "删除商品信息", {
|
261
|
|
- confirmButtonText: "确定",
|
262
|
|
- cancelButtonText: "取消",
|
263
|
|
- type: "warning"
|
264
|
|
- })
|
265
|
|
- .then(() => {
|
266
|
|
- let params = {
|
267
|
|
- id: row.id
|
268
|
|
- };
|
|
226
|
+ if (response.data.data.goodInfo.manufacturer <= 0) {
|
|
227
|
+ this.goodInfo.goodInfoDialog.formValue.manufacturer = ''
|
|
228
|
+ } else {
|
|
229
|
+ this.goodInfo.goodInfoDialog.formValue.manufacturer =
|
|
230
|
+ response.data.data.goodInfo.manufacturer
|
|
231
|
+ }
|
269
|
232
|
|
270
|
|
- deleteGoodInfo(params).then(response => {
|
271
|
|
- if (response.data.state == 0) {
|
272
|
|
- this.$message.error(response.data.msg);
|
273
|
|
- return false;
|
|
233
|
+ if (response.data.data.goodInfo.dealer <= 0) {
|
|
234
|
+ this.goodInfo.goodInfoDialog.formValue.dealer = ''
|
274
|
235
|
} else {
|
275
|
|
- this.goodInfo.goodInfoData.splice(index, 1);
|
276
|
|
- this.$message.success("删除成功");
|
|
236
|
+ this.goodInfo.goodInfoDialog.formValue.dealer =
|
|
237
|
+ response.data.data.goodInfo.dealer
|
277
|
238
|
}
|
278
|
|
- });
|
|
239
|
+
|
|
240
|
+ this.goodInfo.goodInfoDialog.formValue.specification_name =
|
|
241
|
+ response.data.data.goodInfo.specification_name
|
|
242
|
+ this.goodInfo.goodInfoDialog.formValue.buy_price =
|
|
243
|
+ response.data.data.goodInfo.buy_price
|
|
244
|
+ this.goodInfo.goodInfoDialog.formValue.sell_price =
|
|
245
|
+ response.data.data.goodInfo.sell_price
|
|
246
|
+ this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count =
|
|
247
|
+ response.data.data.goodInfo.expiry_date_warn_day_count
|
|
248
|
+ this.goodInfo.goodInfoDialog.formValue.stock_warn_count =
|
|
249
|
+ response.data.data.goodInfo.stock_warn_count
|
|
250
|
+ this.goodInfo.goodInfoDialog.formValue.is_reuse = response.data.data.goodInfo.is_reuse.toString()
|
|
251
|
+ this.goodInfo.goodInfoDialog.formValue.remark =
|
|
252
|
+ response.data.data.goodInfo.remark
|
|
253
|
+ this.goodInfo.goodInfoDialog.isCreated = 2
|
|
254
|
+ this.goodInfo.good_code = response.data.data.goodInfo.good_code
|
|
255
|
+ this.goodInfo.goodInfoDialog.formValue.good_id =
|
|
256
|
+ response.data.data.goodInfo.good_type_id
|
|
257
|
+ this.$refs.dialog.show()
|
|
258
|
+ }
|
279
|
259
|
})
|
280
|
|
- .catch(() => {});
|
281
|
|
- },
|
282
|
|
- showGoodInfoDetails: function(index, row) {
|
283
|
|
- let params = {
|
284
|
|
- id: row.id
|
285
|
|
- };
|
286
|
|
- GetGoodInfo(params).then(response => {
|
287
|
|
- if (response.data.state == 0) {
|
288
|
|
- this.$message.error(response.data.msg);
|
289
|
|
- return false;
|
290
|
|
- } else {
|
291
|
|
- this.goodInfo.goodInfoDialog.formValue.specification_name =
|
292
|
|
- response.data.data.goodInfo.specification_name;
|
293
|
|
- this.goodInfo.goodInfoDialog.formValue.good_unit =
|
294
|
|
- response.data.data.goodInfo.good_unit;
|
295
|
|
- this.goodInfo.goodInfoDialog.formValue.buy_price =
|
296
|
|
- response.data.data.goodInfo.buy_price;
|
297
|
|
- this.goodInfo.goodInfoDialog.formValue.sell_price =
|
298
|
|
- response.data.data.goodInfo.sell_price;
|
299
|
|
- this.goodInfo.goodInfoDialog.formValue.manufacturer =
|
300
|
|
- response.data.data.goodInfo.manufacturer;
|
301
|
|
- this.goodInfo.goodInfoDialog.formValue.dealer =
|
302
|
|
- response.data.data.goodInfo.dealer;
|
303
|
|
- this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count =
|
304
|
|
- response.data.data.goodInfo.expiry_date_warn_day_count;
|
305
|
|
- this.goodInfo.goodInfoDialog.formValue.stock_warn_count =
|
306
|
|
- response.data.data.goodInfo.stock_warn_count;
|
307
|
|
- this.goodInfo.goodInfoDialog.formValue.is_reuse = response.data.data.goodInfo.is_reuse.toString();
|
|
260
|
+ },
|
|
261
|
+ handleGoodInfoDelete: function(index, row) {
|
|
262
|
+ this.$confirm('确认删除这条商品信息?', '删除商品信息', {
|
|
263
|
+ confirmButtonText: '确定',
|
|
264
|
+ cancelButtonText: '取消',
|
|
265
|
+ type: 'warning'
|
|
266
|
+ })
|
|
267
|
+ .then(() => {
|
|
268
|
+ let params = {
|
|
269
|
+ id: row.id
|
|
270
|
+ }
|
308
|
271
|
|
309
|
|
- this.goodInfo.goodInfoDialog.formValue.remark =
|
310
|
|
- response.data.data.goodInfo.remark;
|
311
|
|
- this.goodInfo.goodInfoDialog.isCreated = 3;
|
312
|
|
- this.goodInfo.goodInfoDialog.isVisibility = true;
|
|
272
|
+ deleteGoodInfo(params).then(response => {
|
|
273
|
+ if (response.data.state == 0) {
|
|
274
|
+ this.$message.error(response.data.msg)
|
|
275
|
+ return false
|
|
276
|
+ } else {
|
|
277
|
+ this.goodInfo.goodInfoData.splice(index, 1)
|
|
278
|
+ this.$message.success('删除成功')
|
|
279
|
+ }
|
|
280
|
+ })
|
|
281
|
+ })
|
|
282
|
+ .catch(() => {
|
|
283
|
+ })
|
|
284
|
+ },
|
|
285
|
+ showGoodInfoDetails: function(index, row) {
|
|
286
|
+ let params = {
|
|
287
|
+ id: row.id
|
313
|
288
|
}
|
314
|
|
- });
|
315
|
|
- },
|
316
|
|
- getList() {
|
317
|
|
- this.goodInfo.loading = true;
|
318
|
|
- let params = {
|
319
|
|
- page: this.page,
|
320
|
|
- limit: this.limit,
|
321
|
|
- keyword: this.keywords
|
322
|
|
- };
|
323
|
|
- getGoodInfoList(params).then(response => {
|
324
|
|
- if (response.data.state == 0) {
|
325
|
|
- this.goodInfo.loading = false;
|
326
|
|
- this.$message.error(response.data.msg);
|
327
|
|
- return false;
|
328
|
|
- } else {
|
329
|
|
- this.goodInfo.loading = false;
|
330
|
|
- this.total = response.data.data.total;
|
331
|
|
- this.goodInfo.goodInfoData = [];
|
332
|
|
- for (let i = 0; i < response.data.data.list.length; i++) {
|
333
|
|
- this.goodInfo.goodInfoData.push(response.data.data.list[i]);
|
|
289
|
+ GetGoodInfo(params).then(response => {
|
|
290
|
+ if (response.data.state == 0) {
|
|
291
|
+ this.$message.error(response.data.msg)
|
|
292
|
+ return false
|
|
293
|
+ } else {
|
|
294
|
+ this.goodInfo.goodInfoDialog.formValue.specification_name =
|
|
295
|
+ response.data.data.goodInfo.specification_name
|
|
296
|
+ this.goodInfo.goodInfoDialog.formValue.good_unit =
|
|
297
|
+ response.data.data.goodInfo.good_unit
|
|
298
|
+ this.goodInfo.goodInfoDialog.formValue.buy_price =
|
|
299
|
+ response.data.data.goodInfo.buy_price
|
|
300
|
+ this.goodInfo.goodInfoDialog.formValue.sell_price =
|
|
301
|
+ response.data.data.goodInfo.sell_price
|
|
302
|
+ this.goodInfo.goodInfoDialog.formValue.manufacturer =
|
|
303
|
+ response.data.data.goodInfo.manufacturer
|
|
304
|
+ this.goodInfo.goodInfoDialog.formValue.dealer =
|
|
305
|
+ response.data.data.goodInfo.dealer
|
|
306
|
+ this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count =
|
|
307
|
+ response.data.data.goodInfo.expiry_date_warn_day_count
|
|
308
|
+ this.goodInfo.goodInfoDialog.formValue.stock_warn_count =
|
|
309
|
+ response.data.data.goodInfo.stock_warn_count
|
|
310
|
+ this.goodInfo.goodInfoDialog.formValue.is_reuse = response.data.data.goodInfo.is_reuse.toString()
|
|
311
|
+
|
|
312
|
+ this.goodInfo.goodInfoDialog.formValue.remark =
|
|
313
|
+ response.data.data.goodInfo.remark
|
|
314
|
+ this.goodInfo.goodInfoDialog.isCreated = 3
|
|
315
|
+ this.goodInfo.goodInfoDialog.isVisibility = true
|
334
|
316
|
}
|
|
317
|
+ })
|
|
318
|
+ },
|
|
319
|
+ getList() {
|
|
320
|
+ this.goodInfo.loading = true
|
|
321
|
+ let params = {
|
|
322
|
+ page: this.page,
|
|
323
|
+ limit: this.limit,
|
|
324
|
+ keyword: this.keywords
|
335
|
325
|
}
|
336
|
|
- });
|
337
|
|
- },
|
338
|
|
- tableRowClassName({ row, rowIndex }) {
|
339
|
|
- //把每一行的索引放进row
|
340
|
|
- row.index = rowIndex;
|
341
|
|
- },
|
342
|
|
- onRowClick(row, event, column) {
|
343
|
|
- this.goodInfo.goodInfoData = [];
|
344
|
|
- this.goodType.tableCurrentIndex = row.index;
|
345
|
|
- this.goodInfo.goodInfoDialog.formValue.good_id = row.id;
|
346
|
|
- let params = {
|
347
|
|
- id: row.id
|
348
|
|
- };
|
349
|
|
- this.goodInfo.loading = true;
|
350
|
|
- GetGoodInfoByGoodId(params).then(response => {
|
351
|
|
- if (response.data.state == 0) {
|
352
|
|
- this.goodInfo.loading = false;
|
353
|
|
- this.$message.error(response.data.msg);
|
354
|
|
- return false;
|
355
|
|
- } else {
|
356
|
|
- this.goodInfo.loading = false;
|
357
|
|
- for (let i = 0; i < response.data.data.list.length; i++) {
|
358
|
|
- this.goodInfo.goodInfoData.push(response.data.data.list[i]);
|
|
326
|
+ getGoodInfoList(params).then(response => {
|
|
327
|
+ if (response.data.state == 0) {
|
|
328
|
+ this.goodInfo.loading = false
|
|
329
|
+ this.$message.error(response.data.msg)
|
|
330
|
+ return false
|
|
331
|
+ } else {
|
|
332
|
+ this.goodInfo.loading = false
|
|
333
|
+ this.total = response.data.data.total
|
|
334
|
+ this.goodInfo.goodInfoData = []
|
|
335
|
+ for (let i = 0; i < response.data.data.list.length; i++) {
|
|
336
|
+ this.goodInfo.goodInfoData.push(response.data.data.list[i])
|
|
337
|
+ }
|
359
|
338
|
}
|
|
339
|
+ })
|
|
340
|
+ },
|
|
341
|
+ tableRowClassName({ row, rowIndex }) {
|
|
342
|
+ //把每一行的索引放进row
|
|
343
|
+ row.index = rowIndex
|
|
344
|
+ },
|
|
345
|
+ onRowClick(row, event, column) {
|
|
346
|
+ this.goodInfo.goodInfoData = []
|
|
347
|
+ this.goodType.tableCurrentIndex = row.index
|
|
348
|
+ this.goodInfo.goodInfoDialog.formValue.good_id = row.id
|
|
349
|
+ let params = {
|
|
350
|
+ id: row.id
|
360
|
351
|
}
|
361
|
|
- });
|
362
|
|
- },
|
363
|
|
- goodInfoDialogComfirm: function(val) {
|
364
|
|
- if (val.isCreated == 2) {
|
365
|
|
- //修改
|
366
|
|
- val["id"] = this.goodInfo.editGoodId;
|
367
|
|
- val["good_code"] = this.goodInfo.good_code;
|
368
|
|
-
|
369
|
|
- modifyGoodInfo(val).then(response => {
|
|
352
|
+ this.goodInfo.loading = true
|
|
353
|
+ GetGoodInfoByGoodId(params).then(response => {
|
370
|
354
|
if (response.data.state == 0) {
|
371
|
|
- this.$message.error(response.data.msg);
|
372
|
|
- return false;
|
|
355
|
+ this.goodInfo.loading = false
|
|
356
|
+ this.$message.error(response.data.msg)
|
|
357
|
+ return false
|
373
|
358
|
} else {
|
374
|
|
- this.$refs.dialog.hide();
|
|
359
|
+ this.goodInfo.loading = false
|
|
360
|
+ for (let i = 0; i < response.data.data.list.length; i++) {
|
|
361
|
+ this.goodInfo.goodInfoData.push(response.data.data.list[i])
|
|
362
|
+ }
|
|
363
|
+ }
|
|
364
|
+ })
|
|
365
|
+ },
|
|
366
|
+ goodInfoDialogComfirm: function(val) {
|
|
367
|
+ if (val.isCreated == 2) {
|
|
368
|
+ //修改
|
|
369
|
+ val['id'] = this.goodInfo.editGoodId
|
|
370
|
+ val['good_code'] = this.goodInfo.good_code
|
375
|
371
|
|
376
|
|
- this.goodInfo.goodInfoData[
|
377
|
|
- this.goodInfo.editGoodIndex
|
378
|
|
- ].specification_name =
|
379
|
|
- response.data.data.goodInfo.specification_name;
|
380
|
|
- this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].good_unit =
|
381
|
|
- response.data.data.goodInfo.good_unit;
|
382
|
|
- this.goodInfo.goodInfoData[
|
383
|
|
- this.goodInfo.editGoodIndex
|
384
|
|
- ].buy_price = response.data.data.goodInfo.buy_price.toString();
|
385
|
|
- this.goodInfo.goodInfoData[
|
386
|
|
- this.goodInfo.editGoodIndex
|
387
|
|
- ].sell_price = response.data.data.goodInfo.sell_price.toString();
|
388
|
|
- this.goodInfo.goodInfoData[
|
389
|
|
- this.goodInfo.editGoodIndex
|
390
|
|
- ].expiry_date_warn_day_count = response.data.data.goodInfo.expiry_date_warn_day_count.toString();
|
391
|
|
- this.goodInfo.goodInfoData[
|
392
|
|
- this.goodInfo.editGoodIndex
|
393
|
|
- ].stock_warn_count = response.data.data.goodInfo.stock_warn_count.toString();
|
|
372
|
+ modifyGoodInfo(val).then(response => {
|
|
373
|
+ if (response.data.state == 0) {
|
|
374
|
+ this.$message.error(response.data.msg)
|
|
375
|
+ return false
|
|
376
|
+ } else {
|
|
377
|
+ this.$refs.dialog.hide()
|
394
|
378
|
|
395
|
|
- this.$message.success("修改成功");
|
396
|
|
- }
|
397
|
|
- });
|
398
|
|
- } else if (val.isCreated == 1) {
|
399
|
|
- //新增
|
400
|
|
- createGoodInfo(val).then(response => {
|
401
|
|
- if (response.data.state == 0) {
|
402
|
|
- this.$message.error(response.data.msg);
|
403
|
|
- return false;
|
404
|
|
- } else {
|
405
|
|
- this.$refs.dialog.hide();
|
|
379
|
+ this.goodInfo.goodInfoData[
|
|
380
|
+ this.goodInfo.editGoodIndex
|
|
381
|
+ ].specification_name =
|
|
382
|
+ response.data.data.goodInfo.specification_name
|
|
383
|
+ this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].good_unit =
|
|
384
|
+ response.data.data.goodInfo.good_unit
|
|
385
|
+ this.goodInfo.goodInfoData[
|
|
386
|
+ this.goodInfo.editGoodIndex
|
|
387
|
+ ].buy_price = response.data.data.goodInfo.buy_price.toString()
|
|
388
|
+ this.goodInfo.goodInfoData[
|
|
389
|
+ this.goodInfo.editGoodIndex
|
|
390
|
+ ].sell_price = response.data.data.goodInfo.sell_price.toString()
|
|
391
|
+ this.goodInfo.goodInfoData[
|
|
392
|
+ this.goodInfo.editGoodIndex
|
|
393
|
+ ].expiry_date_warn_day_count = response.data.data.goodInfo.expiry_date_warn_day_count.toString()
|
|
394
|
+ this.goodInfo.goodInfoData[
|
|
395
|
+ this.goodInfo.editGoodIndex
|
|
396
|
+ ].stock_warn_count = response.data.data.goodInfo.stock_warn_count.toString()
|
406
|
397
|
|
407
|
|
- this.goodInfo.goodInfoData.unshift(response.data.data.goodInfo);
|
|
398
|
+ this.$message.success('修改成功')
|
|
399
|
+ }
|
|
400
|
+ })
|
|
401
|
+ } else if (val.isCreated == 1) {
|
|
402
|
+ //新增
|
|
403
|
+ createGoodInfo(val).then(response => {
|
|
404
|
+ if (response.data.state == 0) {
|
|
405
|
+ this.$message.error(response.data.msg)
|
|
406
|
+ return false
|
|
407
|
+ } else {
|
|
408
|
+ this.$refs.dialog.hide()
|
408
|
409
|
|
409
|
|
- this.$message.success("新增成功");
|
410
|
|
- }
|
411
|
|
- });
|
412
|
|
- }
|
413
|
|
- },
|
414
|
|
- goodInfoDialogCancle: function() {
|
415
|
|
- this.$refs.dialog.hide();
|
416
|
|
- },
|
417
|
|
- showInfoDialog: function() {
|
418
|
|
- this.$refs.dialog.show();
|
419
|
|
- this.getAllDealer();
|
420
|
|
- this.getAllManufacturer();
|
421
|
|
- this.goodInfo.goodInfoDialog.formValue.goodType = [];
|
422
|
|
- GetAllGoodType().then(response => {
|
423
|
|
- if (response.data.state == 0) {
|
424
|
|
- this.$message.error(response.data.msg);
|
425
|
|
- return false;
|
426
|
|
- } else {
|
427
|
|
- for (let i = 0; i < response.data.data.goodType.length; i++) {
|
428
|
|
- this.goodInfo.goodInfoDialog.formValue.goodType.push(
|
429
|
|
- response.data.data.goodType[i]
|
430
|
|
- );
|
431
|
|
- }
|
432
|
|
- if (this.goodInfo.goodInfoDialog.formValue.goodType.length <= 0) {
|
433
|
|
- this.$message.error("请先新增商品类型");
|
434
|
|
- return;
|
|
410
|
+ this.goodInfo.goodInfoData.unshift(response.data.data.goodInfo)
|
|
411
|
+
|
|
412
|
+ this.$message.success('新增成功')
|
|
413
|
+ }
|
|
414
|
+ })
|
|
415
|
+ }
|
|
416
|
+ },
|
|
417
|
+ goodInfoDialogCancle: function() {
|
|
418
|
+ this.$refs.dialog.hide()
|
|
419
|
+ },
|
|
420
|
+ showInfoDialog: function() {
|
|
421
|
+ this.$refs.dialog.show()
|
|
422
|
+ this.getAllDealer()
|
|
423
|
+ this.getAllManufacturer()
|
|
424
|
+ this.goodInfo.goodInfoDialog.formValue.goodType = []
|
|
425
|
+ GetAllGoodType().then(response => {
|
|
426
|
+ if (response.data.state == 0) {
|
|
427
|
+ this.$message.error(response.data.msg)
|
|
428
|
+ return false
|
435
|
429
|
} else {
|
436
|
|
- this.goodInfo.goodInfoDialog.isVisibility = true;
|
437
|
|
- this.goodInfo.goodInfoDialog.isCreated = 1;
|
|
430
|
+ for (let i = 0; i < response.data.data.goodType.length; i++) {
|
|
431
|
+ if (response.data.data.goodType[i].type == 1) {
|
|
432
|
+ response.data.data.goodType[i].type_name = response.data.data.goodType[i].type_name + '(系统设定)'
|
|
433
|
+ }
|
|
434
|
+ this.goodInfo.goodInfoDialog.formValue.goodType.push(
|
|
435
|
+ response.data.data.goodType[i]
|
|
436
|
+ )
|
|
437
|
+ }
|
|
438
|
+ if (this.goodInfo.goodInfoDialog.formValue.goodType.length <= 0) {
|
|
439
|
+ this.$message.error('请先新增商品类型')
|
|
440
|
+ return
|
|
441
|
+ } else {
|
|
442
|
+ this.goodInfo.goodInfoDialog.isVisibility = true
|
|
443
|
+ this.goodInfo.goodInfoDialog.isCreated = 1
|
|
444
|
+ }
|
438
|
445
|
}
|
439
|
|
- }
|
440
|
|
- });
|
441
|
|
- this.goodInfo.goodInfoDialog.formValue.good_id = "";
|
442
|
|
- this.goodInfo.goodInfoDialog.formValue.specification_name = "";
|
443
|
|
- this.goodInfo.goodInfoDialog.formValue.buy_price = "";
|
444
|
|
- this.goodInfo.goodInfoDialog.formValue.sell_price = "";
|
445
|
|
- this.goodInfo.goodInfoDialog.formValue.remark = "";
|
446
|
|
- this.goodInfo.goodInfoDialog.formValue.manufacturer = "";
|
447
|
|
- this.goodInfo.goodInfoDialog.formValue.good_type_id = "";
|
448
|
|
- this.goodInfo.goodInfoDialog.formValue.dealer = "";
|
449
|
|
- this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count = "";
|
450
|
|
- this.goodInfo.goodInfoDialog.formValue.stock_warn_count = "";
|
451
|
|
- this.goodInfo.goodInfoDialog.formValue.is_reuse = "2";
|
452
|
|
- },
|
453
|
|
- getAllDealer: function() {
|
454
|
|
- this.goodInfo.goodInfoDialog.formValue.dealers = [];
|
455
|
|
- GetAllDeals().then(response => {
|
456
|
|
- if (response.data.state == 0) {
|
457
|
|
- this.$message.error(response.data.msg);
|
458
|
|
- return false;
|
459
|
|
- } else {
|
460
|
|
- for (let i = 0; i < response.data.data.dealer.length; i++) {
|
461
|
|
- this.goodInfo.goodInfoDialog.formValue.dealers.push(
|
462
|
|
- response.data.data.dealer[i]
|
463
|
|
- );
|
|
446
|
+ })
|
|
447
|
+ this.goodInfo.goodInfoDialog.formValue.good_id = ''
|
|
448
|
+ this.goodInfo.goodInfoDialog.formValue.specification_name = ''
|
|
449
|
+ this.goodInfo.goodInfoDialog.formValue.buy_price = ''
|
|
450
|
+ this.goodInfo.goodInfoDialog.formValue.sell_price = ''
|
|
451
|
+ this.goodInfo.goodInfoDialog.formValue.remark = ''
|
|
452
|
+ this.goodInfo.goodInfoDialog.formValue.manufacturer = ''
|
|
453
|
+ this.goodInfo.goodInfoDialog.formValue.good_type_id = ''
|
|
454
|
+ this.goodInfo.goodInfoDialog.formValue.dealer = ''
|
|
455
|
+ this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count = ''
|
|
456
|
+ this.goodInfo.goodInfoDialog.formValue.stock_warn_count = ''
|
|
457
|
+ this.goodInfo.goodInfoDialog.formValue.is_reuse = '2'
|
|
458
|
+ },
|
|
459
|
+ getAllDealer: function() {
|
|
460
|
+ this.goodInfo.goodInfoDialog.formValue.dealers = []
|
|
461
|
+ GetAllDeals().then(response => {
|
|
462
|
+ if (response.data.state == 0) {
|
|
463
|
+ this.$message.error(response.data.msg)
|
|
464
|
+ return false
|
|
465
|
+ } else {
|
|
466
|
+ for (let i = 0; i < response.data.data.dealer.length; i++) {
|
|
467
|
+ this.goodInfo.goodInfoDialog.formValue.dealers.push(
|
|
468
|
+ response.data.data.dealer[i]
|
|
469
|
+ )
|
|
470
|
+ }
|
464
|
471
|
}
|
465
|
|
- }
|
466
|
|
- });
|
467
|
|
- },
|
468
|
|
- getAllManufacturer: function() {
|
469
|
|
- this.goodInfo.goodInfoDialog.formValue.manufacturers = [];
|
470
|
|
- GetAllManufacturer().then(response => {
|
471
|
|
- if (response.data.state == 0) {
|
472
|
|
- this.$message.error(response.data.msg);
|
473
|
|
- return false;
|
474
|
|
- } else {
|
475
|
|
- for (let i = 0; i < response.data.data.manufacturer.length; i++) {
|
476
|
|
- this.goodInfo.goodInfoDialog.formValue.manufacturers.push(
|
477
|
|
- response.data.data.manufacturer[i]
|
478
|
|
- );
|
|
472
|
+ })
|
|
473
|
+ },
|
|
474
|
+ getAllManufacturer: function() {
|
|
475
|
+ this.goodInfo.goodInfoDialog.formValue.manufacturers = []
|
|
476
|
+ GetAllManufacturer().then(response => {
|
|
477
|
+ if (response.data.state == 0) {
|
|
478
|
+ this.$message.error(response.data.msg)
|
|
479
|
+ return false
|
|
480
|
+ } else {
|
|
481
|
+ for (let i = 0; i < response.data.data.manufacturer.length; i++) {
|
|
482
|
+ this.goodInfo.goodInfoDialog.formValue.manufacturers.push(
|
|
483
|
+ response.data.data.manufacturer[i]
|
|
484
|
+ )
|
|
485
|
+ }
|
479
|
486
|
}
|
480
|
|
- }
|
481
|
|
- });
|
482
|
|
- },
|
483
|
|
- getAllGoodType: function() {
|
484
|
|
- this.goodInfo.goodInfoDialog.formValue.goodType = [];
|
485
|
|
- GetAllGoodType().then(response => {
|
486
|
|
- if (response.data.state == 0) {
|
487
|
|
- this.$message.error(response.data.msg);
|
488
|
|
- return false;
|
489
|
|
- } else {
|
490
|
|
- for (let i = 0; i < response.data.data.goodType.length; i++) {
|
491
|
|
- this.goodInfo.goodInfoDialog.formValue.goodType.push(
|
492
|
|
- response.data.data.goodType[i]
|
493
|
|
- );
|
|
487
|
+ })
|
|
488
|
+ },
|
|
489
|
+ getAllGoodType: function() {
|
|
490
|
+ this.goodInfo.goodInfoDialog.formValue.goodType = []
|
|
491
|
+ GetAllGoodType().then(response => {
|
|
492
|
+ if (response.data.state == 0) {
|
|
493
|
+ this.$message.error(response.data.msg)
|
|
494
|
+ return false
|
|
495
|
+ } else {
|
|
496
|
+ for (let i = 0; i < response.data.data.goodType.length; i++) {
|
|
497
|
+ if (response.data.data.goodType[i].type == 1) {
|
|
498
|
+ response.data.data.goodType[i].type_name = response.data.data.goodType[i].type_name + '(系统设定)'
|
|
499
|
+ }
|
|
500
|
+ this.goodInfo.goodInfoDialog.formValue.goodType.push(
|
|
501
|
+ response.data.data.goodType[i]
|
|
502
|
+ )
|
|
503
|
+ console.log(this.goodInfo.goodInfoDialog.formValue.goodType)
|
|
504
|
+ }
|
494
|
505
|
}
|
495
|
|
- }
|
496
|
|
- });
|
497
|
|
- },
|
498
|
|
- handleSizeChange(val) {
|
499
|
|
- this.limit = val;
|
500
|
|
- this.getList();
|
|
506
|
+ })
|
|
507
|
+ },
|
|
508
|
+ handleSizeChange(val) {
|
|
509
|
+ this.limit = val
|
|
510
|
+ this.getList()
|
|
511
|
+ },
|
|
512
|
+ handleCurrentChange(val) {
|
|
513
|
+ this.page = val
|
|
514
|
+ this.getList()
|
|
515
|
+ }
|
501
|
516
|
},
|
502
|
|
- handleCurrentChange(val) {
|
503
|
|
- this.page = val;
|
504
|
|
- this.getList();
|
|
517
|
+ created() {
|
|
518
|
+ this.getList()
|
|
519
|
+ // this.getAllDealer()
|
|
520
|
+ // this.getAllManufacturer()
|
|
521
|
+ // this.getAllGoodType()
|
|
522
|
+ this.goodInfo.goodInfoDialog.formValue.goodUnit = this.$store.getters.good_unit
|
505
|
523
|
}
|
506
|
|
- },
|
507
|
|
- created() {
|
508
|
|
- this.getList();
|
509
|
|
- // this.getAllDealer()
|
510
|
|
- // this.getAllManufacturer()
|
511
|
|
- // this.getAllGoodType()
|
512
|
|
- this.goodInfo.goodInfoDialog.formValue.goodUnit = this.$store.getters.good_unit;
|
513
|
524
|
}
|
514
|
|
-};
|
515
|
525
|
</script>
|
516
|
526
|
|
517
|
527
|
<style rel="stylesheet/css" lang="scss" scoped>
|
518
|
|
-.information {
|
519
|
|
- border: 1px #dcdfe6 solid;
|
520
|
|
- padding: 30px 20px 30px 20px;
|
|
528
|
+ .information {
|
|
529
|
+ border: 1px #dcdfe6 solid;
|
|
530
|
+ padding: 30px 20px 30px 20px;
|
521
|
531
|
|
522
|
532
|
.border {
|
523
|
533
|
border-bottom: 1px #dcdfe6 solid;
|
524
|
534
|
margin: 0px 0 20px 0;
|
525
|
535
|
}
|
526
|
|
-}
|
527
|
536
|
|
528
|
|
-.title {
|
529
|
|
- height: 44px;
|
530
|
|
- line-height: 44px;
|
531
|
|
- padding: 0 0 0 10px;
|
532
|
|
- margin: 0 0 10px 0;
|
533
|
|
-}
|
|
537
|
+ }
|
|
538
|
+
|
|
539
|
+ .title {
|
|
540
|
+ height: 44px;
|
|
541
|
+ line-height: 44px;
|
|
542
|
+ padding: 0 0 0 10px;
|
|
543
|
+ margin: 0 0 10px 0;
|
|
544
|
+ }
|
534
|
545
|
|
535
|
|
-.edit_separater {
|
536
|
|
- border-top: 1px solid rgb(233, 233, 233);
|
537
|
|
- margin-top: 15px;
|
538
|
|
- margin-bottom: 15px;
|
539
|
|
-}
|
|
546
|
+ .edit_separater {
|
|
547
|
+ border-top: 1px solid rgb(233, 233, 233);
|
|
548
|
+ margin-top: 15px;
|
|
549
|
+ margin-bottom: 15px;
|
|
550
|
+ }
|
540
|
551
|
</style>
|
541
|
552
|
|
542
|
553
|
<style>
|
543
|
|
-.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
|
544
|
|
- font-size: 12px;
|
545
|
|
-}
|
|
554
|
+ .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
|
|
555
|
+ font-size: 12px;
|
|
556
|
+ }
|
|
557
|
+
|
|
558
|
+ .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
|
|
559
|
+ background: #6fb5fa;
|
|
560
|
+ }
|
546
|
561
|
|
547
|
|
-.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
|
548
|
|
- background: #6fb5fa;
|
549
|
|
-}
|
550
|
|
-.el-table td,
|
551
|
|
-.el-table th.is-leaf,
|
552
|
|
-.el-table--border,
|
553
|
|
-.el-table--group {
|
554
|
|
- border-color: #d0d3da;
|
555
|
|
-}
|
556
|
|
-.el-table--border::after,
|
557
|
|
-.el-table--group::after,
|
558
|
|
-.el-table::before {
|
559
|
|
- background-color: #d0d3da;
|
560
|
|
-}
|
|
562
|
+ .el-table td,
|
|
563
|
+ .el-table th.is-leaf,
|
|
564
|
+ .el-table--border,
|
|
565
|
+ .el-table--group {
|
|
566
|
+ border-color: #d0d3da;
|
|
567
|
+ }
|
|
568
|
+
|
|
569
|
+ .el-table--border::after,
|
|
570
|
+ .el-table--group::after,
|
|
571
|
+ .el-table::before {
|
|
572
|
+ background-color: #d0d3da;
|
|
573
|
+ }
|
561
|
574
|
</style>
|