From 6f1e182cf223a600141ca2054dadd7ec6c4fc40f Mon Sep 17 00:00:00 2001 From: 陈翱 <1121324153@qq.com> Date: Fri, 19 Aug 2022 11:13:08 +0800 Subject: [PATCH] 优化了信息订阅界面布局 --- src/views/system/modules/newsOrderPart.vue | 282 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------- 1 file changed, 148 insertions(+), 134 deletions(-) diff --git a/src/views/system/modules/newsOrderPart.vue b/src/views/system/modules/newsOrderPart.vue index f093e6d..7d476db 100644 --- a/src/views/system/modules/newsOrderPart.vue +++ b/src/views/system/modules/newsOrderPart.vue @@ -10,93 +10,108 @@ <a-button @click="handleCancel">关闭</a-button> </template> <a-spin :spinning="confirmLoading"> - <a-form :form="form" > + <a-form :form="form"> <a-row> - <a-col :span="24"> + <a-col :span="24/3"> <a-form-item label="工作令" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-input v-decorator="['workNo']" disabled></a-input> + <a-input v-decorator="['workNo']" disabled></a-input> </a-form-item> </a-col> - <a-col :span="24"> + <a-col :span="24/3"> <a-form-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-input v-decorator="['cno']" placeholder="请输入物料编码" disabled></a-input> + <a-input v-decorator="['cno']" placeholder="请输入物料编码" disabled></a-input> </a-form-item> </a-col> + </a-row> - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="采购" - hasFeedback> - <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose" v-model="visibleCheck" /> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="到货" - hasFeedback> - <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose2" v-model="visibleCheck2" /> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="入库" - hasFeedback> - <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose3" v-model="visibleCheck3" /> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="领料" - hasFeedback> - <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose4" v-model="visibleCheck4" /> - </a-form-item> - - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="制作" - hasFeedback> - <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose5" v-model="visibleCheck5" /> - </a-form-item> + <a-row> + <a-col :span="24/3"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="采购" + hasFeedback> + <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose" v-model="visibleCheck"/> + </a-form-item> + </a-col> - <a-form-item - :labelCol="labelCol" - :wrapperCol="wrapperCol" - label="工艺" - hasFeedback> - <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose6" v-model="visibleCheck6" /> - </a-form-item> + <a-col :span="24/3"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="到货" + hasFeedback> + <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose2" v-model="visibleCheck2"/> + </a-form-item> + </a-col> + <a-col :span="24/3"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="入库" + hasFeedback> + <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose3" v-model="visibleCheck3"/> + </a-form-item> + </a-col> + </a-row> + <a-row> + <a-col :span="24/3"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="领料" + hasFeedback> + <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose4" v-model="visibleCheck4"/> + </a-form-item> + </a-col> + <a-col :span="24/3"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="制作" + hasFeedback> + <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose5" v-model="visibleCheck5"/> + </a-form-item> + </a-col> + <a-col :span="24/3"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="工艺" + hasFeedback> + <a-switch checkedChildren="订阅" unCheckedChildren="不订阅" @change="onChose6" v-model="visibleCheck6"/> + </a-form-item> + </a-col> + </a-row> + <a-row> - <a-col :span="24" style="text-align: center" class="table-page-search-submitButtons"> + <a-col :span="24" style="text-align: center" class="table-page-search-submitButtons"> <a-button type="primary" @click="submitForm" icon="check-circle">提 交</a-button> </a-col> </a-row> - </a-form> + </a-form> </a-spin> </a-modal> </template> <script> -import { httpAction} from '@/api/manage' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import {httpAction} from '@/api/manage' +import {JeecgListMixin} from '@/mixins/JeecgListMixin' import pick from 'lodash.pick' + export default { name: 'PbomTypeForm', - mixins:[JeecgListMixin], - components: { - }, + mixins: [JeecgListMixin], + components: {}, props: { //流程表单data formData: { type: Object, - default: ()=>{}, + default: () => { + }, required: false }, //表单模式:true流程表单 false普通表单 @@ -112,54 +127,53 @@ export default { required: false } }, - data () { + data() { return { visible: false, modalWidth: '50%', - modalStyle: { 'top': '20px'}, + modalStyle: {'top': '20px'}, form: this.$form.createForm(this), - excludeFlag:"", + excludeFlag: "", visibleCheck: false, - excludeFlag2:"", + excludeFlag2: "", visibleCheck2: false, - excludeFlag3:"", + excludeFlag3: "", visibleCheck3: false, - excludeFlag4:"", + excludeFlag4: "", visibleCheck4: false, - excludeFlag5:"", + excludeFlag5: "", visibleCheck5: false, - excludeFlag6:"", + excludeFlag6: "", visibleCheck6: false, model: {}, - no:'', - flag:false, - flag2:false, + no: '', + flag: false, + flag2: false, labelCol: { - xs: { span: 24 }, - sm: { span: 5 }, + xs: {span: 24}, + sm: {span: 5}, }, wrapperCol: { - xs: { span: 24 }, - sm: { span: 16 }, + xs: {span: 24}, + sm: {span: 16}, }, confirmLoading: false, - validatorRules: { - }, - searchOptions:[{ - text:"外协", - value:"外协" - },{ - text:"自制", - value:"自制" - },{ - text:"外购", - value:"外购" - },{ - text:"工序外协", - value:"工序外协" + validatorRules: {}, + searchOptions: [{ + text: "外协", + value: "外协" + }, { + text: "自制", + value: "自制" + }, { + text: "外购", + value: "外购" + }, { + text: "工序外协", + value: "工序外协" }], url: { - list:"1", + list: "1", add: "/news/userNewsOrder/add", edit: "/pbom_type/pbomType/edit", queryById: "/pbom_type/pbomType/queryById" @@ -167,18 +181,18 @@ export default { } }, computed: { - formDisabled(){ - if(this.formBpm===true){ - if(this.formData.disabled===false){ + formDisabled() { + if (this.formBpm === true) { + if (this.formData.disabled === false) { return false } return true } return this.disabled }, - showFlowSubmitButton(){ - if(this.formBpm===true){ - if(this.formData.disabled===false){ + showFlowSubmitButton() { + if (this.formBpm === true) { + if (this.formData.disabled === false) { return true } } @@ -186,58 +200,58 @@ export default { }, }, - created () { + created() { //如果是流程中表单,则需要加载流程表单data this.showFlowData(); }, methods: { - add () { + add() { this.edit({}); }, - edit (record,workNo) { - this.visible=true; + edit(record, workNo) { + this.visible = true; this.form.resetFields(); - this.no=record.cno; + this.no = record.cno; this.model = Object.assign({}, record); this.visible = true; this.$nextTick(() => { - this.form.setFieldsValue(pick(this.model,'cno','uuid','f04','code')) + this.form.setFieldsValue(pick(this.model, 'cno', 'uuid', 'f04', 'code')) this.form.setFieldsValue({ - workNo:workNo + workNo: workNo }) }) - if(record.purchase=='1'){ - this.visibleCheck=true - }else { - this.visibleCheck=false + if (record.purchase == '1') { + this.visibleCheck = true + } else { + this.visibleCheck = false } - if(record.arrival=='1'){ - this.visibleCheck2=true - }else { - this.visibleCheck2=false + if (record.arrival == '1') { + this.visibleCheck2 = true + } else { + this.visibleCheck2 = false } - if(record.warehousing=='1'){ - this.visibleCheck3=true - }else { - this.visibleCheck3=false + if (record.warehousing == '1') { + this.visibleCheck3 = true + } else { + this.visibleCheck3 = false } - if(record.picking=='1'){ - this.visibleCheck4=true - }else { - this.visibleCheck4=false + if (record.picking == '1') { + this.visibleCheck4 = true + } else { + this.visibleCheck4 = false } - if(record.make=='1'){ - this.visibleCheck5=true - }else { - this.visibleCheck5=false + if (record.make == '1') { + this.visibleCheck5 = true + } else { + this.visibleCheck5 = false } - if(record.craft=='1'){ - this.visibleCheck6=true - }else { - this.visibleCheck6=false + if (record.craft == '1') { + this.visibleCheck6 = true + } else { + this.visibleCheck6 = false } }, - handleCancel(){ + handleCancel() { this.visible = false }, @@ -301,7 +315,7 @@ export default { } }, - submitForm () { + submitForm() { const that = this; // 触发表单验证 this.form.validateFields((err, values) => { @@ -309,7 +323,7 @@ export default { that.confirmLoading = true; let httpurl = ''; let method = ''; - httpurl+=this.url.add; + httpurl += this.url.add; method = 'post'; let formData = Object.assign(this.model, values); formData.no = this.no @@ -319,14 +333,14 @@ export default { formData.picking = this.excludeFlag4 formData.make = this.excludeFlag5 formData.craft = this.excludeFlag6 - httpAction(httpurl,formData,method).then((res)=>{ - if(res.success){ + httpAction(httpurl, formData, method).then((res) => { + if (res.success) { that.$message.success(res.message); this.visible = false that.$emit('ok'); that.$emit('fatherMethod', ''); - }else{ + } else { that.$message.warning(res.message); } }).finally(() => { @@ -336,8 +350,8 @@ export default { }) }, - popupCallback(row){ - this.form.setFieldsValue(pick(row,'cno','uuid','f04','code')) + popupCallback(row) { + this.form.setFieldsValue(pick(row, 'cno', 'uuid', 'f04', 'code')) }, } } -- libgit2 0.22.2