|
|
|
@ -12,27 +12,41 @@
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
<a-select
|
|
|
|
|
placeholder="请输入类型名称"
|
|
|
|
|
v-decorator="['typeName', { rules: [{ required: true, message: '请输入类型名称!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
v-decorator="['typeCode', { rules: [{ required: true, message: '请输入类型名称!' }] }]"
|
|
|
|
|
>
|
|
|
|
|
<a-select-option v-for="item in TypeData" :key="item.code" :value="item.code">
|
|
|
|
|
{{ item.value }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-form-item label="租户名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
<a-input
|
|
|
|
|
<a-select
|
|
|
|
|
placeholder="请输入租户名称"
|
|
|
|
|
v-decorator="['tenantName', { rules: [{ required: true, message: '请输入租户名称!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
>
|
|
|
|
|
<a-select-option v-for="item in SysTenantData" :key="item.id" :value="item.name">
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="8">
|
|
|
|
|
<a-upload :file-list="fileList" :before-upload="beforeUpload" @remove="handleRemove">
|
|
|
|
|
<a-button>
|
|
|
|
|
<upload-outlined></upload-outlined>
|
|
|
|
|
Select File
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-form-item>
|
|
|
|
|
<a-upload
|
|
|
|
|
name="file"
|
|
|
|
|
:file-list="fileList"
|
|
|
|
|
@change="handleChange"
|
|
|
|
|
:customRequest="customRequest"
|
|
|
|
|
:multiple="false"
|
|
|
|
|
:style="{ marginTop: '4px' }"
|
|
|
|
|
>
|
|
|
|
|
<a-button> <a-icon type="upload" /> 文件上传 </a-button>
|
|
|
|
|
</a-upload>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-form>
|
|
|
|
@ -41,11 +55,15 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { BookingPrintTemplateEdit } from '@/api/modular/main/bookingprinttemplate'
|
|
|
|
|
import { BookingPrintTemplateEdit, SysTenantPage } from '@/api/modular/main/bookingprinttemplate'
|
|
|
|
|
import { sysDictDataPage } from '@/api/modular/system/dictDataManage'
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
fileList: '',
|
|
|
|
|
TypeData: [],
|
|
|
|
|
SysTenantData: [],
|
|
|
|
|
file: {},
|
|
|
|
|
fileList: [],
|
|
|
|
|
labelCol: {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 7 }
|
|
|
|
@ -54,52 +72,45 @@ export default {
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
sm: { span: 15 }
|
|
|
|
|
},
|
|
|
|
|
typeData: [],
|
|
|
|
|
visible: false,
|
|
|
|
|
confirmLoading: false,
|
|
|
|
|
form: this.$form.createForm(this)
|
|
|
|
|
form: this.$form.createForm(this),
|
|
|
|
|
data: {}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
SysTenantPage().then(res => {
|
|
|
|
|
console.log(res.data)
|
|
|
|
|
this.SysTenantData = res.data.rows
|
|
|
|
|
})
|
|
|
|
|
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '348569545515077' }).then(res => {
|
|
|
|
|
this.TypeData = res.data.rows
|
|
|
|
|
console.log(this.TypeData, 11111)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
beforeUpload(file) {
|
|
|
|
|
console.log('beforeUpload', file)
|
|
|
|
|
customRequest(data) {
|
|
|
|
|
this.file = data.file
|
|
|
|
|
},
|
|
|
|
|
handleRemove(file) {
|
|
|
|
|
console.log('handleRemove', file)
|
|
|
|
|
handleChange(info) {
|
|
|
|
|
this.fileList = [info.file]
|
|
|
|
|
},
|
|
|
|
|
// 初始化方法
|
|
|
|
|
edit(record) {
|
|
|
|
|
this.data = record
|
|
|
|
|
console.log(record)
|
|
|
|
|
this.visible = true
|
|
|
|
|
const typeOption = this.$options
|
|
|
|
|
this.typeData = typeOption.filters['dictData']('edi_type')
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.form.setFieldsValue({
|
|
|
|
|
addr: record.addr,
|
|
|
|
|
addrEN: record.addrEN,
|
|
|
|
|
chief: record.chief,
|
|
|
|
|
city: record.city,
|
|
|
|
|
createdTime: record.createdTime,
|
|
|
|
|
createdUserId: record.createdUserId,
|
|
|
|
|
createdUserName: record.createdUserName,
|
|
|
|
|
email: record.email,
|
|
|
|
|
fullName: record.fullName,
|
|
|
|
|
fullNameEN: record.fullNameEN,
|
|
|
|
|
typeCode: record.typeCode,
|
|
|
|
|
typeName: record.typeName,
|
|
|
|
|
filePath: record.filePath,
|
|
|
|
|
fileName: record.fileName,
|
|
|
|
|
tenantName: record.tenantName,
|
|
|
|
|
id: record.id,
|
|
|
|
|
invAddrTel: record.invAddrTel,
|
|
|
|
|
invTitle: record.invTitle,
|
|
|
|
|
isDeleted: record.isDeleted,
|
|
|
|
|
province: record.province,
|
|
|
|
|
qq: record.qq,
|
|
|
|
|
rmbAccount: record.rmbAccount,
|
|
|
|
|
rmbBank: record.rmbBank,
|
|
|
|
|
shortName: record.shortName,
|
|
|
|
|
taxNO: record.taxNO,
|
|
|
|
|
tel: record.tel,
|
|
|
|
|
tenantId: record.tenantId,
|
|
|
|
|
usdAccount: record.usdAccount,
|
|
|
|
|
usdBank: record.usdBank,
|
|
|
|
|
webUrl: record.webUrl
|
|
|
|
|
tenantId: record.tenantId
|
|
|
|
|
})
|
|
|
|
|
console.log(this.form.getFieldsValue())
|
|
|
|
|
}, 100)
|
|
|
|
@ -118,8 +129,21 @@ export default {
|
|
|
|
|
values[key] = JSON.stringify(values[key])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log(this.form, values.id)
|
|
|
|
|
BookingPrintTemplateEdit(values)
|
|
|
|
|
this.SysTenantData.forEach(item => {
|
|
|
|
|
if (values.tenantName == item.tenantName) {
|
|
|
|
|
values.tenantId = item.tenantId
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.TypeData.forEach(item => {
|
|
|
|
|
if (values.typeCode == item.code) {
|
|
|
|
|
console.log(item)
|
|
|
|
|
values.TypeName = item.value
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log(this.form.getFieldsValue(), 1111)
|
|
|
|
|
values.id = this.data.id
|
|
|
|
|
console.log(values)
|
|
|
|
|
BookingPrintTemplateEdit({ file: this.file, data: values })
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$message.success('编辑成功')
|
|
|
|
@ -127,10 +151,14 @@ export default {
|
|
|
|
|
this.$emit('ok', values)
|
|
|
|
|
this.handleCancel()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('编辑失败') // + res.message
|
|
|
|
|
this.$message.error(`编辑失败,${res.message}`)
|
|
|
|
|
}
|
|
|
|
|
this.file = {}
|
|
|
|
|
this.fileList = []
|
|
|
|
|
})
|
|
|
|
|
.finally(res => {
|
|
|
|
|
this.file = {}
|
|
|
|
|
this.fileList = []
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|