qymljy 2 years ago
parent
commit
1d30d3d9fb

+ 12 - 6
src/Form/projectChange/add.vue

@@ -163,14 +163,20 @@ export default {
     },
     onSubmit(){
       console.log(this.form)
-      const data = new Date(this.form.signdate_due)
-      console.log(data.getFullYear())
-      console.log(data.getMonth()+1)
-      if (data.getMonth() +1 < 10){
-        this.form.signdate_due = data.getFullYear() + '-0' + (data.getMonth() + 1)
+      if (this.form.signdate_due !== ''){
+        const data = new Date(this.form.signdate_due)
+        console.log(data.getFullYear())
+        console.log(data.getMonth()+1)
+        if (data.getMonth() +1 < 10){
+          this.form.signdate_due = data.getFullYear() + '-0' + (data.getMonth() + 1)
+        }else {
+          this.form.signdate_due = data.getFullYear() + '-' + (data.getMonth() + 1)
+        }
       }else {
-        this.form.signdate_due = data.getFullYear() + '-' + (data.getMonth() + 1)
+        this.form.signdate_due = ''
+        this.form.signdate_due = ''
       }
+
       console.log(this.form)
       this.$refs['form'].validate(async (valid) => {
         if (!valid) return false

+ 4 - 1
src/HDrpManagement/projectChange/modules/modules/rival/index.vue

@@ -2,7 +2,7 @@
 <template>
   <div>
     <div style="margin-bottom: 15px">
-      <add class="inline-16" :data="data"></add>
+      <add class="inline-16" :data="data" @addSuccess="onSuccess"></add>
       <el-input
           size="small"
           style="width: 200px;"
@@ -85,6 +85,9 @@ export default {
       this.params.content.pageNumber = val
       this.listData()
     },
+    onSuccess(){
+      this.listData()
+    }
   },
   mounted() {
     this.listData()

+ 31 - 2
src/HDrpManagement/projectChange/modules/modules/rival/modules/add.vue

@@ -84,6 +84,14 @@
                 <el-input  autosize v-model="form.brandname" placeholder="品牌名称" disabled></el-input>
               </el-form-item>
             </el-col>
+            <el-col :span="24">
+              <el-form-item  label="主要威胁:">
+                <el-radio-group v-model="form.important">
+                  <el-radio :label="1">是</el-radio>
+                  <el-radio :label="0">否</el-radio>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
             <el-col :span="24">
               <el-form-item  label="优势信息:">
                 <el-input  autosize v-model="form.advantage" placeholder="优势信息" disabled></el-input>
@@ -144,7 +152,7 @@ export default {
         "sa_projectid": 1, //工程项目表ID
         "contactsid": '', //可不传
         "sa_competitorid": 1, //竞争对手ID
-        "important": '', //主要威胁 0/1
+        "important": 0, //主要威胁 0/1
         "advantage": "",
         "inferiority": "",
         "remarks": ""
@@ -174,8 +182,29 @@ export default {
       this.form = Object.assign({},this.form,val)
       this.enterpriseShow = false
     },
-    onSubmit(){
+    async onSubmit(){
       console.log(this.form)
+      const res = await this.$api.requested({
+        "id": 20221019165802,
+        "content": this.form
+      })
+      this.tool.showMessage(res,()=>{
+        this.dialogFormVisible = false
+        this.form = {
+          "enterprisename":'',
+          "brandname":'',
+          "industry":'',
+          "sa_project_competeid": 0,
+          "sa_projectid": '', //工程项目表ID
+          "contactsid": '', //可不传
+          "sa_competitorid": '', //竞争对手ID
+          "important": 0, //主要威胁 0/1
+          "advantage": "",
+          "inferiority": "",
+          "remarks": ""
+        }
+        this.$emit("addSuccess")
+      })
     },
     /*企业分页*/
     handleSizeChangeProject(val) {