chenrui преди 4 години
родител
ревизия
6b088d651b
променени са 1 файла, в които са добавени 6 реда и са изтрити 9 реда
  1. 6 9
      src/views/supplierManagement/supplierInfo/edit.vue

+ 6 - 9
src/views/supplierManagement/supplierInfo/edit.vue

@@ -166,13 +166,6 @@
               </a-col>
               <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
                 <a-form-model-item label="成立时间" prop="buildDate">
-                  <!-- <a-date-picker
-                    style="width:100%"
-                    id="supplierInfoEdit-buildDate"
-                    :disabledDate="disabledDate"
-                    v-model="form.buildDate"
-                    :format="dateFormat"
-                    placeholder="请选择日期" /> -->
                   <a-date-picker
                     style="width:100%"
                     id="supplierInfoEdit-buildDate"
@@ -347,7 +340,9 @@ export default {
       supplierDetail({ sn: this.$route.params.id }).then(res => {
         if (res.status == 200) {
           this.form = Object.assign(this.form, res.data)
-          this.form.buildDate = moment(res.data.buildDate, 'YYYY-MM-DD')
+          if (res.data.buildDate) {
+            this.form.buildDate = moment(res.data.buildDate, 'YYYY-MM-DD')
+          }
           this.form.cooperateFlag = Number(this.form.cooperateFlag)
           this.getArea('city', this.form.provinceSn)
           this.getArea('district', this.form.citySn)
@@ -360,7 +355,9 @@ export default {
         if (valid) {
           console.log(this.form, 'form data')
           const form = JSON.parse(JSON.stringify(this.form))
-          form.buildDate = moment(form.buildDate).format('YYYY-MM-DD') + ' 00:00:00'
+          if (form.buildDate) {
+            form.buildDate = moment(form.buildDate).format('YYYY-MM-DD') + ' 00:00:00'
+          }
           supplierSave(form).then(res => {
             if (res.status == 200) {
               this.$message.success(res.message)