scorpio 2 years ago
parent
commit
f6336244f9

+ 8 - 3
src/views/project/componens/info1.vue

@@ -1,5 +1,10 @@
 <template>
-  <wt-card title="基础信息" :edit-btn="true" @edit="change" @save="save">
+  <wt-card
+    title="基础信息"
+    :edit-btn="form.can_update"
+    @edit="change"
+    @save="save"
+  >
     <el-form class="mt-20" :disabled="disabled">
       <div class="flex flex-justify-center" v-watermark="{ text: '33' }">
         <el-form-item class="full-width flex-child-average">
@@ -347,7 +352,7 @@ export default {
       }
       this.$api.project.proUpdate(this.form).then(res => {
         if (res.code === 200) {
-          this.form.dict_key = JSON.parse(this.form.dict_key)
+          this.$message.success(res.msg)
         }
       })
     },
@@ -369,7 +374,7 @@ export default {
       this.photoList = list
     },
     changeIndustry(tmps) {
-      this.form.dict_key = JSON.stringify(tmps)
+      this.form.dict_key = tmps
       this.$emit('industry', tmps[0])
     }
   }

+ 1 - 0
src/views/project/componens/info3.vue

@@ -20,6 +20,7 @@
         <template #menu-left>
           <div class="flex flex-center">
             <filepicker
+              v-if="form.can_update"
               btn-text="新增合同"
               :project-id="projectId"
               @submit="selection"

+ 1 - 1
src/views/project/componens/top.vue

@@ -61,7 +61,7 @@ export default {
             } else {
               this.stage = this.stages[0].id
             }
-            this.$emit('change', this.stage, tmp.dictKey)
+            this.$emit('change', this.stage)
           }
         })
     },

+ 23 - 1
src/views/project/index.vue

@@ -44,7 +44,7 @@
     <!--    buttom-->
     <div class="bottom flex flex-center flex-justify-end">
       <div class="padding">
-        <el-button type="primary" plain>退 库</el-button>
+        <el-button type="primary" plain @click="projectCancel">退 库</el-button>
         <el-button
           type="primary"
           v-if="detail.is_report === 0"
@@ -200,6 +200,28 @@ export default {
             })
         }
       })
+    },
+    /**
+     * 项目退库
+     */
+    projectCancel() {
+      console.log('rrrr')
+      this.$prompt('请输入退库原因', '提示', {}).then(({ value }) => {
+        if (value === null || value.length === 0) {
+          this.$message.error('请输入退库原因')
+          return
+        }
+        this.$api.project
+          .projectCancel({ id: this.projectId, exitMsg: value })
+          .then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+              this.refreshChange()
+            } else {
+              this.$message.error(res.msg)
+            }
+          })
+      })
     }
   }
 }