From 1086953400ff7d23bf3b2b75c5960bca2dc184a7 Mon Sep 17 00:00:00 2001 From: zhuzhuanzhuan Date: 星期四, 09 十一月 2023 15:22:18 +0800 Subject: [PATCH] 1、优化首页布局 2、班次班制管理页面表格数据新增增加表单项验证 3、班次班制管理页面新增班次时如果并未选择开始与结束休息时间,应默认为空,而不是当前时间 4、班次班制管理页面新增或修改班次时如果选择跨天,则时间请求参数会混乱,应与不跨天时保持一致 --- src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerList.vue | 2 src/views/mdc/base/modules/shift/ShiftInfoModel.vue | 125 ++++++++++++++++-------------- src/views/dashboard/Analysis.vue | 57 ++++++++------ src/views/system/modules/WorkshopModal.vue | 3 4 files changed, 101 insertions(+), 86 deletions(-) diff --git a/src/views/dashboard/Analysis.vue b/src/views/dashboard/Analysis.vue index 505d8a7..edb65db 100644 --- a/src/views/dashboard/Analysis.vue +++ b/src/views/dashboard/Analysis.vue @@ -1,6 +1,6 @@ <template> - <div> - <index-chart v-if="indexStyle==1"></index-chart> + <div class="page-container" style="width: 100%"> + <!--<index-chart v-if="indexStyle==1"></index-chart>--> <!--<index-bdc v-if="indexStyle==2"></index-bdc>--> <!--<index-task v-if="indexStyle==3"></index-task>--> <!--<div style="width: 100%;text-align: right;margin-top: 20px">--> @@ -11,9 +11,14 @@ <!--<!–<a-radio :value="3">浠诲姟琛ㄦ牸</a-radio>–>--> <!--<!–</a-radio-group>–>--> <!--</div>--> - <a-button type="primary" size="large" v-for="item in workshopList" :key="item.workshopId" - @click="navigateToWorkshopSignage(item.id)">{{item.workshopName}} - </a-button> + <!--<a-button type="primary" size="large" v-for="item in workshopList" :key="item.workshopId"--> + <!--@click="navigateToWorkshopSignage(item.id)">{{item.workshopName}}--> + <!--</a-button>--> + + <a-card v-for="item in workshopList" :key="item.workshopId" + @click="navigateToWorkshopSignage(item.id)" class="workshop-entrance"> + {{item.workshopName}} + </a-card> </div> </template> @@ -33,24 +38,7 @@ data() { return { indexStyle: 1, - workshopList: [ - { - workshopName: '闀挎矙杞﹂棿', - id: '5321' - }, - { - workshopName: '澶╂触杞﹂棿', - id: '6312' - }, - { - workshopName: '姝︽眽杞﹂棿', - id: '3463' - }, - { - workshopName: '鍖椾含杞﹂棿', - id: '8421' - } - ] + workshopList: [] } }, created() { @@ -78,4 +66,25 @@ } } } -</script> \ No newline at end of file +</script> + +<style lang="less" scoped> + .page-container { + width: 100%; + display: flex; + flex-wrap: wrap; + + .workshop-entrance { + font-size: 30px; + background-color: #fff; + width: 300px; + height: 140px; + display: flex; + justify-content: center; + align-items: center; + margin: 30px 38px; + cursor: pointer; + border-radius: 20px; + } + } +</style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerList.vue b/src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerList.vue index ed8b56e..8a41d3a 100644 --- a/src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerList.vue +++ b/src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerList.vue @@ -572,7 +572,7 @@ //閲嶆柊璁$畻鍒嗛〉闂 that.reCalculatePage(that.selectedRowKeys.length) // that.$message.success(res.message); - that.$notification.warning({ + that.$notification.success({ message:'娑堟伅', description:res.message }); diff --git a/src/views/mdc/base/modules/shift/ShiftInfoModel.vue b/src/views/mdc/base/modules/shift/ShiftInfoModel.vue index 1ed89ef..f91c642 100644 --- a/src/views/mdc/base/modules/shift/ShiftInfoModel.vue +++ b/src/views/mdc/base/modules/shift/ShiftInfoModel.vue @@ -1,6 +1,6 @@ <template> <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" - @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> + @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> <a-spin :spinning="confirmLoading"> <a-form :form="form"> <a-row :gutter="24"> @@ -12,7 +12,7 @@ </a-col> <a-col :span="12"> <a-form-item label="鐝鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-input allow-clear placeholder="璇疯緭鍏ョ彮鍒跺悕绉�" v-decorator="['shiftSubName',validatorRules.shiftSubName]"/> + <a-input allow-clear placeholder="璇疯緭鍏ョ彮娆″悕绉�" v-decorator="['shiftSubName',validatorRules.shiftSubName]"/> </a-form-item> </a-col> </a-row> @@ -72,7 +72,6 @@ JeecgListMixin } from '@/mixins/JeecgListMixin' - export default { name: 'ShiftInfoModel', mixins: [JeecgListMixin], @@ -105,20 +104,35 @@ confirmLoading: false, form: this.$form.createForm(this), validatorRules: { - shiftSubName:[ - { - required:true, - message:'璇疯緭鍏ュ瓧娈甸暱搴�', - },{ - validator:this.checkshiftSuName, - trigger:'blur' - } - ] + shiftSubName: { + rules: [ + { + required: true, + message: '璇疯緭鍏ョ彮娆″悕绉�' + } + ] + }, + startDate: { + rules: [ + { + required: true, + message: '璇烽�夋嫨寮�濮嬫椂闂�' + } + ] + }, + endDate: { + rules: [ + { + required: true, + message: '璇烽�夋嫨缁撴潫鏃堕棿' + } + ] + } }, url: { add: '/mdc/mdcShiftSub/addShiftSub', edit: '/mdc/mdcShiftSub/editMdcShiftSub', - list: '/mdc/mdcMdcShift/queryPageList', + list: '/mdc/mdcMdcShift/queryPageList' }, disableSubmit: true } @@ -129,27 +143,27 @@ methods: { //鑷畾涔夋牎楠屽嚱鏁帮紝瑕佹眰鍚嶅瓧涓嶈兘閲嶅 value鏄〃鍗曠殑鍊硷紝callback鏄洖璋冨嚱鏁� 蹇呴』璋冪敤鎵嶅彲楠岃瘉 - checkshiftSuName(rule,value,callback){ - if(!value){ - alert("涓嶈兘涓虹┖锛�") + checkshiftSuName(rule, value, callback) { + if (!value) { + alert('涓嶈兘涓虹┖锛�') return } // debugger // let NameSelf = value; - this.loadData() + this.loadData() // console.log(dataSource); - callback(); + callback() }, loadData() { - if(!this.url.list){ - this.$message.error("璇疯缃畊rl.list灞炴��!") + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') return } //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 // if (arg === 1) { // this.ipagination.current = 1; // } - var params = this.getQueryParams();//鏌ヨ鏉′欢 + var params = this.getQueryParams()//鏌ヨ鏉′欢 // // if(!params){ // return false; @@ -160,7 +174,7 @@ if (res.success) { // console.log(res) //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ - this.dataSource = res.result.records||res.result; + this.dataSource = res.result.records || res.result // if(res.result.total) // { // this.ipagination.total = res.result.total; @@ -168,12 +182,12 @@ // this.ipagination.total = 0; // } //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ - }else{ + } else { // this.$message.warning(res.message) this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { this.loading = false @@ -230,28 +244,23 @@ that.confirmLoading = true let formData = Object.assign(this.model, values) formData.isDaySpan = that.isDaySpan - console.log(formData.isDaySpan); - if(formData.isDaySpan == false){ - formData.startDate = moment(formData.startDate).format('HH:mm:ss'); - formData.endDate = moment(formData.endDate).format('HH:mm:ss'); - formData.sleepStartDate = moment(formData.sleepStartDate).format('HH:mm:ss'); - formData.sleepEndDate = moment(formData.sleepEndDate).format('HH:mm:ss'); - let startTimeOne = formData.startDate.replace(/:/g,''); - let endTimeOne = formData.endDate.replace(/:/g,''); - if(startTimeOne > endTimeOne){ + console.log(formData.isDaySpan) + formData.startDate = moment(formData.startDate).format('HH:mm:ss') + formData.endDate = moment(formData.endDate).format('HH:mm:ss') + if (formData.sleepStartDate) formData.sleepStartDate = moment(formData.sleepStartDate).format('HH:mm:ss') + if (formData.sleepEndDate) formData.sleepEndDate = moment(formData.sleepEndDate).format('HH:mm:ss') + if (formData.isDaySpan == false) { + let startTimeOne = formData.startDate.replace(/:/g, '') + let endTimeOne = formData.endDate.replace(/:/g, '') + if (startTimeOne > endTimeOne) { // that.$message.warning("闈炶法澶╃彮娆$粨鏉熸椂闂翠笉鑳藉皬浜庣瓑浜庡紑濮嬫椂闂达紒") that.$notification.warning({ - message:'娑堟伅', - description:"闈炶法澶╃彮娆$粨鏉熸椂闂翠笉鑳藉皬浜庣瓑浜庡紑濮嬫椂闂达紒" - }); - // that.$message.success("淇濆瓨澶辫触") - that.$notification.error({ - message:'娑堟伅', - description:"淇濆瓨澶辫触锛�" - }); + message: '娑堟伅', + description: '闈炶法澶╃彮娆$粨鏉熸椂闂翠笉鑳藉皬浜庣瓑浜庡紑濮嬫椂闂达紒' + }) that.confirmLoading = false that.close() - }else{ + } else { formData.shiftSubStatus = 1 let obj if (!this.model.id) { @@ -265,23 +274,23 @@ if (res.success) { // that.$message.success("淇濆瓨鎴愬姛") that.$notification.success({ - message:'娑堟伅', - description:"淇濆瓨鎴愬姛" - }); + message: '娑堟伅', + description: '淇濆瓨鎴愬姛' + }) that.$emit('ok', res.result) } else { // that.$message.warning(res.message) that.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { that.confirmLoading = false that.close() }) } - }else{ + } else { formData.shiftSubStatus = 1 let obj if (!this.model.id) { @@ -295,16 +304,16 @@ if (res.success) { // that.$message.success that.$notification.success({ - message:'娑堟伅', - description:"淇濆瓨鎴愬姛" - }); + message: '娑堟伅', + description: '淇濆瓨鎴愬姛' + }) that.$emit('ok', res.result) } else { // that.$message.warning(res.message) that.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { that.confirmLoading = false @@ -388,4 +397,4 @@ .ant-tabs-content .ant-form-item { margin-bottom: 0px; } -</style> +</style> \ No newline at end of file diff --git a/src/views/system/modules/WorkshopModal.vue b/src/views/system/modules/WorkshopModal.vue index 5c74232..364a8fa 100644 --- a/src/views/system/modules/WorkshopModal.vue +++ b/src/views/system/modules/WorkshopModal.vue @@ -12,9 +12,6 @@ <a-spin :spinning="confirmLoading"> <a-form-model ref="form" v-bind="layout" :model="model" :rules="validatorRules"> - <a-form-model-item label="杞﹂棿缂栧彿" required prop="id"> - <a-input v-model="model.id" :disabled="isEdit" placeholder="璇疯緭鍏ヨ溅闂寸紪鍙�"/> - </a-form-model-item> <a-form-model-item label="杞﹂棿鍚嶇О" required prop="workshopName"> <a-input v-model="model.workshopName" placeholder="璇疯緭鍏ヨ溅闂村悕绉�"/> </a-form-model-item> -- Gitblit v1.9.3