|
|
@ -17,6 +17,18 @@ |
|
|
|
<div class="listconadd"> |
|
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formadd"> |
|
|
|
<el-row style="border-top: 1px solid #E0E3EB"> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>开票类型</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="20"> |
|
|
|
<el-form-item prop="openTickTypeKey"> |
|
|
|
<el-select v-model="formobj.openTickTypeKey" style="width: 30%" filterable placeholder="" @change="changeOpenTick"> |
|
|
|
<el-option v-for="item in openTick_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>开票名称</span> |
|
|
|
</el-col> |
|
|
@ -34,30 +46,40 @@ |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>地址</span> |
|
|
|
<span><span v-show="formobj.openTickTypeKey == '02'" class="icon">*</span>地址</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop="address"><el-input v-model="formobj.address" clearable placeholder="" class="addinputw"></el-input></el-form-item> |
|
|
|
<el-form-item><el-input v-model="formobj.address" clearable placeholder="" class="addinputw"></el-input></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>电话</span> |
|
|
|
<span><span v-show="formobj.openTickTypeKey == '02'" class="icon">*</span>电话</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop="phone"><el-input v-model="formobj.phone" clearable placeholder="" class="addinputw"></el-input></el-form-item> |
|
|
|
<el-form-item><el-input v-model="formobj.phone" clearable placeholder="" class="addinputw"></el-input></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>开户行</span> |
|
|
|
<span><span v-show="formobj.openTickTypeKey == '02'" class="icon">*</span>开户行</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop="bankName"><el-input v-model="formobj.bankName" clearable placeholder="" class="addinputw"></el-input></el-form-item> |
|
|
|
<el-form-item><el-input v-model="formobj.bankName" clearable placeholder="" class="addinputw"></el-input></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span><span class="icon">*</span>银行账号</span> |
|
|
|
<span><span v-show="formobj.openTickTypeKey == '02'" class="icon">*</span>银行账号</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item prop="bankAccount"><el-input v-model="formobj.bankAccount" clearable placeholder="" class="addinputw"></el-input></el-form-item> |
|
|
|
<el-form-item><el-input v-model="formobj.bankAccount" clearable placeholder="" class="addinputw"></el-input></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<span>营业执照</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="20"> |
|
|
|
<el-form-item> |
|
|
|
<upload ref="uploadImg" class="addinputw" v-model="image_list1" :accept="accept" :limit="50" bucket="map" :upload-data="{ type: '0001' }"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
@ -69,15 +91,22 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { fetchDetailsBySid, save } from '@/api/kaipiaoxinxi/openTicket' |
|
|
|
import { getOrgSidByPath,fetchBySid } from '@/api/dictcommons/dictcommons' |
|
|
|
import { getOrgSidByPath, fetchBySid, typeValues } from '@/api/dictcommons/dictcommons' |
|
|
|
import upload from '@/components/uploadFile/upload' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'kaipiaoxinxiAdd', |
|
|
|
name: 'KaiPiaoXinXiAdd', |
|
|
|
components: { |
|
|
|
upload |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
viewTitle: '', |
|
|
|
index: 0, |
|
|
|
tableKey: 0, |
|
|
|
openTick_list: [], |
|
|
|
accept: '.jpg,.jpeg,.png,.JPG,.JPEG', |
|
|
|
image_list1: [], |
|
|
|
// 表单数据 |
|
|
|
formobj: { |
|
|
|
sid: '', // 一条数据的sid |
|
|
@ -90,21 +119,26 @@ export default { |
|
|
|
useOrgName: '', |
|
|
|
useOrgSid: '', |
|
|
|
orgSidPath: '', |
|
|
|
createBySid: '' |
|
|
|
createBySid: '', |
|
|
|
openTickTypeKey: '', |
|
|
|
openTickTypeValue: '', |
|
|
|
yyzzFiles: [] |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
openTickTypeKey: [{ required: true, message: '开票类型不能为空', trigger: 'change' }], |
|
|
|
name: [{ required: true, message: '开票名称不能为空', trigger: 'blur' }], |
|
|
|
taxpayerNo: [{ required: true, message: '纳税人识别号不能为空', trigger: 'blur' }], |
|
|
|
address: [{ required: true, message: '地址不能为空', trigger: 'blur' }], |
|
|
|
phone: [{ required: true, message: '电话不能为空', trigger: 'blur' }], |
|
|
|
bankName: [{ required: true, message: '开户行能为空', trigger: 'blur' }], |
|
|
|
bankAccount: [{ required: true, message: '银行账号不能为空', trigger: 'blur' }] |
|
|
|
taxpayerNo: [{ required: true, message: '纳税人识别号不能为空', trigger: 'blur' }] |
|
|
|
}, |
|
|
|
submitdisabled: false |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
init() { |
|
|
|
typeValues({ type: 'invoiceType' }).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.openTick_list = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
getOrgSidByPath({ orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
this.formobj.useOrgSid = resp.data |
|
|
@ -134,14 +168,57 @@ export default { |
|
|
|
fetchDetailsBySid(sid).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
|
this.formobj = resp.data |
|
|
|
if (this.formobj.yyzzFiles.length > 0) { |
|
|
|
this.formobj.yyzzFiles.forEach((e) => { |
|
|
|
this.image_list1.push({ |
|
|
|
name: '', |
|
|
|
url: e |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch((e) => { |
|
|
|
this.formobj = {} |
|
|
|
}) |
|
|
|
}, |
|
|
|
changeOpenTick(value) { |
|
|
|
const choose = this.openTick_list.filter((item) => item.dictKey === value) |
|
|
|
if (choose != null && choose.length > 0) { |
|
|
|
this.formobj.openTickTypeValue = choose[0].dictValue |
|
|
|
} else { |
|
|
|
this.formobj.openTickTypeValue = '' |
|
|
|
} |
|
|
|
}, |
|
|
|
save() { |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (this.formobj.openTickTypeKey === '02') { |
|
|
|
if (this.formobj.address === '') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '地址不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.formobj.phone === '') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '电话不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.formobj.bankName === '') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '开户行不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.formobj.bankAccount === '') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '银行账号不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.image_list1.length > 0) { |
|
|
|
const aa = [] |
|
|
|
this.image_list1.forEach((e) => { |
|
|
|
aa.push(e.url) |
|
|
|
}) |
|
|
|
this.formobj.yyzzFiles = aa |
|
|
|
} else { |
|
|
|
this.formobj.yyzzFiles = [] |
|
|
|
} |
|
|
|
this.submitdisabled = true |
|
|
|
save(this.formobj).then((resp) => { |
|
|
|
if (resp.success) { |
|
|
@ -172,8 +249,12 @@ export default { |
|
|
|
taxpayerNo: '', |
|
|
|
useOrgName: '', |
|
|
|
useOrgSid: '', |
|
|
|
createBySid: '' |
|
|
|
createBySid: '', |
|
|
|
openTickTypeKey: '', |
|
|
|
openTickTypeValue: '', |
|
|
|
yyzzFiles: [] |
|
|
|
} |
|
|
|
this.image_list1 = [] |
|
|
|
this.submitdisabled = false |
|
|
|
this.$refs['form_obj'].resetFields() |
|
|
|
this.$emit('doback') |
|
|
|