2 Commit-ok 6d4bc8c61f ... 8e3483fbcd

Szerző SHA1 Üzenet Dátum
  LAPTOP-UBJMM5MG\user 8e3483fbcd Merge remote-tracking branch 'origin/productization2' into productization2 9 hónapja%!(EXTRA string=óta)
  LAPTOP-UBJMM5MG\user 5fe25c7cd4 更新 9 hónapja%!(EXTRA string=óta)

+ 1 - 0
pages.json

@@ -1915,6 +1915,7 @@
                             "van-button": "/wxcomponents/weapp/dist/button/index",
                             "van-toast": "/wxcomponents/weapp/dist/toast/index",
                             "van-field": "/wxcomponents/weapp/dist/field/index",
+                            "van-popup": "/wxcomponents/weapp/dist/popup/index",
                             "van-picker": "/wxcomponents/weapp/dist/picker/index",
                             "van-dialog": "/wxcomponents/weapp/dist/dialog/index",
                             "van-icon": "/wxcomponents/weapp/dist/icon/index",

+ 379 - 321
pages/subPackages/minePages/mineInfo.vue

@@ -57,7 +57,8 @@
           <input
               type="text"
               placeholder="请选择"
-              readonly
+              @click="takeshow"
+              disabled
               v-model="company.zcsj"
           />
         </li>
@@ -175,13 +176,12 @@
         </li>
         <li class="titleLi titleLiUploader">
           <van-uploader
-              v-model="fileList"
-              multiple
-              max-count="1"
-              :after-read="afterRead"
-              :before-delete="beforeDelete"
-          >
-          </van-uploader>
+              :max-count="1"
+              @delete="beforeDelete"
+              :file-list="fileList"
+              @after-read="afterRead"
+              :show-upload="true"
+          />
         </li>
         <li class="titleLi titleLiLast">
           荣誉信息(限6张):
@@ -197,12 +197,19 @@
                     />
         </li>
         <li class="titleLi titleLiUploader2">
+<!--          <van-uploader-->
+<!--              v-model="fileList2"-->
+<!--              multiple-->
+<!--              max-count="6"-->
+<!--              :after-read="afterRead2"-->
+<!--              :before-delete="beforeDelete2"-->
+<!--          />-->
           <van-uploader
-              v-model="fileList2"
-              multiple
-              max-count="6"
-              :after-read="afterRead2"
-              :before-delete="beforeDelete2"
+              :max-count="6"
+              @delete="beforeDelete2"
+              :file-list="fileList2"
+              @after-read="afterRead2"
+              :show-upload="true"
           />
         </li>
         <li class="titleLi titleLiLast">
@@ -211,20 +218,20 @@
         <li class="titleLi titleLiLast titleLiUploader">
           <div>
             <van-uploader
-                v-model="fileList3"
-                multiple
+                :file-list="fileList3"
                 max-count="1"
-                :after-read="afterRead3"
-                :before-delete="beforeDelete3"
+                @after-read="afterRead3"
+                @delete="beforeDelete3"
+                :show-upload="true"
             >
               <img src="https://www.idea-co-sf.com/gardenProduct/image/zm.png" class="sfzImg">
             </van-uploader>
             <van-uploader
-                v-model="fileList4"
-                multiple
+                :file-list="fileList4"
                 max-count="1"
-                :after-read="afterRead4"
-                :before-delete="beforeDelete4"
+                @after-read="afterRead4"
+                @delete="beforeDelete4"
+                :show-upload="true"
             >
               <img src="https://www.idea-co-sf.com/gardenProduct/image/fm.png" class="sfzImg">
             </van-uploader>
@@ -242,26 +249,18 @@
       入库审核中......
     </div>
     <!-- 时间弹框 -->
-    <van-popup v-model="show" position="bottom" :style="{ height: '50%' }">
+    <van-popup :show="show" position="bottom" :style="{ height: '50%' }">
       <van-datetime-picker
-          v-model="currentDate"
-          type="date"
           title="选择年月日"
-          :min-date="minDate"
-          :max-date="maxDate"
-          @cancel="show = false"
-          @confirm="selectTime"
-      /></van-popup>
-    <van-popup v-model="show2" position="bottom" :style="{ height: '50%' }">
-      <van-datetime-picker
-          v-model="currentDate"
           type="date"
-          title="选择年月日"
+          :value="currentDate"
+          @cancel="cancel"
+          @confirm="selectTime"
           :min-date="minDate"
           :max-date="maxDate"
-          @cancel="show2 = false"
-          @confirm="selectTime2"
-      /></van-popup>
+          :formatter="formatter"
+      />
+    </van-popup>
   </div>
 </template>
 <script>
