Просмотр исходного кода

零售后台完善修改流程

wangn 5 лет назад
Родитель
Сommit
59f2f6626f
2 измененных файлов с 17 добавлено и 5 удалено
  1. 0 1
      hd/src/components/module/item-list-layer.vue
  2. 17 4
      hd/src/views/item/list.vue

+ 0 - 1
hd/src/components/module/item-list-layer.vue

@@ -124,7 +124,6 @@ export default {
       this.$emit('cancel');
     },
     selectItem(row){
-      console.log(1212121121)
       console.log(row)
                 //已经选过
                 if(row.select == 2){

+ 17 - 4
hd/src/views/item/list.vue

@@ -233,7 +233,7 @@ export default {
 				classId: '',
 				className: '',
 				cover: '',
-				bigUnit: '',
+        bigUnit: '',
 				smallUnit: '',
 				stockWarning:'',
 				cost:'',
@@ -292,7 +292,12 @@ export default {
     replaceConfirmFn() {
       this.$refs.replaceForm.validate((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.$message.success('操作成功!');
         this.showItemModal = false
-        this.$router.go(0)
+        this.app.refresh()
       }).catch(err => { console.log(err) })
     },
     addFn () {
@@ -336,8 +341,16 @@ export default {
     replaceBtnFn(id) {
       this.addDialog = true
       this.getAllClass()
-      this.$service.product.productDetail({id}).then(res => {
+      this.$service.product.info({id}).then(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 }) {