Andy 3 rokov pred
rodič
commit
d701828c8b

+ 0 - 1
src/views/BidSystem/ProductDeOrder/detail.vue

@@ -478,7 +478,6 @@ export default {
     },
     async handleBeforeUpload(row) {
       // row.name
-      console.log("row :>> ", row);
       this.uploadData.order_no = this.$route.query.order_no;
       this.uploadData.oa_id = this.$route.query.oa_id;
       return true;

+ 155 - 142
src/views/BidSystem/ProductDeOrder/infoDetail.vue

@@ -28,15 +28,27 @@
       <div class="form">
         <Form class="form_content" :label-width="100">
           <FormItem label="项目编号:">
-            <Input v-if="type == 6" v-model="saveData.order_no" placeholder="请输入项目编码"/>
+            <Input
+              v-if="type == 6"
+              v-model="saveData.order_no"
+              placeholder="请输入项目编码"
+            />
             <span style="width: 120px" v-else>{{ formData.order_no }}</span>
           </FormItem>
           <FormItem label="项目名称:">
-            <Input v-if="type == 6" v-model="saveData.residential_name" placeholder="请输入项目名称"/>
+            <Input
+              v-if="type == 6"
+              v-model="saveData.residential_name"
+              placeholder="请输入项目名称"
+            />
             <span v-else>{{ formData.residential_name }}</span>
           </FormItem>
           <FormItem label="项目简称:">
-            <Input v-if="type == 6" v-model="saveData.abbreviation" placeholder="请输入项目简称"/>
+            <Input
+              v-if="type == 6"
+              v-model="saveData.abbreviation"
+              placeholder="请输入项目简称"
+            />
             <span v-else>{{ formData.abbreviation }}</span>
           </FormItem>
           <FormItem label="客户名称:">
@@ -56,11 +68,7 @@
             <span v-else>{{ formData.custom_title }}</span>
           </FormItem>
           <FormItem label="紧急程度:">
-            <Select
-              clearable
-              v-model="saveData.warning_state"
-              v-if="type == 6"
-            >
+            <Select clearable v-model="saveData.warning_state" v-if="type == 6">
               <Option
                 v-for="(item, index) in warning_state_list"
                 :key="index"
@@ -71,15 +79,27 @@
             <span v-else>{{ formData.warning_state }}</span>
           </FormItem>
           <FormItem label="项目定金:">
-            <Input v-if="type == 6" v-model="saveData.front_money" placeholder="请输入项目定金"/>
+            <Input
+              v-if="type == 6"
+              v-model="saveData.front_money"
+              placeholder="请输入项目定金"
+            />
             <span v-else>{{ formData.front_money }}</span>
           </FormItem>
           <FormItem label="详细地址:">
-            <Input v-if="type == 6" v-model="saveData.address" placeholder="请输入详细地址"/>
+            <Input
+              v-if="type == 6"
+              v-model="saveData.address"
+              placeholder="请输入详细地址"
+            />
             <span v-else>{{ formData.address }}</span>
           </FormItem>
           <FormItem label="手机号:">
-            <Input v-if="type == 6" v-model="saveData.mobile" placeholder="请输入手机号"/>
+            <Input
+              v-if="type == 6"
+              v-model="saveData.mobile"
+              placeholder="请输入手机号"
+            />
             <span v-else>{{ formData.mobile }}</span>
           </FormItem>
           <FormItem label="开始日期:">
@@ -119,7 +139,12 @@
             <span v-else>{{ formData.nickname }}</span>
           </FormItem>
           <FormItem label="备注:">
-            <Input v-if="type == 6" v-model="saveData.remark" type="textarea" placeholder="请输入备注"/>
+            <Input
+              v-if="type == 6"
+              v-model="saveData.remark"
+              type="textarea"
+              placeholder="请输入备注"
+            />
             <span v-else>{{ formData.remark }}</span>
           </FormItem>
         </Form>
@@ -437,33 +462,31 @@
               />
             </div>
           </TabPane>
-          <div  slot="extra" class="upload">
-          <Button
-            @click="handleTabsAdd"
-            size="small"
-            style="margin-right: 10px"
-            type="primary"
-            ghost
-            v-if="type == 6"
-            >新增</Button
-          >
-           <Upload
-           :headers="headers"
-          :show-upload-list="false"
-          :on-error="uploadError"
-          :on-success="uploadSuccess"
-          :action="$store.state.ip + '/api/explode_save_import_new'" 
-          v-if="type == 6"
-          style="margin-right: 10px"
-        >
-          <Button
-            size="small"
-            type="primary"
-            ghost
-            >导入</Button
-          >
-           </Upload>
-           </div>
+          <div slot="extra" class="upload">
+            <Button
+              @click="handleTabsAdd"
+              size="small"
+              style="margin-right: 10px"
+              type="primary"
+              ghost
+              v-if="type == 6"
+              >新增</Button
+            >
+            <Upload
+              :headers="headers"
+              name="your_file"
+              :data="uploadData"
+              :show-upload-list="false"
+              :on-error="uploadError"
+              :on-success="uploadSuccess"
+              :before-upload="handleBeforeUpload"
+              :action="$store.state.ip + '/api/explode_save_import_new'"
+              v-if="type == 6"
+              style="margin-right: 10px"
+            >
+              <Button size="small" type="primary" ghost>导入</Button>
+            </Upload>
+          </div>
         </Tabs>
       </Card>
     </div>
@@ -473,10 +496,15 @@
 export default {
   data() {
     return {
-        ruleValidate: {
-                    name: [
-                        { required: true, message: 'The name cannot be empty', trigger: 'blur' }
-                    ]},
+      ruleValidate: {
+        name: [
+          {
+            required: true,
+            message: "The name cannot be empty",
+            trigger: "blur",
+          },
+        ],
+      },
       totalColumns: [
         { type: "selection", align: "center", width: 60 },
         { title: "序号", align: "center", type: "index", minWidth: 200 },
@@ -567,10 +595,10 @@ export default {
         start_time: "",
         warning_state: "",
       },
-      formData:{},
-      custom_title_list:[],
-      warning_state_list:[],
-      nickname_list:[],
+      formData: {},
+      custom_title_list: [],
+      warning_state_list: [],
+      nickname_list: [],
       searchData: {
         area_code: [],
         area_title: [],
@@ -608,12 +636,12 @@ export default {
       search_state: false,
       copy_form: [],
       type: this.$route.query.type,
-      formData: {},
       tabs: 2,
       total: 0,
       page_index: 1,
       page_size: 10,
-      save_state:false,
+      save_state: false,
+      uploadData: {},
     };
   },
   created() {
@@ -623,13 +651,19 @@ export default {
           params: { order_no: this.$route.query.order_no },
         })
         .then((res) => {
-          this.formData = res.msg;
+          this.formData = res.data;
         });
       this.getData();
-    }else{
-        this.axios.get('/api/custom_list').then(res=>{ this.custom_title_list = res.data.data});
-        this.axios.get('/api/warning_list').then(res=>{ this.warning_state_list = res.data.data });
-        this.axios.get('/api/employee_list').then(res=>{ this.nickname_list = res.data });
+    } else {
+      this.axios.get("/api/custom_list").then((res) => {
+        this.custom_title_list = res.data.data;
+      });
+      this.axios.get("/api/warning_list").then((res) => {
+        this.warning_state_list = res.data.data;
+      });
+      this.axios.get("/api/employee_list").then((res) => {
+        this.nickname_list = res.data;
+      });
     }
   },
   methods: {
@@ -656,30 +690,31 @@ export default {
           this.page_size = 10;
           this.axios
             .post("/api/order_area_details", {
-              order_no: this.$route.query.order_no,
+              order_no: this.$route.query.order_no || this.saveData.order_no,
               page_index: this.page_index,
               page_size: this.page_size,
               ...this.searchData,
             })
             .then((res) => {
               console.log(res);
-              this.detailData = res.msg.data;
-              this.total = res.msg.total;
+              this.detailData = res.data.data;
+              this.total = res.data.total;
             });
         } else {
           this.page_index = 1;
           this.page_size = 10;
-          this.axios
-            .post("/api/order_area_details", {
-              order_no: this.$route.query.order_no,
-              page_index: this.page_index,
-              page_size: this.page_size,
-            })
-            .then((res) => {
-              console.log(res);
-              this.detailData = res.msg.data;
-              this.total = res.msg.total;
-            });
+          this.$route.query.order_no &&
+            this.axios
+              .post("/api/order_area_details", {
+                order_no: this.$route.query.order_no,
+                page_index: this.page_index,
+                page_size: this.page_size,
+              })
+              .then((res) => {
+                console.log(res);
+                this.detailData = res.data.data;
+                this.total = res.data.total;
+              });
         }
       } else if (type === 0) {
         //             this.page_index= 1;
@@ -693,8 +728,8 @@ export default {
         //       },
         //     )
         //     .then((res) => {
-        //         this.totalData = res.msg.data;
-        //            this.total = res.msg.total;
+        //         this.totalData = res.data.data;
+        //            this.total = res.data.total;
         //     })
       } else {
         this.page_index = 1;
@@ -706,84 +741,62 @@ export default {
             ...this.searchData,
           })
           .then((res) => {
-              console.log(res.msg.house_type,this.house_type)
-            this.totalData = res.msg.data;
-            this.total = res.msg.total;
-            this.area_code = res.msg.area_code;
-            this.area_title = res.msg.area_title;
-            this.color = res.msg.color;
-            this.fashion = res.msg.fashion;
-            this.house = res.msg.house;
-            this.house_type = res.msg.house_type;
-            this.layer = res.msg.layer;
-            this.material = res.msg.material;
-            this.number = res.msg.number;
-            this.position = res.msg.position;
-            this.product_title = res.msg.product_title;
-            this.product_type = res.msg.product_type;
-            this.state = res.msg.state;
-            this.unit = res.msg.unit;
-            this.url_number = res.msg.url_number;
-            this.work = res.msg.work;
+            console.log(res.data.house_type, this.house_type);
+            this.totalData = res.data.data;
+            this.total = res.data.total;
+            this.area_code = res.data.area_code;
+            this.area_title = res.data.area_title;
+            this.color = res.data.color;
+            this.fashion = res.data.fashion;
+            this.house = res.data.house;
+            this.house_type = res.data.house_type;
+            this.layer = res.data.layer;
+            this.material = res.data.material;
+            this.number = res.data.number;
+            this.position = res.data.position;
+            this.product_title = res.data.product_title;
+            this.product_type = res.data.product_type;
+            this.state = res.data.state;
+            this.unit = res.data.unit;
+            this.url_number = res.data.url_number;
+            this.work = res.data.work;
             this.copy_form = this.searchData;
           });
       }
     },
-     uploadError(err) {
+    uploadError(err) {
       this.$Message.error(err.msg || "上传失败");
     },
     uploadSuccess(res) {
-        if(this.save_state == true){
       if (res.code == 200) {
-        this.$Message.success(res.msg || "上传成功");
+        console.log("111 :>> ", 111);
+        this.$Message.success(res.data || "上传成功");
+        this.getData(0);
       } else {
-        this.$Message.warning(res.msg || "上传失败");
+        this.$Message.warning(res.data || "上传失败");
       }
-      this.page_index = 1;
-        this.page_size = 10;
+    },
+    async handleBeforeUpload() {
+      this.uploadData.order_no = this.saveData.order_no;
+      return true;
+    },
+    save() {
+      if (
+        this.saveData.order_no &&
+        this.saveData.residential_name &&
+        this.saveData.abbreviation &&
+        this.saveData.custom_title &&
+        this.saveData.warning_state
+      ) {
         this.axios
-          .post("/api/order_area_details", {
-            ...this.$route.query,
-            ...{ page_index: this.page_index, page_size: this.page_size },
-            order_no:this.saveData.order_no
-          })
+          .post("/api/order_area_save", { ...this.saveData })
           .then((res) => {
-              console.log(res)
-            this.totalData = res.msg.data;
-            this.total = res.msg.total;
-            this.area_code = res.msg.area_code;
-            this.area_title = res.msg.area_title;
-            this.color = res.msg.color;
-            this.fashion = res.msg.fashion;
-            this.house = res.msg.house;
-            this.house_type = res.msg.house_type;
-            this.layer = res.msg.layer;
-            this.material = res.msg.material;
-            this.number = res.msg.number;
-            this.position = res.msg.position;
-            this.product_title = res.msg.product_title;
-            this.product_type = res.msg.product_type;
-            this.state = res.msg.state;
-            this.unit = res.msg.unit;
-            this.url_number = res.msg.url_number;
-            this.work = res.msg.work;
-            this.copy_form = this.searchData;
+            this.$Message.success(res.data);
+            this.save_state = true;
           });
-        }else{
-            this.$message.error('请先保存!')
-        }
-    },
-    save() {
-        if(!this.saveData.order_no&&!this.saveData.residential_name&&!this.saveData.abbreviation&&!this.saveData.custom_title&&!this.saveData.warning_state){
-            this.$message.error('请填写必要信息!');
-        }else{ 
-            this.axios.post('/api/order_area_save',{...this.saveData}).then(res=>{
-           this.$message.success(res.msg)
-           this.save_state = true;
-      })
-
-        }
-     
+      } else {
+        this.$Message.error("请填写必要信息!");
+      }
     },
     goback() {
       this.$router.go(-1);
@@ -798,7 +811,7 @@ export default {
   },
 };
 </script>
-<style scoped lang='scss'>
+<style scoped lang="scss">
 .changeDetail {
   .content {
     overflow: auto;
@@ -817,11 +830,11 @@ export default {
     }
   }
 }
-.ivu-form-item{
-    width: 250px;
+.ivu-form-item {
+  width: 250px;
 }
-.upload{
-    display: flex;
-    justify-content: space-around;
+.upload {
+  display: flex;
+  justify-content: space-around;
 }
-</style>
+</style>

+ 9 - 10
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -598,7 +598,7 @@
             <template #edit="scope">
               <Input
                 v-model="scope.row[measure.e_title]"
-                @on-change="(e)=>changeEditMeasure(e,scope.row, measure)"
+                @on-change="(e) => changeEditMeasure(e, scope.row, measure)"
               />
             </template>
             <template #default="{ row }"> {{ row[measure.e_title] }}</template>
@@ -1082,7 +1082,7 @@
                     <FormItem
                       v-for="(_process, idx) in process_all_list"
                       :key="idx + '333' + modalData.id"
-                      :label="(ele.title || _process.title )+ ':'"
+                      :label="(ele.title || _process.title) + ':'"
                       v-show="ele.id == _process.id"
                     >
                       <Tooltip style="width: 120px" transfer>
@@ -2367,6 +2367,9 @@ export default {
                 // 表格数据展示字段
                 elem.process_str = elem.process;
                 elem.measurement = elem.measure;
+                elem.longCalc = elem.long;
+                elem.wideCalc = elem.wide;
+                elem.highCalc = elem.high;
                 let measure_arr = elem.measure.split("*");
                 elem.long = measure_arr[0];
                 elem.wide = measure_arr[1];
@@ -3309,12 +3312,8 @@ export default {
           }
           break;
         case 3:
-            this.confirmDelete({
-        content: "确认删除么?",
-        then: () => {
           this.tableData.splice(index, 1);
-          this.handleCalcCount();}
-            })
+          this.handleCalcCount();
           break;
         case 4:
           obj = JSON.parse(JSON.stringify(row));
@@ -3495,12 +3494,12 @@ export default {
       row.procedure_properties[obj.id] = row[obj.id];
       row.process_obj.filter((v) => v.id == obj.id)[0].value = row[obj.id];
     },
-    changeEditMeasure(e,row, measure) {
+    changeEditMeasure(e, row, measure) {
       row.isEdit = true;
-console.log('e :>> ', e);
+      console.log("e :>> ", e);
       console.log("row :>> ", row);
       console.log("measure :>> ", measure);
-      this.handleProductMeasureChange(e, row, measure)
+      this.handleProductMeasureChange(e, row, measure);
     },
     changeEditPart(row, part_type) {
       row.isEdit = true;