|
|
@@ -2,9 +2,9 @@
|
|
|
<div>
|
|
|
<el-table :data="setList" ref="table">
|
|
|
<el-table-column v-if="multipleMode" align="center" type="selection" width="50"> </el-table-column>
|
|
|
- <el-table-column prop="name" label="名称" min-width="120px"> </el-table-column>
|
|
|
+ <el-table-column prop="goodsInfo.name" label="名称" min-width="120px"> </el-table-column>
|
|
|
<el-table-column prop="num" label="数量"> </el-table-column>
|
|
|
- <el-table-column prop="unit" label="单位"> </el-table-column>
|
|
|
+ <el-table-column prop="goodsInfo.unit" label="单位"> </el-table-column>
|
|
|
<el-table-column prop="price" label="价格"> </el-table-column>
|
|
|
<el-table-column prop="remark" label="备注" min-width="100px"> </el-table-column>
|
|
|
<el-table-column label="操作" align="center" fixed="right" min-width="150">
|
|
|
@@ -102,7 +102,7 @@ export default {
|
|
|
},
|
|
|
addRow() {
|
|
|
this.$router.push({
|
|
|
- path: '/setGoodsEdit',
|
|
|
+ path: '/packageGoodsEdit',
|
|
|
query: {
|
|
|
...this.$route.query
|
|
|
}
|
|
|
@@ -122,7 +122,7 @@ export default {
|
|
|
download() {
|
|
|
this.downloading = true;
|
|
|
this.$axios
|
|
|
- .get('/setGoods/excel', {
|
|
|
+ .get('/packageGoods/excel', {
|
|
|
responseType: 'blob',
|
|
|
params: { size: 10000 }
|
|
|
})
|
|
|
@@ -155,11 +155,11 @@ export default {
|
|
|
deleteRow(row) {
|
|
|
this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
|
|
|
.then(() => {
|
|
|
- return this.$http.post(`/setGoods/del/${row.id}`);
|
|
|
+ return this.$http.post(`/packageGoods/del/${row.id}`);
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.$message.success('删除成功');
|
|
|
- this.getData();
|
|
|
+ this.$router.go(0);
|
|
|
})
|
|
|
.catch(e => {
|
|
|
if (e !== 'cancel') {
|
|
|
@@ -186,10 +186,8 @@ export default {
|
|
|
this.$refs.form.validate(valid => {
|
|
|
if (valid) {
|
|
|
let data = { ...this.formData };
|
|
|
- data.unit = this.goods.unit;
|
|
|
data.price = this.goods.price * data.num;
|
|
|
data.packageId = this.id;
|
|
|
- data.name = this.goods.name;
|
|
|
this.saving = true;
|
|
|
this.$http
|
|
|
.post('/packageGoods/save', data, { body: 'json' })
|
|
|
@@ -197,7 +195,7 @@ export default {
|
|
|
this.saving = false;
|
|
|
this.$message.success('成功');
|
|
|
this.showDialog = false;
|
|
|
- this.getData();
|
|
|
+ this.$router.go(0);
|
|
|
})
|
|
|
.catch(e => {
|
|
|
console.log(e);
|