@@ -284,13 +283,25 @@ export default {
       frsfzzm: '',
       frsfzfm: '',
       selectTag: 0,
+      formatter(type, value) {
+        if (type === 'year') {
+          return `${value}年`;
+        }
+        if (type === 'month') {
+          return `${value}月`;
+        }
+        if (type === 'day') {
+          return `${value}日`;
+        }
+        return value;
+      },
       tagList: [
       ],
       checkBoxList: [
         ],
       company: {
-        id: '',
-        qymc: '',
+        id: getUserLocalStorageInfo().userId,
+        qymc: getUserLocalStorageInfo().username,
         shxydm: '',
         zcsj: '',
         zczj: '',
@@ -319,35 +330,26 @@ export default {
         qybq: ''
       },
       show: false,
-      show2: false,
-      minDate: new Date(1980, 0, 1),
-      maxDate: new Date(2025, 10, 1),
-      currentDate: new Date(),
+      minDate: new Date(1980, 0, 1).getTime(),
+      maxDate: new Date(2025, 10, 1).getTime(),
+      currentDate: new Date().getTime(),
       selectTagId: '',
       btnShow: true,
       qybqList: []
     }
   },
   mounted() {
-    // this.getCommit()
+    this.getCommit()
   },
   methods: {
     takeshow() {
       if (this.isnew) {
+        console.log(222)
         this.show = true
       }
     },
-    takeshow2() {
-      if (this.isnew) {
-        // console.log(123)
-        this.show2 = true
-      }
-    },
-    turnOff() {
-      this.$router.push('/home/home')
-    },
     getInfo() {
-      getById({ id: auth.currUser().id }).then(res => {
+      getById({ id: getUserLocalStorageInfo().userId }).then(res => {
         console.log('res', res)
         if (res && res.key == 200) {
           this.company = res.data
@@ -406,16 +408,16 @@ export default {
             }
           }
         } else if (res.key == 426) {
-          Toast(res.msg)
+          this.$showToast(res.msg)
           this.$router.push('/login')
         } else {
-          Toast(res.msg)
+          this.$showToast(res.msg)
         }
         if (this.company.shxydm && this.company.rzsj) {
           this.isnew = false
         }
       }).then(() => {
-        isFinishComInfo({ comId: auth.currUser().id }).then(res => {
+        isFinishComInfo({ comId: getUserLocalStorageInfo().userId }).then(res => {
           if (res.errno === 0) {
             this.btnShow = false
           } else if (res.errno === -1) {
@@ -424,52 +426,11 @@ export default {
         })
       })
     },
-    // 获取企业标签信息
-    // getTagList() {
-    //     getTagInfo().then(res => {
-    //         this.tagList = res.data
-    //         this.checkBoxList = res.data[0].children
-    //         this.checkBoxList.forEach(item => {
-    //             if (this.qybqList.findIndex(e => e == item.id) !== -1) {
-    //                 item.checked = true
-    //             }
-    //         })
-    //     })
-    // },
-    // clickTag(item, index) {
-    //     this.selectTag = index
-    //     this.selectTagId = item.id
-    //     this.tagList.forEach(item => {
-    //         if (this.selectTagId == item.id) {
-    //             this.checkBoxList = item.children
-    //         }
-    //     })
-    //     this.checkBoxList.forEach(item => {
-    //         if (this.company.qybq.split(',').findIndex(e => e == item.id) !== -1) {
-    //             item.checked = true
-    //         }
-    //     })
-    // },
-    // changeCheck(item) {
-    //     console.log(this.qybqList)
-    //     if (item.checked == true) {
-    //         if (this.qybqList.findIndex(e => e == item.id) == -1) {
-    //             this.qybqList.push(item.id)
-    //         }
-    //     } else {
-    //         const i = this.qybqList.findIndex(e => e == item.id)
-    //         if (i !== -1) {
-    //             this.qybqList.splice(i, 1)
-    //         }
-    //     }
-    //     this.$nextTick(() => {
-    //         this.company.qybq = this.qybqList.toString()
-    //         console.log(this.company.qybq)
-    //     })
-    // },
     getCommit() {
-      const local = localStorage.getItem('company' + auth.currUser().id)
+      const local = uni.getStorageSync('company' + getUserLocalStorageInfo().userId)
+      console.log(local)
       if (local) {
+        console.log('hasLocal')
         this.company = JSON.parse(local)
         this.qybqList = this.company.qybq.split(',')
         // this.getTagList()
@@ -537,16 +498,16 @@ export default {
       } else {
         this.company.frsfzh = null
       }
-      this.company.czrid = auth.currUser().id
-      this.company.czr = auth.currUser().qymc
+      this.company.czrid = getUserLocalStorageInfo().userId
+      this.company.czr = getUserLocalStorageInfo().username
       this.$delete(this.company, 'czsj')
-      localStorage.setItem('company' + auth.currUser().id, JSON.stringify(this.company))
+      uni.setStorageSync('company' + getUserLocalStorageInfo().userId, JSON.stringify(this.company))
       this.$nextTick(() => {
-        const local = localStorage.getItem('company' + auth.currUser().id)
+        const local = uni.getStorage('company' + getUserLocalStorageInfo().userId)
         if (local) {
-          Toast('暂存成功')
+          this.$showToast('暂存成功')
         } else {
-          Toast('暂存失败')
+          this.$showToast('暂存失败')
         }
       })
     },
@@ -554,257 +515,354 @@ export default {
     submit() {
       // console.log(this.company.frsfzh)
       if (!this.company.shxydm) {
-        Toast('请填写统一社会信用代码')
+        this.$showToast('请填写统一社会信用代码')
       } else if (!this.company.zczj) {
-        Toast('请填写注册资金')
+        this.$showToast('请填写注册资金')
       } else if (!this.company.zcsj) {
-        Toast('请填写注册时间')
+        this.$showToast('请填写注册时间')
       } else if (!this.company.fddbr) {
-        Toast('请填写法定代表人')
+        this.$showToast('请填写法定代表人')
       } else if (!this.company.qylxr) {
-        Toast('请填写企业联系人')
+        this.$showToast('请填写企业联系人')
       } else if (!this.company.lxdh) {
-        Toast('请填写手机号')
+        this.$showToast('请填写手机号')
       } else if (!this.company.email) {
-        Toast('请填写联系人邮箱')
+        this.$showToast('请填写联系人邮箱')
       } else if (!this.company.cwfzr) {
-        Toast('请填写财务负责人')
+        this.$showToast('请填写财务负责人')
       } else if (!this.company.cwfzrdh) {
-        Toast('请填写财务负责人电话')
+        this.$showToast('请填写财务负责人电话')
       } else if (!this.company.zcdz) {
-        Toast('请填写注册地址')
+        this.$showToast('请填写注册地址')
       } else if (!this.company.jydz) {
-        Toast('请填写经营地址')
+        this.$showToast('请填写经营地址')
       } else if (this.fileList.length == 0) {
-        Toast('请上传营业执照副本')
+        this.$showToast('请上传营业执照副本')
       } else if (!this.frsfzzm) {
-        Toast('请上传法人身份证正面')
+        this.$showToast('请上传法人身份证正面')
       } else if (!this.frsfzfm) {
-        Toast('请上传法人身份证反面')
+        this.$showToast('请上传法人身份证反面')
       } else {
         this.company.frsfzh = this.frsfzzm + ',' + this.frsfzfm
-        this.company.czrid = auth.currUser().id
-        this.company.czr = auth.currUser().qymc
+        this.company.czrid = getUserLocalStorageInfo().userId
+        this.company.czr = getUserLocalStorageInfo().username
         this.$delete(this.company, 'czsj')
         this.$delete(this.company, 'gxsj')
-        add(this.company).then(res => {
+        addCompanyExamine(this.company).then(res => {
           if (res.key == 200) {
-            Toast('提交成功')
+            this.$showToast('提交成功')
             this.btnShow = false
-            localStorage.removeItem('company' + auth.currUser().id)
+            uni.removeStorageSync('company' + getUserLocalStorageInfo().userId)
           } else {
-            Toast(res.msg)
+            this.$showToast(res.msg)
           }
         })
       }
     },
-    selectTime(e) {
-      const dayjs = require('dayjs')
-      this.company.zcsj = dayjs(e).format('YYYY-MM-DD')
+    cancel(){
       this.show = false
     },
-    selectTime2(e) {
+    selectTime(e) {
       const dayjs = require('dayjs')
-      this.company.rzsj = dayjs(e).format('YYYY-MM-DD')
-      this.show2 = false
-    },
-    afterRead(file) {
-      Toast.loading({
-        message: '上传中...',
-        forbidClick: true,
-        duration: 0
-      })
-      if (file instanceof Array) {
-        file.map(v => {
-          this.uploadImg(v)
-        })
-      } else {
-        this.uploadImg(file)
-      }
-    },
-    afterRead2(file) {
-      Toast.loading({
-        message: '上传中...',
-        forbidClick: true,
-        duration: 0
-      })
-      if (file instanceof Array) {
-        file.map(v => {
-          this.uploadImg2(v)
-        })
-      } else {
-        this.uploadImg2(file)
-      }
-    },
-    afterRead3(file) {
-      Toast.loading({
-        message: '上传中...',
-        forbidClick: true,
-        duration: 0
-      })
-      if (file instanceof Array) {
-        file.map(v => {
-          this.uploadImg3(v)
-        })
-      } else {
-        this.uploadImg3(file)
-      }
+      this.company.zcsj = dayjs(e.detail).format('YYYY-MM-DD')
+      this.show = false
     },
-    afterRead4(file) {
-      Toast.loading({
-        message: '上传中...',
-        forbidClick: true,
-        duration: 0
-      })
-      if (file instanceof Array) {
-        file.map(v => {
-          this.uploadImg4(v)
-        })
-      } else {
-        this.uploadImg4(file)
-      }
+    afterRead(event) {
+      console.log(event)
+      let that = this;
+      const { file } = event.detail;
+      uni.uploadFile({
+        url: that.$constant.BASE_URI + "/wx/fileController/upload",
+        filePath: file.url,
+        name: "file",
+        formData: { user: "test" },
+        success(res) {
+          // 上传完成需要更新 fileList
+          let data = JSON.parse(res.data);
+          that.fileList.push({
+            imgUrl: "/FileController/download/" + data.data[0],
+            id: data.data[0],
+            url:
+                that.$constant.BASE_URI +
+                "/FileController/download/" +
+                data.data[0],
+            isImage: true,
+          });
+          that.company.yyzzfbzp = data.data[0]
+          console.log('list',that.fileList)
+        },
+        fail(res) {},
+      });
     },
-    beforeDelete(file, detail) {
-      const vm = this
-      // name.index代表图片的索引
-      vm.company.yyzzfbzp = ''
-      this.fileList = []
+    afterRead2(event) {
+      console.log(event)
+      let that = this;
+      const { file } = event.detail;
+      uni.uploadFile({
+        url: that.$constant.BASE_URI + "/wx/fileController/upload",
+        filePath: file.url,
+        name: "file",
+        formData: { user: "test" },
+        success(res) {
+          // 上传完成需要更新 fileList
+          let data = JSON.parse(res.data);
+          that.fileIdList2.push(data.data[0])
+          that.fileList2.push({
+            imgUrl: "/FileController/download/" + data.data[0],
+            id: data.data[0],
+            url:
+                that.$constant.BASE_URI +
+                "/FileController/download/" +
+                data.data[0],
+            isImage: true,
+          });
+          that.company.ryxxzp = that.fileIdList2.toString()
+          console.log('list',that.fileList)
+        },
+        fail(res) {},
+      });
     },
-    beforeDelete2(file, detail) {
-      const vm = this
-      // name.index代表图片的索引
-      vm.fileIdList2.splice(detail.index, 1)
-      vm.company.ryxxzp = vm.fileIdList2.toString()
-      console.log(vm.company.ryxxzp)
-      return (file, name) => {
-        const fileIndex = name.index
-        vm.fileIdList2[detail.index].splice(fileIndex, 1)
-      }
+    afterRead3(event) {
+      console.log(event)
+      let that = this;
+      const { file } = event.detail;
+      uni.uploadFile({
+        url: that.$constant.BASE_URI + "/wx/fileController/upload",
+        filePath: file.url,
+        name: "file",
+        formData: { user: "test" },
+        success(res) {
+          // 上传完成需要更新 fileList
+          let data = JSON.parse(res.data);
+          that.fileList3.push({
+            imgUrl: "/FileController/download/" + data.data[0],
+            id: data.data[0],
+            url:
+                that.$constant.BASE_URI +
+                "/FileController/download/" +
+                data.data[0],
+            isImage: true,
+          });
+          that.frsfzzm = data.data[0]
+          console.log('list',that.fileList)
+        },
+        fail(res) {},
+      });
     },
-    beforeDelete3(file, detail) {
-      const vm = this
-      // name.index代表图片的索引
-      vm.frsfzzm = ''
-      this.fileList3 = []
-      this.fileIdList3 = []
+    afterRead4(event) {
+      console.log(event)
+      let that = this;
+      const { file } = event.detail;
+      uni.uploadFile({
+        url: that.$constant.BASE_URI + "/wx/fileController/upload",
+        filePath: file.url,
+        name: "file",
+        formData: { user: "test" },
+        success(res) {
+          // 上传完成需要更新 fileList
+          let data = JSON.parse(res.data);
+          that.fileList4.push({
+            imgUrl: "/FileController/download/" + data.data[0],
+            id: data.data[0],
+            url:
+                that.$constant.BASE_URI +
+                "/FileController/download/" +
+                data.data[0],
+            isImage: true,
+          });
+          that.frsfzfm = data.data[0]
+          console.log('list',that.fileList)
+        },
+        fail(res) {},
+      });
     },
-    beforeDelete4(file, detail) {
-      const vm = this
-      // name.index代表图片的索引
-      vm.frsfzfm = ''
-      this.fileList4 = []
-      this.fileIdList4 = []
+    // afterRead2(file) {
+    //   this.$showToast.loading({
+    //     message: '上传中...',
+    //     forbidClick: true,
+    //     duration: 0
+    //   })
+    //   if (file instanceof Array) {
+    //     file.map(v => {
+    //       this.uploadImg2(v)
+    //     })
+    //   } else {
+    //     this.uploadImg2(file)
+    //   }
+    // },
+    // afterRead3(file) {
+    //   this.$showToast.loading({
+    //     message: '上传中...',
+    //     forbidClick: true,
+    //     duration: 0
+    //   })
+    //   if (file instanceof Array) {
+    //     file.map(v => {
+    //       this.uploadImg3(v)
+    //     })
+    //   } else {
+    //     this.uploadImg3(file)
+    //   }
+    // },
+    // afterRead4(file) {
+    //   this.$showToast.loading({
+    //     message: '上传中...',
+    //     forbidClick: true,
+    //     duration: 0
+    //   })
+    //   if (file instanceof Array) {
+    //     file.map(v => {
+    //       this.uploadImg4(v)
+    //     })
+    //   } else {
+    //     this.uploadImg4(file)
+    //   }
+    // },
+    beforeDelete(event) {
+      this.fileList.splice(event.detail.index, 1);
+      this.company.yyzzfbzp = ''
+      this.$forceUpdate();
     },
-    uploadImg(file) {
-      const _this = this
-      const formParam = new FormData() // 创建form对象
-      formParam.append('file', file.file) // 通过append向form对象添加数据
-      const config = {
-        headers: {
-          'Content-Type': 'multipart/form-data',
-          'MVVM-Key': String(new Date().getTime()),
-          xx: 'anything'
-        } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
-      } // 添加请求头
-      return new Promise((resolve, reject) => {
-        // axios.post('http://121.228.7.226:9001/wx/fileController/upload', formParam, config)
-        upload(formParam, config)
-            .then(response => {
-              if (response.data.length) {
-                _this.company.yyzzfbzp = response.data[0]
-              }
-              Toast.clear()
-            })
-            .catch((err, x) => {
-              reject(err, x)
-            })
-      })
+    beforeDelete2(event) {
+      this.fileList2.splice(event.detail.index, 1);
+      this.company.ryxxzp = this.fileIdList2.toString()
+      this.$forceUpdate();
     },
-    uploadImg2(file) {
-      const _this = this
-      const formParam = new FormData() // 创建form对象
-      formParam.append('file', file.file) // 通过append向form对象添加数据
-      const config = {
-        headers: {
-          'Content-Type': 'multipart/form-data',
-          'MVVM-Key': String(new Date().getTime()),
-          xx: 'anything'
-        } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
-      } // 添加请求头
-      return new Promise((resolve, reject) => {
-        // axios.post('http://121.228.7.226:9001/wx/fileController/upload', formParam, config)
-        upload(formParam, config)
-            .then(response => {
-              if (response.data.length) {
-                response.data.forEach(element => {
-                  _this.fileIdList2.push(element)
-                })
-                _this.company.ryxxzp = _this.fileIdList2.toString()
-                // console.log(_this.company.ryxxzp);
-              }
-              Toast.clear()
-            })
-            .catch((err, x) => {
-              reject(err, x)
-            })
-      })
+    beforeDelete3(event) {
+      this.fileList3.splice(event.detail.index, 1);
+      this.frsfzzm = ''
+      this.$forceUpdate();
     },
-    uploadImg3(file) {
-      const _this = this
-      const formParam = new FormData() // 创建form对象
-      formParam.append('file', file.file) // 通过append向form对象添加数据
-      const config = {
-        headers: {
-          'Content-Type': 'multipart/form-data',
-          'MVVM-Key': String(new Date().getTime()),
-          xx: 'anything'
-        } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
-      } // 添加请求头
-      return new Promise((resolve, reject) => {
-        // axios.post('http://121.228.7.226:9001/wx/fileController/upload', formParam, config)
-        upload(formParam, config)
-            .then(response => {
-              if (response.data.length) {
-                response.data.forEach(element => {
-                  _this.fileIdList3.push(element)
-                })
-                _this.frsfzzm = _this.fileIdList3.toString()
-              }
-              Toast.clear()
-            })
-            .catch((err, x) => {
-              reject(err, x)
-            })
-      })
+    beforeDelete4(event) {
+      this.fileList4.splice(event.detail.index, 1);
+      this.frsfzfm = ''
+      this.$forceUpdate();
     },
-    uploadImg4(file) {
-      const _this = this
-      const formParam = new FormData() // 创建form对象
-      formParam.append('file', file.file) // 通过append向form对象添加数据
-      const config = {
-        headers: {
-          'Content-Type': 'multipart/form-data',
-          'MVVM-Key': String(new Date().getTime()),
-          xx: 'anything'
-        } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
-      } // 添加请求头
-      return new Promise((resolve, reject) => {
-        // axios.post('http://121.228.7.226:9001/wx/fileController/upload', formParam, config)
-        upload(formParam, config)
-            .then(response => {
-              if (response.data.length) {
-                response.data.forEach(element => {
-                  _this.fileIdList4.push(element)
-                })
-                _this.frsfzfm = _this.fileIdList4.toString()
-              }
-              Toast.clear()
-            })
-            .catch((err, x) => {
-              reject(err, x)
-            })
-      })
-    }
+
+    // beforeDelete3(file, detail) {
+    //   const vm = this
+    //   // name.index代表图片的索引
+    //   vm.frsfzzm = ''
+    //   this.fileList3 = []
+    //   this.fileIdList3 = []
+    // },
+    // beforeDelete4(file, detail) {
+    //   const vm = this
+    //   // name.index代表图片的索引
+    //   vm.frsfzfm = ''
+    //   this.fileList4 = []
+    //   this.fileIdList4 = []
+    // },
+    // uploadImg(file) {
+    //   const _this = this
+    //   const formParam = new FormData() // 创建form对象
+    //   formParam.append('file', file.file) // 通过append向form对象添加数据
+    //   const config = {
+    //     headers: {
+    //       'Content-Type': 'multipart/form-data',
+    //       'MVVM-Key': String(new Date().getTime()),
+    //       xx: 'anything'
+    //     } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
+    //   } // 添加请求头
+    //   return new Promise((resolve, reject) => {
+    //     // axios.post('http://121.228.7.226:9001/wx/fileController/upload', formParam, config)
+    //     upload(formParam, config)
+    //         .then(response => {
+    //           if (response.data.length) {
+    //             _this.company.yyzzfbzp = response.data[0]
+    //           }
+    //           this.$showToast.clear()
+    //         })
+    //         .catch((err, x) => {
+    //           reject(err, x)
+    //         })
+    //   })
+    // },
+    // uploadImg2(file) {
+    //   const _this = this
+    //   const formParam = new FormData() // 创建form对象
+    //   formParam.append('file', file.file) // 通过append向form对象添加数据
+    //   const config = {
+    //     headers: {
+    //       'Content-Type': 'multipart/form-data',
+    //       'MVVM-Key': String(new Date().getTime()),
+    //       xx: 'anything'
+    //     } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
+    //   } // 添加请求头
+    //   return new Promise((resolve, reject) => {
+    //     // axios.post('http://121.228.7.226:9001/wx/fileController/upload', formParam, config)
+    //     upload(formParam, config)
+    //         .then(response => {
+    //           if (response.data.length) {
+    //             response.data.forEach(element => {
+    //               _this.fileIdList2.push(element)
+    //             })
+    //             _this.company.ryxxzp = _this.fileIdList2.toString()
+    //             // console.log(_this.company.ryxxzp);
+    //           }
+    //           this.$showToast.clear()
+    //         })
+    //         .catch((err, x) => {
+    //           reject(err, x)
+    //         })
+    //   })
+    // },
+    // uploadImg3(file) {
+    //   const _this = this
+    //   const formParam = new FormData() // 创建form对象
+    //   formParam.append('file', file.file) // 通过append向form对象添加数据
+    //   const config = {
+    //     headers: {
+    //       'Content-Type': 'multipart/form-data',
+    //       'MVVM-Key': String(new Date().getTime()),
+    //       xx: 'anything'
+    //     } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
+    //   } // 添加请求头
+    //   return new Promise((resolve, reject) => {
+    //     // axios.post('http://121.228.7.226:9001/wx/fileController/upload', formParam, config)
+    //     upload(formParam, config)
+    //         .then(response => {
+    //           if (response.data.length) {
+    //             response.data.forEach(element => {
+    //               _this.fileIdList3.push(element)
+    //             })
+    //             _this.frsfzzm = _this.fileIdList3.toString()
+    //           }
+    //           this.$showToast.clear()
+    //         })
+    //         .catch((err, x) => {
+    //           reject(err, x)
+    //         })
+    //   })
+    // },
+    // uploadImg4(file) {
+    //   const _this = this
+    //   const formParam = new FormData() // 创建form对象
+    //   formParam.append('file', file.file) // 通过append向form对象添加数据
+    //   const config = {
+    //     headers: {
+    //       'Content-Type': 'multipart/form-data',
+    //       'MVVM-Key': String(new Date().getTime()),
+    //       xx: 'anything'
+    //     } // 这里是重点,需要和后台沟通好请求头,Content-Type不一定是这个值
+    //   } // 添加请求头
+    //   return new Promise((resolve, reject) => {
+    //     // axios.post('http://121.228.7.226:9001/wx/fileController/upload', formParam, config)
+    //     upload(formParam, config)
+    //         .then(response => {
+    //           if (response.data.length) {
+    //             response.data.forEach(element => {
+    //               _this.fileIdList4.push(element)
+    //             })
+    //             _this.frsfzfm = _this.fileIdList4.toString()
+    //           }
+    //           this.$showToast.clear()
+    //         })
+    //         .catch((err, x) => {
+    //           reject(err, x)
+    //         })
+    //   })
+    // }
   }
 }
 </script>

+ 1 - 1
pages/subPackages/propertyManagement/maintenance.vue

@@ -367,7 +367,7 @@ export default {
     },
     toEdit(item) {
       uni.navigateTo({
-        url:'/pages/subPackages/propertyManagement/propertyEditor'
+        url:'/pages/subPackages/propertyManagement/propertyEditor?id=' + item.id
       })
     }
   }

+ 105 - 20
pages/subPackages/propertyManagement/propertyEditor.vue

@@ -16,8 +16,8 @@
             <span style="color: red;margin-right: 5rpx">*</span>
             区域
           </span>
-          <div class="inputBox">
-            <input placeholder="请选择" disabled class="myIpt">
+          <div class="inputBox" @tap="showArea('区域')">
+            <input placeholder="请选择" disabled class="myIpt" v-model="postData.area">
             <van-icon name="arrow-down" />
           </div>
         </li>
@@ -26,8 +26,8 @@
             <span style="color: red;margin-right: 5rpx">*</span>
             楼层
           </span>
-          <div class="inputBox">
-            <input placeholder="请选择" disabled class="myIpt">
+          <div class="inputBox" @tap="showArea('楼层')">
+            <input placeholder="请选择" disabled class="myIpt" v-model="postData.floor">
             <van-icon name="arrow-down" />
           </div>
         </li>
@@ -56,8 +56,8 @@
           <span style="color: red;margin-right: 5rpx">*</span>
             用途
           </span>
-          <div class="inputBox">
-            <input placeholder="请选择" disabled class="myIpt">
+          <div class="inputBox" @tap="showArea('用途')">
+            <input placeholder="请选择" disabled class="myIpt" v-model="postData.usege">
             <van-icon name="arrow-down" />
           </div>
         </li>
@@ -65,8 +65,8 @@
           <span class="liName">
             物业性质
           </span>
-          <div class="inputBox">
-            <input placeholder="请选择" disabled class="myIpt">
+          <div class="inputBox" @tap="showArea('物业性质')">
+            <input placeholder="请选择" disabled class="myIpt" v-model="postData.nature">
             <van-icon name="arrow-down" />
           </div>
         </li>
@@ -75,8 +75,8 @@
           <span style="color: red;margin-right: 5rpx">*</span>
             朝向
           </span>
-          <div class="inputBox">
-            <input placeholder="请选择" disabled class="myIpt">
+          <div class="inputBox" @tap="showArea('朝向')">
+            <input placeholder="请选择" disabled class="myIpt" v-model="postData.cx">
             <van-icon name="arrow-down" />
           </div>
         </li>
@@ -85,8 +85,8 @@
           <span style="color: red;margin-right: 5rpx">*</span>
             装修情况
           </span>
-          <div class="inputBox">
-            <input placeholder="请选择" disabled class="myIpt">
+          <div class="inputBox" @tap="showArea('装修情况')">
+            <input placeholder="请选择" disabled class="myIpt" v-model="postData.situation">
             <van-icon name="arrow-down" />
           </div>
         </li>
@@ -197,8 +197,8 @@
           <span class="liName">
             当前可用状态
           </span>
-        <div class="inputBox">
-          <input placeholder="请选择" disabled class="myIpt">
+        <div class="inputBox" @tap="showArea('可用状态')">
+          <input placeholder="请选择" disabled class="myIpt" v-model="postData.enable">
           <van-icon name="arrow-down" />
         </div>
         </li>
@@ -206,8 +206,8 @@
           <span class="liName">
             租赁状态
           </span>
-        <div class="inputBox">
-          <input placeholder="请选择" disabled class="myIpt">
+        <div class="inputBox" @tap="showArea('租赁状态')">
+          <input placeholder="请选择" disabled class="myIpt" v-model="postData.status">
           <van-icon name="arrow-down" />
         </div>
         </li>
@@ -216,7 +216,7 @@
       <van-popup
         :show="showTree"
          round position="bottom"
-        custom-style="height:80%;"
+        custom-style="height:50%;"
       >
         <van-cascader
             :value="cascaderValue"
@@ -232,7 +232,14 @@
           position="bottom"
           custom-style="height: 50%;"
       >
-        <van-picker :columns="columns" show-toolbar @cancel="show=false" @confirm="onConfirm" />
+        <van-picker v-show="popType==='区域'" :columns="areaList" show-toolbar @cancel="show=false" @confirm="onConfirm" value-key="label"/>
+        <van-picker v-show="popType==='楼层'" :columns="floorList" show-toolbar @cancel="show=false" @confirm="onConfirm" value-key="label"/>
+        <van-picker v-show="popType==='用途'" :columns="usegeList" show-toolbar @cancel="show=false" @confirm="onConfirm" value-key="label"/>
+        <van-picker v-show="popType==='物业性质'" :columns="natureList" show-toolbar @cancel="show=false" @confirm="onConfirm" value-key="label"/>
+        <van-picker v-show="popType==='朝向'" :columns="cxList" show-toolbar @cancel="show=false" @confirm="onConfirm" value-key="label"/>
+        <van-picker v-show="popType==='装修情况'" :columns="situationList" show-toolbar @cancel="show=false" @confirm="onConfirm" value-key="label"/>
+        <van-picker v-show="popType==='可用状态'" :columns="enableList" show-toolbar @cancel="show=false" @confirm="onConfirm" value-key="label"/>
+        <van-picker v-show="popType==='租赁状态'" :columns="statusList" show-toolbar @cancel="show=false" @confirm="onConfirm" value-key="label"/>
       </van-popup>
     </div>
 </template>
@@ -240,11 +247,23 @@
 <script>
 import {
   getTreeData2,
+  saleControllerGetById,
+  getByCodes,
 } from "@/js_sdk/http";
 export default {
   name: "propertyEditor",
   data(){
     return{
+      dic_key: [
+        "MNP_BUILDING_LCQY",
+        "MNP_BUILDING_LC",
+        "HOUSE_USAGE",
+        "PROPERTY_NATURE",
+        "MNP_BUILDING_CX",
+        "DECORATION_SITUATION",
+        "HOUSE_ENABLE",
+        "HOUSE_STATUS"
+      ],
       fileList: [],
       fileList2: [],
       buildFa:'',
@@ -259,10 +278,33 @@ export default {
       options:[
 
       ],
-      columns: ['杭州', '宁波', '温州', '嘉兴', '湖州']
+      areaList:[],
+      floorList:[],
+      usegeList:[],
+      natureList:[],
+      enableList:[],
+      cxList:[],
+      situationList:[],
+      statusList:[],
+      popType:'',
+      postData:{
+        area:'',
+        floor:'',
+        usege:'',
+        nature:'',
+        cx:'',
+        situation:'',
+      }
     }
   },
-  onLoad(){
+  onLoad(options){
+    console.log('id',options.id)
+    if (options.id){
+      saleControllerGetById(options.id).then(res=>{
+        console.log(res)
+      })
+    }
+    this.getByCodes()
     this.getTree()
   },
   methods:{
@@ -272,9 +314,26 @@ export default {
         this.options = res.data
       })
     },
+
+    async getByCodes() {
+      let data = await getByCodes(JSON.stringify(this.dic_key));
+      this.dic_SelectList = this.$common.handleDicList(data);
+      this.areaList = this.dic_SelectList.MNP_BUILDING_LCQY
+      this.floorList = this.dic_SelectList.MNP_BUILDING_LC
+      this.usegeList = this.dic_SelectList.HOUSE_USAGE
+      this.natureList = this.dic_SelectList.PROPERTY_NATURE
+      this.cxList = this.dic_SelectList.MNP_BUILDING_CX
+      this.situationList = this.dic_SelectList.DECORATION_SITUATION
+      this.enableList = this.dic_SelectList.HOUSE_ENABLE
+      this.statusList = this.dic_SelectList.HOUSE_STATUS
+    },
     showPop(e){
       this.showTree = true
     },
+    showArea(e){
+      this.popType = e
+      this.show = true
+    },
     onFinish(e){
       console.log(e)
       const fieldValue = e.detail.selectedOptions
@@ -285,6 +344,32 @@ export default {
     },
     onConfirm(e){
       console.log(e)
+      switch (this.popType) {
+        case "区域":
+          this.postData.area = e.detail.value.label
+          break;
+        case "楼层":
+          this.postData.floor = e.detail.value.label
+          break;
+        case "用途":
+          this.postData.usege = e.detail.value.label
+          break;
+        case "物业性质":
+          this.postData.nature = e.detail.value.label
+          break;
+        case "朝向":
+          this.postData.cx = e.detail.value.label
+          break;
+        case "装修情况":
+          this.postData.situation = e.detail.value.label
+          break;
+        case "可用状态":
+          this.postData.enable = e.detail.value.label
+          break;
+        case "租赁状态":
+          this.postData.status = e.detail.value.label
+          break;
+      }
       this.show = false
     },
     deleteRYXXZP(event) {