Bladeren bron

feat(order): 编辑发票功能

- 在 order.js 中添加 invoiceInfo state 和 setInvoiceInfo mutation
- 在 InvoiceInfo 组件中实现编辑发票功能,使用 uploadInvoiceModule 组件
- 在 uploadInvoiceContent 中添加表单验证和回显逻辑
- 优化 uploadInvoiceModule 组件,添加状态更新回调

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 1 maand geleden
bovenliggende
commit
724ef2b0b1

+ 5 - 0
src/store/order.js

@@ -62,6 +62,8 @@ export default {
     orderInfo: cloneDeep(defaultOrderInfo),
     // 订单详情
     orderDetail: {},
+    // 编辑发票-当前发票信息
+    invoiceInfo: {},
   },
   getters: {
     productListWithHistory(state) {
@@ -233,6 +235,9 @@ export default {
     },
   },
   mutations: {
+    setInvoiceInfo(state, payload = {}) {
+      state.invoiceInfo = payload 
+    },
     setHistoryProductList(state, payload = {}) {
       if (!payload.code) return
       const same = state.historyProductList.find(t => t.code === payload.code)

+ 14 - 5
src/views/create-order/components/order-detail-submodule/InvoiceInfo.vue

@@ -35,6 +35,7 @@
               <span class="column-cell" v-if="row.row.code_url" @click="getInvoiceInfo(row.row)">查看开票二维码</span>
               <span class="column-cell" v-if="showAgainBtn(row.row)" @click="againInvoce(row.row)">重新开票</span>
               <span class="column-cell" v-if="showEditBtn()" @click="editInvoice(row.row)">编辑发票</span>
+              <!-- <span class="column-cell" @click="editInvoice(row.row)">编辑发票</span> -->
             </div>
           </template>
           <template v-slot:invoice_money="{ row }">
@@ -63,6 +64,10 @@
       ref="invoiceDetailRef"
       :codeDetail="selectInvoice"
     />
+    <uploadInvoiceModule
+      ref="uploadInvoiceModule"
+      @refresh="doRefresh"
+    />
   </div>
 </template>
 <script>
@@ -70,6 +75,7 @@ import InfoCard from '../../ui/InfoCard.vue';
 import TableCard from '../../ui/TableCard.vue';
 import newSetOrderInfo from '../newSetOrderInfo.vue';
 import newCodeModel from '@/views/order/components/new-codeModel.vue';
+import uploadInvoiceModule from '../uploadInvoiceModule.vue';
 import { mapState } from 'vuex';
 export default {
   name: 'InvoiceInfo',
@@ -77,7 +83,8 @@ export default {
     InfoCard,
     TableCard,
     newSetOrderInfo,
-    newCodeModel
+    newCodeModel,
+    uploadInvoiceModule
   },
   data() {
     return {
@@ -185,14 +192,16 @@ export default {
       window.open(path, '_blank')
     },
     editInvoice(item) {
-      const { code_url } = item
-      const URLS = new URL(code_url)
-      const domain = URLS.origin;
+      this.$store.commit('order/setInvoiceInfo', item);
+      this.$refs.uploadInvoiceModule.uploadDialogVisible = true;
     },
     getInvoiceDetailInfo(item) {
       this.selectInvoice = item;
       this.$refs.invoiceDetailRef.codeShow = true;
-    }
+    },
+    doRefresh (type = '') {
+      this.$emit('refresh', type)
+    },
   },
 }
 </script>

+ 1 - 1
src/views/create-order/components/order-detail-submodule/OrderActions.vue

@@ -161,7 +161,7 @@
     <!-- 盖章记录弹窗-->
     <sealDialog ref="sealDialogRef" :new-api="true" @refresh="doRefresh('盖章记录')" />
     <!-- 上传发票弹框 -->
-     <uploadInvoiceModule ref="uploadInvoiceRef"></uploadInvoiceModule>
+     <uploadInvoiceModule @refresh="doRefresh" ref="uploadInvoiceRef"></uploadInvoiceModule>
   </div>
 </template>
 

+ 2 - 2
src/views/create-order/components/order-detail-submodule/OrderDetailCardProductList.vue

@@ -343,9 +343,9 @@ export default {
       return div(a, b)
     },
     buildSupServiceIds(parfilter) {
-      const { supServiceIds, buyAccountCount, giftAccountCount } = parfilter
+      const { supServiceIds, buyAccountCount, giftAccountCount, addAreaCount } = parfilter
       const upgradeContent = []
-      if (supServiceIds && supServiceIds.length > 0) {
+      if ((supServiceIds && supServiceIds.length > 0) || addAreaCount ) {
         upgradeContent.push('补充权益')
       }
       if(buyAccountCount || giftAccountCount) {

+ 17 - 5
src/views/create-order/components/order-detail-submodule/OrderDetailCardProductSummarize.vue

@@ -184,14 +184,26 @@ export default {
       const totalDiscountRate = div(totalFinalPrice, totalOriginalPrice) * 100
       const rateTotal = totalDiscountRate ? (div(totalFinalPrice, totalOriginalPrice) * 100).toFixed(2) + '%' : '0%'
       // 判断productData中每一项的original_price是否为0,如果有,则返回true
-      const isAllOriginalPriceZero = productData.map(item => item.original_price === 0);
-      console.log(isAllOriginalPriceZero, 'isAllOriginalPriceZero')
-      const isAllOriginalPriceZeroBool = !isAllOriginalPriceZero.includes(true)
+      // const isAllOriginalPriceZero = productData.map(item => item.original_price === 0);
+      // console.log(isAllOriginalPriceZero, 'isAllOriginalPriceZero')
+      // const isAllOriginalPriceZeroBool = !isAllOriginalPriceZero.includes(true)
+
+      // 无标准售价产品,标准售价合计展示为无法计算
+      const noOriginalPriceProduct = ['企业商机管理', '医械通', '物业数字化营销', '运营商专版']
+      let noOriginalPriceProductBool = false
+      noOriginalPriceProduct.forEach(item => {
+        productData.forEach(product => {
+          if(product.product_type.includes(item)) {
+            noOriginalPriceProductBool = true
+          } 
+        })
+      })
+      const originalPriceTotal = !noOriginalPriceProductBool
       this.orderData = {
         ...this.orderData,
         final_price_total: totalFinalPrice,
-        original_price_total: Number(totalOriginalPrice) && isAllOriginalPriceZeroBool ? '¥' + totalOriginalPrice : '无法计算',
-        rate_total: Number(totalOriginalPrice) && isAllOriginalPriceZeroBool ? rateTotal : '无法计算'
+        original_price_total: originalPriceTotal ? '¥' + totalOriginalPrice : '无法计算',
+        rate_total: originalPriceTotal && Number(totalOriginalPrice) ? rateTotal : '无法计算'
       }
     },
 

+ 13 - 2
src/views/create-order/components/order-detail-submodule/SelectOrderDetailCard.vue

@@ -652,9 +652,20 @@ export default {
       const totalOriginalPrice = productData.reduce((acc, cur) => acc + Number(cur.original_price), 0).toFixed(2);
       const rateTotal = div(totalFinalPrice, totalOriginalPrice) ? (div(totalFinalPrice, totalOriginalPrice) * 100).toFixed(2) + '%' : '无法计算';
 
+      // 无标准售价产品,标准售价合计展示为无法计算
+      const noOriginalPriceProduct = ['企业商机管理', '医械通', '物业数字化营销', '运营商专版']
+      let noOriginalPriceProductBool = false
+      noOriginalPriceProduct.forEach(item => {
+        productData.forEach(product => {
+          if(product.product_type.includes(item)) {
+            noOriginalPriceProductBool = true
+          } 
+        })
+      })
+      const originalPriceTotal = !noOriginalPriceProductBool
       this.orderData.final_price_total = totalFinalPrice;
-      this.orderData.original_price_total = Number(totalOriginalPrice) ? '¥' + totalOriginalPrice : '无法计算';
-      this.orderData.rate_total = Number(totalOriginalPrice) ? rateTotal : '无法计算';
+      this.orderData.original_price_total = originalPriceTotal ? '¥' + totalOriginalPrice : '无法计算';
+      this.orderData.rate_total = originalPriceTotal && Number(totalOriginalPrice) ? rateTotal : '无法计算';
     },
 
     // flattenLinkOrderList(linkOrderList) {

+ 168 - 317
src/views/create-order/components/uploadInvoiceContent.vue

@@ -24,10 +24,10 @@
         </el-col>
       </el-form-item>
       <el-form-item label="开票金额合计" prop="allMoney">
-        <el-input v-model="ruleForm.allMoney" placeholder="请输入开票金额合计"></el-input>
+        <el-input type="number" v-model="ruleForm.allMoney" placeholder="请输入开票金额合计"></el-input>
       </el-form-item>
       <el-form-item label="该笔订单开票金额" prop="money">
-        <el-input v-model="ruleForm.money" placeholder="请输入该笔订单开票金额"></el-input>
+        <el-input type="number" v-model="ruleForm.money" placeholder="请输入该笔订单开票金额"></el-input>
       </el-form-item>
       <el-form-item label="开票主体" prop="signing_subject">
         <el-select v-model="ruleForm.signing_subject" placeholder="请选择开票主体">
@@ -40,11 +40,9 @@
           <el-radio v-for="item in typelist" :key="item.value" :label="item.value">{{ item.text }}</el-radio>
         </el-radio-group>
       </el-form-item>
-      <el-form-item label="发票内容" prop="content">
-        <el-select v-model="ruleForm.content" placeholder="请选择发票内容">
-          <el-option label="技术服务费" value="1"></el-option>
-          <el-option label="会员费" value="2"></el-option>
-          <el-option label="招投标数据服务" value="3"></el-option>
+      <el-form-item label="发票内容" prop="invoice_content">
+        <el-select v-model="ruleForm.invoice_content" placeholder="请选择发票内容">
+          <el-option v-for="item in contentList" :key="item.value" :value="item.value">{{ item.label }}</el-option>
         </el-select>
       </el-form-item>
       <el-form-item label="发票抬头" prop="invoiceHeader">
@@ -70,8 +68,8 @@
             @blur="entOnChange('blur')"
           ></el-input>
         </el-form-item>
-        <el-form-item label="单位税号" prop="dutyparagraph">
-          <el-input v-model="ruleForm.dutyparagraph" placeholder="请输入纳税人识别号"></el-input>
+        <el-form-item label="单位税号" prop="taxpayer_identnum">
+          <el-input v-model="ruleForm.taxpayer_identnum" placeholder="请输入纳税人识别号"></el-input>
         </el-form-item>
         <el-form-item label="单位地址" prop="unitAddress">
           <el-input v-model="ruleForm.unitAddress" placeholder="请输入单位地址"></el-input>
@@ -107,7 +105,6 @@
             v-model="ruleForm.desc" 
             type="textarea"
             placeholder="此部分内容会展示在发票“备注”上,请按照贵司财务要求进行填写"
-            @focus="infoCheckMap.desc = ''"
           ></el-input>
         </el-form-item>
       </div>
@@ -129,11 +126,72 @@
 <script>
 import bUpload from '@/components/uploadFile.vue'
 import { replaceKeyword } from '../hooks/utils'
+import { mapState } from 'vuex'
 import { ajaxGetCompanyAssociation, ajaxUploadInvoice } from '@/api/modules/'
 export default {
   name: "uploadInvoiceContent",
   components: { bUpload },
   data() {
+    var validatePhone = (rule, value, callback) => {
+      if (value === '') {
+        callback(new Error('请输入联系电话'));
+      } else {
+        const test = /^(1[3-9|])\d{9}$|^0\d{2,3}-?\d{7,8}(-\d{1,4})?$|^400[016-9]\d{6}$|^400-[016-9]\d{2}-\d{4}$/.test(value)
+        if (!test) {
+           callback(new Error('请输入正确的联系电话')); 
+        }
+        callback();
+      }
+    };
+    var validateEmail = (rule, value, callback) => {
+      if (value === '') {
+        callback(new Error('请输入电子邮箱'));
+      } else {
+        const test = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/.test(value)
+        if (!test) {
+           callback(new Error('请输入正确的电子邮箱')); 
+        }
+        callback();
+      }
+    }
+    var validateDutyparagraph = (rule, value, callback) => {
+      if (value === '') {
+        callback(new Error('纳税人识别号为必填项')); 
+      } else {
+        const test = /^[0-9A-Za-z]{15,18}$/.test(value)
+        if (!test) {
+           callback(new Error('请输入正确的纳税人识别号')); 
+        }
+        callback();
+      }
+    }
+    var validateCompany = (rule, value, callback) => {
+      if (value === '') {
+        callback(new Error('请输入公司名称')); 
+      } else {
+        const test = /^[\u4e00-\u9fa5]{2,50}$/.test(value)
+        if (!test) {
+          callback(new Error('请输入正确格式的公司名称'));
+          if(value.length < 2) {
+            callback(new Error('公司名称至少输入2个字')); 
+          } else if(value.length > 50) {
+            callback(new Error('公司名称最多输入50个字'));
+          }
+        }
+        callback();
+      }
+    }
+    var validateInvoiceNumber = (rule, value, callback) => {
+      if (!value) {
+        callback(new Error('请输入发票号码')); 
+      } else {
+        // const test = /^[0-9]{1,20}$/.test(value)
+        // if (!test) {
+        //   callback(new Error('请输入正确格式的发票号码')); 
+        // }
+        callback();
+      }
+    }
     return {
       typelist: [
         { text: '电子普通发票', value: '1' },
@@ -145,6 +203,11 @@ export default {
         { text: '个人', value: '1' },
         { text: '单位', value: '2' }
       ],
+      contentList: [
+        { label: '技术服务费', value: 1 },
+        { label: '会员费', value: 2 },
+        { label: '招投标数据服务', value: 3 } 
+      ],
       searchList: [],
       isAssociateShow: false,
       showDesc: false,
@@ -160,7 +223,7 @@ export default {
         invoice_content: '',
         invoiceHeader: '2',
         company: '',
-        dutyparagraph: '',
+        taxpayer_identnum: '',
         unitAddress: '',
         tel: '',
         bank: '',
@@ -169,38 +232,13 @@ export default {
         phone: '',
         email: '',
       },
-      showModule: {
-        company: false,
-        dutyparagraph: false,
-        bankCode: false,
-        bank: false,
-        tel: false,
-        unitAddress: false,
-        desc: false,
-        name: false,
-        phone: true,
-        deliveryAddress: false,
-        email: false
-      },
-      infoCheckMap: {
-        company: '',
-        dutyparagraph: '',
-        unitAddress: '',
-        phone: '',
-        bank: '',
-        bankCode: '',
-        desc: '',
-        tel: '',
-        email: '',
-        deliveryAddress: '',
-        name: ''
-      },
       rules: {
         addressUrl: [
           { required: true, message: '请上传发票', trigger: 'blur' },
         ],
         invoice_number: [
-          { required: true, message: '请输入发票号码', trigger: 'blur' }
+          { required: true, message: '请输入发票号码', trigger: 'blur' },
+          { validator: validateInvoiceNumber, trigger: 'blur' }
         ],
         billing_time: [
           { type: 'date', required: true, message: '请选择开票时间', trigger: 'change' }
@@ -224,33 +262,99 @@ export default {
           { required: true, message: '请选择发票抬头', trigger: 'change' }
         ],
         company: [
-          { required: true, message: '请输入公司名称', trigger: 'blur' }
+          { required: true, message: '请输入公司名称', trigger: 'blur' },
+          { validator: validateCompany, trigger: 'blur' }
         ],
-        dutyparagraph: [
-          { required: true, message: '纳税人识别号为必填项', trigger: 'blur' } 
+        taxpayer_identnum: [
+          { required: true, message: '纳税人识别号为必填项', trigger: 'blur' },
+          { validator: validateDutyparagraph, trigger: 'blur' }
         ],
         phone: [
-          { required: true, message: '请输入联系电话', trigger: 'blur' } 
+          { required: true, message: '请输入联系电话', trigger: 'blur' },
+          { validator: validatePhone, trigger: 'blur' }
         ],
         email: [
-          { required: true, message: '请输入电子邮箱', trigger: 'blur' }  
+          { required: true, message: '请输入电子邮箱', trigger: 'blur' },
+          { validator: validateEmail, trigger: 'blur' }
         ]
 
       }
     }
   },
+  watch: {
+    invoiceInfo: {
+       handler(val) { 
+        // 判断val是否是空对象
+        if (Object.keys(val).length) {
+          this.setShowInfo(val)
+        }
+      },
+      deep: true,
+      immediate: true
+    }
+  },
   computed: {
+    ...mapState({
+      invoiceInfo: state => state.order.invoiceInfo,
+    }),
     showCompnayModule() {
       return this.ruleForm.invoiceHeader === '2'
     }
   },
+  mounted() {
+    console.log(this.invoiceInfo, 'invoiceInfo')
+  },
   methods: {
+    // 回显数据
+    setShowInfo(val) {
+      console.log(val, 'val')
+      const { 
+        address_url, 
+        billing_time, 
+        invoice_number, 
+        invoice_money, 
+        invoice_order_money, 
+        invoicing_entity,
+        company_name,
+        taxpayer_identnum, // 纳税人识别号
+        company_address, // 单位地址
+        company_phone, // 联系电话
+        bank_name, // 开户银行
+        bank_account, // 银行账号
+        remark, // 备注
+        phone,
+        mail,
+      } = val
+      const invoice_variety = this.typelist.find(item => item.text === val.invoice_variety)
+      const invoice_content = this.contentList.find(item => '信息技术服务-' + item.label === val.invoice_content)
+      const invoice_type = this.invoiceHeaderList.find(item => item.text === val.invoice_type)
+      console.log(invoice_content, 'invoice_content')
+      this.ruleForm = {
+        addressUrl: address_url,
+        billing_time: billing_time ?  new Date(billing_time *1000) : '',
+        invoice_number: invoice_number, 
+        allMoney: invoice_money,
+        money: invoice_order_money,
+        signing_subject: invoicing_entity,
+        invoice_variety: invoice_variety?.value || '1',
+        invoice_content: invoice_content.label || '技术服务费',
+        invoiceHeader: invoice_type.value || '1',
+        company: company_name,
+        taxpayer_identnum,
+        unitAddress: company_address,
+        tel: company_phone,
+        bank: bank_name,
+        bankCode: bank_account,
+        desc: remark,
+        phone: phone,
+        email: mail
+      }
+    },
     invoiceFile(val) {
       this.ruleForm.addressUrl = val
     },
     entOnChange(type) {
       if (type === 'blur') {
-        this.getCheckMap('company')
         setTimeout(() => {
           this.isAssociateShow = false
           this.searchList = []
@@ -301,32 +405,12 @@ export default {
         ]
       }
     },
-    checkDutyparagraph() {
-      if (
-        this.ruleForm.dutyparagraph.trim().length === 18 ||
-        this.ruleForm.dutyparagraph.trim().length === 15 ||
-        this.ruleForm.dutyparagraph.trim().length === 20
-      ) {
-        return true
-      }
-      return false
-    },
     selectEnt(item) {
       console.log('item', item)
       this.ruleForm.company = item.name ? item.name : ''
-      this.ruleForm.dutyparagraph = item.taxCode ? item.taxCode : ''
+      this.ruleForm.taxpayer_identnum = item.taxCode ? item.taxCode : ''
       this.isAssociateShow = false
       this.searchList = []
-      if (this.checkVerify('company')) {
-        this.infoCheckMap.company = ''
-      } else {
-        this.getCheckMap('company')
-      }
-      if (this.checkVerify('dutyparagraph')) {
-        this.infoCheckMap.dutyparagraph = ''
-      } else {
-        this.getCheckMap('dutyparagraph')
-      }
     },
     submitForm(formName) {
 
@@ -341,13 +425,18 @@ export default {
     },
     async setUploadAjax() {
       const { id } = this.$route.params;
-      console.log('id', id)
+      const { invoiceId } = this.invoiceInfo;
       const { fileUrl, invoice_number, billing_time, allMoney, money, signing_subject, invoice_variety, invoice_content, invoiceHeader, desc, phone, email} = this.ruleForm;
       const paramsEnt = {
         ...this.ruleForm,
-        addressUrl: this.ruleForm.fileUrl,
+        id: invoiceId || '',
+        orderCode: id,
+        addressUrl: fileUrl,
+        allMoney: Number(allMoney),
+        money:  Number(money),
       }
       const paramsPerson = {
+        id: invoiceId || '',
         orderCode: id,
         addressUrl: fileUrl,
         invoice_number,
@@ -363,265 +452,26 @@ export default {
         email
       }
       const params = invoiceHeader === '1' ? paramsPerson : paramsEnt;
-      const { error_code: code, data } = await ajaxUploadInvoice(params);
+      const { error_code: code, error_msg: msg, data } = await ajaxUploadInvoice(params);
       console.log('code', code, data)
       if(code === 0) {
+        const message = invoiceId ? '编辑成功' : '上传成功'
         this.$message({
           type: 'success',
-          message: '上传成功'
+          message
+        })
+        this.$emit('refresh', '发票信息')
+      } else {
+        this.$message({
+          type: 'error',
+          message: msg
         })
       }
+      this.$emit('update', false)
     },
     resetForm(formName) {
       this.$refs[formName].resetFields();
-    },
-    getCheckMap(type) {
-      switch (type) {
-        case 'name': {
-          this.infoCheckMap.name =
-            this.ruleForm.name === '' ? '收件人为必填项' : ''
-          if (this.infoCheckMap.name === '' && !this.checkName) {
-            this.infoCheckMap.name = '请输入正确格式的收件人'
-          }
-          break
-        }
-        case 'tel': {
-          if (this.requireds.tel) {
-            this.infoCheckMap.tel =
-              this.ruleForm.tel === '' ? '电话号码为必填项' : ''
-          }
-          if (
-            this.ruleForm.tel &&
-            this.infoCheckMap.tel === '' &&
-            !this.checkPhone(this.ruleForm.tel)
-          ) {
-            this.infoCheckMap.tel = '电话号码格式不正确'
-          }
-          break
-        }
-        case 'phone': {
-          this.infoCheckMap.phone =
-            this.ruleForm.phone === '' ? '联系电话为必填项' : ''
-          if (
-            this.infoCheckMap.phone === '' &&
-            !this.checkPhone(this.ruleForm.phone)
-          ) {
-            this.infoCheckMap.phone = '联系电话格式不正确'
-          }
-          break
-        }
-        case 'email': {
-          this.infoCheckMap.email =
-            this.ruleForm.email === '' ? '邮箱为必填项' : ''
-          if (this.infoCheckMap.email === '' && !this.checkEmail) {
-            this.infoCheckMap.email = '请输入正确格式的邮箱'
-          }
-          break
-        }
-        case 'company': {
-          this.infoCheckMap.company =
-            this.ruleForm.company === '' ? '公司名称为必填项' : ''
-          if (this.infoCheckMap.company === '' && !this.checkEntName) {
-            this.infoCheckMap.company = '请输入正确格式的公司名称'
-            if (this.ruleForm.company.length < 2) {
-              this.infoCheckMap.company = '公司名称至少输入2个字'
-            }
-            if (this.ruleForm.company.length > 50) {
-              this.infoCheckMap.company = '公司名称最多输入50个字'
-            }
-          }
-          break
-        }
-        case 'dutyparagraph': {
-          this.infoCheckMap.dutyparagraph =
-            this.ruleForm.dutyparagraph === '' ? '纳税人识别号为必填项' : ''
-          if (
-            this.infoCheckMap.dutyparagraph === '' &&
-            !this.checkDutyparagraph
-          ) {
-            this.infoCheckMap.dutyparagraph = '请输入正确格式的纳税人识别号'
-          }
-          break
-        }
-        case 'bankCode': {
-          if (this.requireds.bankCode) {
-            this.infoCheckMap.bankCode =
-              this.ruleForm.bankCode === '' ? '银行账号为必填项' : ''
-          }
-          if (this.ruleForm.bankCode && !this.checkBankcode) {
-            this.infoCheckMap.bankCode = '请输入正确格式的银行账号'
-          }
-          break
-        }
-        case 'bank': {
-          if (this.requireds.bank) {
-            this.infoCheckMap.bank =
-              this.ruleForm.bank === '' ? '开户银行为必填项' : ''
-          }
-          break
-        }
-        case 'unitAddress': {
-          if (this.requireds.unitAddress) {
-            this.infoCheckMap.unitAddress =
-              this.ruleForm.unitAddress === '' ? '单位地址为必填项' : ''
-          }
-          break
-        }
-        case 'deliveryAddress': {
-          if (this.requireds.deliveryAddress) {
-            this.infoCheckMap.deliveryAddress =
-              this.ruleForm.deliveryAddress === '' ? '收件地址为必填项' : ''
-          }
-          break
-        }
-      }
-    },
-    checkPhone(val) {
-      // 手机号:13/14/15/16/17/18/19开头 + 9位数字(共11位)
-      // 固定电话:区号(3-4位) + - + 号码(7-8位) + 可选分机号(1-4位)
-      // 400电话(共10位):400开头 + 7位数字 或 400-xxx-xxxx 格式
-      return /^(1[3-9|])\d{9}$|^0\d{2,3}-?\d{7,8}(-\d{1,4})?$|^400[016-9]\d{6}$|^400-[016-9]\d{2}-\d{4}$/.test(
-        val
-      )
-    },
-    checkVerify(type) {
-      switch (type) {
-        case 'name': {
-          if (
-            (this.ruleForm.name === '' || !this.checkName) &&
-            this.showModule.name
-          ) {
-            return false
-          } else {
-            return true
-          }
-        }
-        case 'tel': {
-          if (this.showModule.tel) {
-            if (
-              !this.requireds.tel &&
-              !this.checkPhone(this.ruleForm.tel) &&
-              this.ruleForm.tel
-            ) {
-              return false
-            } else if (
-              (this.ruleForm.tel === '' || !this.checkPhone(this.ruleForm.tel)) &&
-              this.requireds.tel
-            ) {
-              return false
-            } else {
-              return true
-            }
-          } else {
-            return true
-          }
-        }
-        case 'phone': {
-          if (
-            this.ruleForm.phone === '' ||
-            (!this.checkPhone(this.ruleForm.phone) && this.showModule.phone)
-          ) {
-            return false
-          } else {
-            return true
-          }
-        }
-        case 'email': {
-          if (
-            (this.ruleForm.email === '' || !this.checkEmail) &&
-            this.showModule.email
-          ) {
-            return false
-          } else {
-            return true
-          }
-        }
-        case 'company': {
-          if (
-            this.ruleForm.company === '' &&
-            !this.checkEntName &&
-            this.showModule.company
-          ) {
-            return false
-          } else if (
-            this.ruleForm.company.length < 2 &&
-            this.showModule.company
-          ) {
-            return false
-          } else if (
-            this.ruleForm.company.length > 50 &&
-            this.showModule.company
-          ) {
-            return false
-          } else {
-            return true
-          }
-        }
-        case 'dutyparagraph': {
-          if (
-            (this.ruleForm.dutyparagraph === '' || !this.checkDutyparagraph) &&
-            this.showModule.dutyparagraph
-          ) {
-            return false
-          } else {
-            return true
-          }
-        }
-        case 'bankCode': {
-          if (this.showModule.bankCode) {
-            if (
-              !this.requireds.bankCode &&
-              !this.checkBankcode &&
-              this.ruleForm.bankCode
-            ) {
-              return false
-            } else if (
-              (this.ruleForm.bankCode === '' || !this.checkBankcode) &&
-              this.requireds.bankCode
-            ) {
-              return false
-            } else {
-              return true
-            }
-          } else {
-            return true
-          }
-        }
-        case 'bank': {
-          if (
-            this.requireds.bank &&
-            this.ruleForm.bank === '' &&
-            this.showModule.bank
-          ) {
-            return false
-          } else {
-            return true
-          }
-        }
-        case 'unitAddress': {
-          if (
-            this.requireds.unitAddress &&
-            this.ruleForm.unitAddress === '' &&
-            this.showModule.unitAddress
-          ) {
-            return false
-          } else {
-            return true
-          }
-        }
-        case 'deliveryAddress': {
-          if (
-            this.requireds.deliveryAddress &&
-            this.ruleForm.deliveryAddress === '' &&
-            this.showModule.deliveryAddress
-          ) {
-            return false
-          } else {
-            return true
-          }
-        }
-      }
-    },
+    }
   },
 }
 </script>
@@ -667,6 +517,7 @@ export default {
   }
   ::v-deep {
     .ivu-input-default {
+      padding: 4px 15px;
       height: 40px;
       line-height: 40px;
     }

+ 4 - 4
src/views/create-order/components/uploadInvoiceModule.vue

@@ -11,7 +11,7 @@
       center
       width="60%"
     >
-      <uploadInvoiceContent ref="uploadInvoiceContentRef"></uploadInvoiceContent>
+      <uploadInvoiceContent @update="updateStatus" ref="uploadInvoiceContentRef"></uploadInvoiceContent>
     </Dialog>
   </div>
 </template>
@@ -24,9 +24,6 @@ export default {
   components: {
     Dialog,
     uploadInvoiceContent
-  },
-  props: {
-    
   },
   data() {
     return {
@@ -40,6 +37,9 @@ export default {
     uploadCancel() {
       this.uploadDialogVisible = false;
       this.$refs.uploadInvoiceContentRef.resetForm('ruleForm') 
+    },
+    updateStatus(status) {
+      this.uploadDialogVisible = status; 
     }
   }
 }