|
@@ -233,7 +233,7 @@ export default {
|
|
|
classId: '',
|
|
classId: '',
|
|
|
className: '',
|
|
className: '',
|
|
|
cover: '',
|
|
cover: '',
|
|
|
- bigUnit: '',
|
|
|
|
|
|
|
+ bigUnit: '',
|
|
|
smallUnit: '',
|
|
smallUnit: '',
|
|
|
stockWarning:'',
|
|
stockWarning:'',
|
|
|
cost:'',
|
|
cost:'',
|
|
@@ -292,7 +292,12 @@ export default {
|
|
|
replaceConfirmFn() {
|
|
replaceConfirmFn() {
|
|
|
this.$refs.replaceForm.validate((valid) => {
|
|
this.$refs.replaceForm.validate((valid) => {
|
|
|
if(valid) {
|
|
if(valid) {
|
|
|
- console.log(this.replaceForm)
|
|
|
|
|
|
|
+ this.$service.product.update(this.replaceForm).then(res => {
|
|
|
|
|
+ console.log('res1111', res)
|
|
|
|
|
+ this.$message.success('操作成功!');
|
|
|
|
|
+ this.addDialog = false
|
|
|
|
|
+ this.app.refresh()
|
|
|
|
|
+ }).catch(err => {})
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
@@ -324,7 +329,7 @@ export default {
|
|
|
this.$service.item.batchAdd({ data: param }).then(res => {
|
|
this.$service.item.batchAdd({ data: param }).then(res => {
|
|
|
this.$message.success('操作成功!');
|
|
this.$message.success('操作成功!');
|
|
|
this.showItemModal = false
|
|
this.showItemModal = false
|
|
|
- this.$router.go(0)
|
|
|
|
|
|
|
+ this.app.refresh()
|
|
|
}).catch(err => { console.log(err) })
|
|
}).catch(err => { console.log(err) })
|
|
|
},
|
|
},
|
|
|
addFn () {
|
|
addFn () {
|
|
@@ -336,8 +341,16 @@ export default {
|
|
|
replaceBtnFn(id) {
|
|
replaceBtnFn(id) {
|
|
|
this.addDialog = true
|
|
this.addDialog = true
|
|
|
this.getAllClass()
|
|
this.getAllClass()
|
|
|
- this.$service.product.productDetail({id}).then(res => {
|
|
|
|
|
|
|
+ this.$service.product.info({id}).then(res => {
|
|
|
console.log('res', res)
|
|
console.log('res', res)
|
|
|
|
|
+ let index = this.itemClassList.findIndex((e) => e.id == res.classId)
|
|
|
|
|
+ this.replaceForm = res
|
|
|
|
|
+ this.replaceForm.className = this.itemClassList[index].name
|
|
|
|
|
+ if(this.replaceForm.cover.indexOf('http') != -1 && this.replaceForm.cover.indexOf('/uploads') != -1) {
|
|
|
|
|
+ let str = this.replaceForm.cover
|
|
|
|
|
+ let str1 = str.substring(0, str.indexOf("/uploads"));
|
|
|
|
|
+ this.replaceForm.cover = str.substring(str1.length+1, str.length);
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
onLoad ({ ctx, app }) {
|
|
onLoad ({ ctx, app }) {
|