|
@@ -0,0 +1,254 @@
|
|
|
+<template>
|
|
|
+ <zj-form-container ref="formRef" :form-data="formData" :form-rules="formRules">
|
|
|
+ <zj-form-module title="调拨单" :form-data="formData" :form-items="formItems" label-width="100px" :column="3" />
|
|
|
+ <zj-form-module title="调拨单明细" :form-items="detailData" label-width="0" :column="3" />
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" size="default" @click="onSubmit">提交</el-button>
|
|
|
+ <el-button size="default" @click="onSave">保存</el-button>
|
|
|
+ <el-button size="default" @click="onReset">重置</el-button>
|
|
|
+ </div>
|
|
|
+ </zj-form-container>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ props: {
|
|
|
+ edit: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ details: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ formData: {
|
|
|
+ categoryType: 'HOME',
|
|
|
+ contractTemplateImg: '',
|
|
|
+ contractTemplateName: '',
|
|
|
+ contractTemplatePdf: '',
|
|
|
+ contractType: 'MAIN',
|
|
|
+ followContractTemplateId: '',
|
|
|
+ followType: '',
|
|
|
+ mainContractUse: 'MAIN',
|
|
|
+ signObj: 'WORKER',
|
|
|
+ status: 'ON',
|
|
|
+ websitId: '',
|
|
|
+ websitName: ''
|
|
|
+ },
|
|
|
+ formRules: {
|
|
|
+ websitId: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
+ categoryType: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
+ contractTemplateImg: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
+ contractTemplateName: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
+ contractTemplatePdf: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
+ contractType: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
+ mainContractUse: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
+ signObj: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
+ status: [{ required: true, message: '必填项', trigger: 'blur' }],
|
|
|
+ followType: [{ required: true, message: '必填项', trigger: 'blur' }]
|
|
|
+ },
|
|
|
+ fileType: ['word', 'excel', 'ppt', 'pdf'],
|
|
|
+ fileList: [],
|
|
|
+ fileList2: [],
|
|
|
+ srcList: [],
|
|
|
+ dict: [],
|
|
|
+ mainContractList: [],
|
|
|
+ serviceProviderList: [],
|
|
|
+ filetype: [],
|
|
|
+ authList: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ formItems() {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ name: 'el-input',
|
|
|
+ md: 6,
|
|
|
+ attributes: {},
|
|
|
+ formItemAttributes: { label: '商家编号', prop: 'contractTemplateName' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'el-input',
|
|
|
+ md: 6,
|
|
|
+ attributes: {},
|
|
|
+ formItemAttributes: { label: '商家名称', prop: 'contractTemplateName' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'el-date-picker',
|
|
|
+ md: 6,
|
|
|
+ attributes: { type: 'datetime', style: { width: '100%' }, placeholder: '选择日期时间' },
|
|
|
+ formItemAttributes: { label: '调整日期', prop: 'contractTemplateName' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'el-input',
|
|
|
+ md: 6,
|
|
|
+ attributes: {},
|
|
|
+ formItemAttributes: { label: '制单人', prop: 'contractTemplateName' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'el-input',
|
|
|
+ md: 6,
|
|
|
+ attributes: {},
|
|
|
+ formItemAttributes: { label: '商家编号', prop: 'contractTemplateName' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'el-select',
|
|
|
+ options: this.authList,
|
|
|
+ md: 6,
|
|
|
+ attributes: {
|
|
|
+ clearable: true,
|
|
|
+ filterable: true
|
|
|
+ },
|
|
|
+ formItemAttributes: { label: '商家名称', prop: 'websitId' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'el-input',
|
|
|
+ md: 6,
|
|
|
+ attributes: {},
|
|
|
+ formItemAttributes: { label: '调拨仓库', prop: 'contractTemplateName' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'el-input',
|
|
|
+ md: 6,
|
|
|
+ attributes: {},
|
|
|
+ formItemAttributes: { label: '制单时间', prop: 'contractTemplateName' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'el-input',
|
|
|
+ md: 6,
|
|
|
+ attributes: { type: 'textarea', style: { width: '100%' }},
|
|
|
+ formItemAttributes: { label: '备注', prop: 'contractTemplateName' }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ detailData() {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ name: 'slot-component',
|
|
|
+ md: 24,
|
|
|
+ attributes: { disabled: false },
|
|
|
+ formItemAttributes: { label: '', prop: '' },
|
|
|
+ render: (h, { props, onInput }) => {
|
|
|
+ var { value } = props
|
|
|
+ return <zj-table></zj-table>
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getAuthList()
|
|
|
+ this.getTemplateList()
|
|
|
+ // this.getProviderList()
|
|
|
+ this.getTemplateFollowType()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getAuthList() {
|
|
|
+ getAuthList({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: -1
|
|
|
+ }).then(res => {
|
|
|
+ this.authList = res.data.records.map(v => {
|
|
|
+ return {
|
|
|
+ label: v.companyName,
|
|
|
+ value: v.companyCaAuthId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getTemplateList() {
|
|
|
+ getTemplateList({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: -1
|
|
|
+ }).then(res => {
|
|
|
+ this.mainContractList = res.data.records.map(v => {
|
|
|
+ return {
|
|
|
+ label: v.contractTemplateName,
|
|
|
+ value: v.contractTemplateId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getProviderList() {
|
|
|
+ getProviderList({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: -1
|
|
|
+ }).then(res => {
|
|
|
+ this.serviceProviderList = res.data.records.map(v => {
|
|
|
+ return {
|
|
|
+ label: v.websitName,
|
|
|
+ value: v.websitId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getTemplateFollowType() {
|
|
|
+ getTemplateFollowType().then(res => {
|
|
|
+ for (const key in res.data) {
|
|
|
+ if (Object.hasOwnProperty.call(res.data, key)) {
|
|
|
+ const element = res.data[key]
|
|
|
+ this.filetype.push({
|
|
|
+ label: element,
|
|
|
+ value: key
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ onReset() {
|
|
|
+ this.fileList.splice(0, 1)
|
|
|
+ this.fileList2.splice(0, 1)
|
|
|
+ this.$refs.formRef.resetFields()
|
|
|
+ },
|
|
|
+ handlerefreshList() {
|
|
|
+ this.$emit('refresh')
|
|
|
+ this.$emit('handleClose')
|
|
|
+ },
|
|
|
+ onClose() {
|
|
|
+ this.$emit('handleClose')
|
|
|
+ },
|
|
|
+ onSubmit() {
|
|
|
+ this.$refs.formRef.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ const params = {
|
|
|
+ ...this.formData,
|
|
|
+ websitName: this.authList.find(k => k.value == this.formData.websitId).label
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.edit) {
|
|
|
+ params.contractTemplateId = ''
|
|
|
+ addTemplateItem(params).then(res => {
|
|
|
+ this.$successMsg('新增成功')
|
|
|
+ this.handlerefreshList()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ updateTemplateItem(params).then(res => {
|
|
|
+ this.$successMsg('编辑成功')
|
|
|
+ this.handlerefreshList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.header1style {
|
|
|
+ text-align: right;
|
|
|
+ font-size: 12px;
|
|
|
+ color: red;
|
|
|
+ line-height: 18px;
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|