From d7862b2890b68743ec9c4fc05800bb23ec9b412e Mon Sep 17 00:00:00 2001 From: zhuguifei <zhuguifei@zhuguifeideiMac.local> Date: 星期日, 27 四月 2025 16:05:02 +0800 Subject: [PATCH] 完成新增报修单 --- eims-ui-mobile/src/service/repair.ts | 42 + eims-ui-mobile/src/service/dict.d.ts | 17 eims-ui-mobile/src/service/fixture.ts | 9 eims-ui-mobile/src/static/ico/ico-faxian.png | 0 eims-ui-mobile/src/static/ico/ico-setting.png | 0 eims-ui-mobile/src/pages/inspect/insp-st.vue | 6 eims-ui-mobile/src/pages/maint/maint-order.vue | 2 eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java | 3 eims-ui-mobile/src/utils/http.ts | 8 eims-ui-mobile/src/service/.DS_Store | 0 eims-ui-mobile/src/service/utils.ts | 9 eims-ui-mobile/src/pages/inspect/insp-record.vue | 2 eims-ui-mobile/src/types/uni-pages.d.ts | 4 eims-ui-mobile/src/style/index.scss | 6 eims-ui-mobile/src/static/ico/ico-huiyi.png | 0 eims-ui-mobile/src/pages/fixture/fixture-list.vue | 185 ++++++ eims-ui-mobile/src/service/repair.d.ts | 159 +++++ eims-ui-mobile/src/pages/repair/res-list.vue | 278 +++++++++ eims-ui-mobile/src/service/dict.ts | 13 eims-ui-mobile/src/pages/repair/repair-add.vue | 408 ++++++++++++++ eims-ui/apps/web-antd/src/views/eims/repair-req/data.tsx | 9 eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairReqBo.java | 8 eims-ui-mobile/src/pages/maint/maint-st.vue | 5 eims-ui-mobile/src/pages.json | 83 ++ eims-ui-mobile/src/pages/equ/equ-list.vue | 28 eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairResBo.java | 1 eims-ui-mobile/src/service/fixture.d.ts | 95 +++ eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsRepairResVo.java | 5 eims-ui-mobile/src/pages/home/index.vue | 27 eims-ui-mobile/src/pages/repair/req-list.vue | 316 ++++++++++ 30 files changed, 1,692 insertions(+), 36 deletions(-) diff --git a/eims-ui-mobile/src/pages.json b/eims-ui-mobile/src/pages.json index adfbb8a..f174d9d 100644 --- a/eims-ui-mobile/src/pages.json +++ b/eims-ui-mobile/src/pages.json @@ -82,6 +82,15 @@ } }, { + "path": "pages/fixture/fixture-list", + "type": "page", + "layout": "default", + "needLogin": true, + "style": { + "navigationBarTitleText": "宸ュ叿鍒楄〃" + } + }, + { "path": "pages/inspect/insp-add", "type": "page", "layout": "default", @@ -200,6 +209,80 @@ } }, { + "path": "pages/repair/repair-add", + "type": "page", + "layout": "default", + "style": { + "navigationBarTitleText": "娣诲姞鎶ヤ慨", + "app-plus": { + "titleNView": { + "buttons": [ + { + "text": "鎻愪氦", + "fontSize": "14px", + "color": "#FFFFFF" + }, + { + "text": "", + "fontSize": "24px", + "color": "#FFFFFF" + } + ] + } + } + } + }, + { + "path": "pages/repair/req-list", + "type": "page", + "layout": "default", + "needLogin": true, + "style": { + "navigationBarTitleText": "璁惧鎶ヤ慨", + "app-plus": { + "titleNView": { + "buttons": [ + { + "text": "鏂板", + "fontSize": "14px", + "color": "#FFFFFF" + }, + { + "text": "", + "fontSize": "24px", + "color": "#FFFFFF" + } + ] + } + } + } + }, + { + "path": "pages/repair/res-list", + "type": "page", + "layout": "default", + "needLogin": true, + "style": { + "navigationBarTitleText": "璁惧缁翠慨", + "app-plus": { + "titleNView": { + "buttons": [ + { + "text": "鎺ュ崟", + "fontSize": "14px", + "color": "#FFFFFF" + }, + { + "text": "", + "fontSize": "24px", + "color": "#FFFFFF" + } + ] + } + } + } + }, + { "path": "pages/spare/index", "type": "page", "layout": "tabbar", diff --git a/eims-ui-mobile/src/pages/equ/equ-list.vue b/eims-ui-mobile/src/pages/equ/equ-list.vue index 0e6ff84..693e6c2 100644 --- a/eims-ui-mobile/src/pages/equ/equ-list.vue +++ b/eims-ui-mobile/src/pages/equ/equ-list.vue @@ -31,9 +31,9 @@ </view> </view> </template> - <view class="flex h-[80rpx]" @click.stop="itemClick(item)"> + <view class="flex h-[80rpx] items-center" @click.stop="itemClick(item)"> <image class="slot-img text-center" src="/static/images/camera.png" /> - <view> + <view class="flex-1"> <view class="text-color-base"> {{ item.equName }} <text class="text-color-gray ml-2 text-mini">{{ item.modelNo }}</text> @@ -41,6 +41,15 @@ <view class="text-color-gray text-xs mt-1"> {{ item.location }} | {{ item.madeIn }} </view> + </view> + <view v-if="isSelectEqu"> + <wd-button + size="small" + icon="edit-outline" + @click.stop="handleSelectEqu(item)" + > + 閫変腑 + </wd-button> </view> </view> </wd-card> @@ -78,8 +87,7 @@ getEquList({ pageNum, pageSize }) .then((res: any) => { // 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡 - console.log(res) - paging.value.complete(res.rows) + paging.value.completeByTotal(res.rows, res.total) }) .catch((res) => { // 濡傛灉璇锋眰澶辫触鍐檖aging.value.complete(false)锛屼細鑷姩灞曠ず閿欒椤甸潰 @@ -94,6 +102,14 @@ * @param item */ function itemClick(item: any) { + +} + +/** + * 鍏跺畠椤甸潰閫夋嫨璁惧 + * @param item + */ +function handleSelectEqu(item: any) { if (isSelectEqu.value) { emitSelectEqu(item) uni.navigateBack() @@ -116,9 +132,9 @@ const instance: any = getCurrentInstance().proxy const event = instance.getOpenerEventChannel() eventChannel.value = event - event.on('handleSelectEqu', function (data) { + event.on('OnSelectEqu', function (data) { isSelectEqu.value = true - console.log('handleSelectEqu', data) + console.log('OnSelectEqu', data) }) }) </script> diff --git a/eims-ui-mobile/src/pages/fixture/fixture-list.vue b/eims-ui-mobile/src/pages/fixture/fixture-list.vue new file mode 100644 index 0000000..e245676 --- /dev/null +++ b/eims-ui-mobile/src/pages/fixture/fixture-list.vue @@ -0,0 +1,185 @@ +<route lang="json5" type="page"> +{ + layout: 'default', + needLogin: true, + style: { + navigationBarTitleText: '宸ュ叿鍒楄〃', + }, +} +</route> +<template> + <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time> + <template #top> + <wd-drop-menu> + <wd-drop-menu-item v-model="fixtureType" :options="typeList" @change="handleFixtureType" /> + <wd-drop-menu-item v-model="status" :options="statusList" @change="handleFixtureStatu" /> + </wd-drop-menu> + </template> + + <view class="bg-base"> + <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id"> + <template #title> + <view class="flex justify-between items-center"> + <view class="flex items-center menu-title-box"> + <view class="menu-indicator"></view> + <text class="ml-1 text-xs">{{ item.fixtureName }}</text> + <text class="ml-1 text-mini text-color-gray">{{ item.assetNo }}</text> + </view> + + <view> + <text class="icon-color-base">璇︽儏</text> + <wd-icon name="arrow-right" custom-class="icon-color-base"></wd-icon> + </view> + </view> + </template> + <view class="flex h-[80rpx] items-center" @click.stop="itemClick(item)"> + <image class="slot-img text-center" src="/static/images/camera.png" /> + <view class="flex-1"> + <view class="text-color-base"> + <text class="text-color-gray text-mini">绫诲瀷: {{ item.fixtureTypeName }}</text> + <text class="text-color-gray ml-2 text-mini">瑙勬牸: {{ item.specNo }}</text> + <text class="text-color-gray ml-2 text-mini">鍨嬪彿: {{ item.modelNo }}</text> + </view> + <view class="text-color-gray text-xs mt-1 flex"> + <template + v-if="!item.borrowStatus || item.borrowStatus === '0'" + > + <view class="flex items-center"> + <wd-icon class="icon-color-success" name="check-outline" size="28rpx"></wd-icon> + <text class="ml-[2px]">绌洪棽</text> + </view> + </template> + + <template + v-if="item.borrowStatus === '1'" + > + <view class="flex items-center"> + <wd-icon class="text-color-primary" name="check-outline" size="28rpx"></wd-icon> + <text class="ml-[2px]">鍊熷嚭</text> + </view> + </template> + <text v-if="item.borrowUserName" class="mx-2">|</text> + <view class="flex items-center"> + <wd-icon name="setting" size="26rpx"></wd-icon> + <text class="ml-[2px]">{{ item.borrowUserName }}</text> + </view> + </view> + </view> + <view v-if="isSelectFixture"> + <wd-button size="small" icon="edit-outline" @click.stop="handleSelectFixture(item)"> + 閫変腑 + </wd-button> + </view> + </view> + </wd-card> + </view> + </z-paging> +</template> + +<script setup lang="ts"> +import { onMounted, getCurrentInstance, ref } from 'vue' + +import { getFixtureList } from '@/service/fixture' + +// 宸ュ叿绫诲瀷 +const fixtureType = ref<number>(0) +// 宸ュ叿鐘舵�� +const status = ref<number>(0) + +const isSelectFixture = ref(false) + +const typeList = ref<Record<string, any>[]>([{ label: '鎵�鏈夊伐鍏�', value: 0 }]) +const statusList = ref<Record<string, any>[]>([{ label: '鎵�鏈夌姸鎬�', value: 0 }]) +function handleFixtureType({ value }) { + console.log(value) +} +function handleFixtureStatu({ value }) { + console.log(value) +} + +const paging = ref(null) +const dataList = ref([]) + +const queryList = (pageNum?: number, pageSize?: number) => { + // 杩欓噷鐨刾ageNo鍜宲ageSize浼氳嚜鍔ㄨ绠楀ソ锛岀洿鎺ヤ紶缁欐湇鍔″櫒鍗冲彲 + // 杩欓噷鐨勮姹傚彧鏄紨绀猴紝璇锋浛鎹㈡垚鑷繁鐨勯」鐩殑缃戠粶璇锋眰锛屽苟鍦ㄧ綉缁滆姹傚洖璋冧腑閫氳繃paging.value.complete(璇锋眰鍥炴潵鐨勬暟缁�)灏嗚姹傜粨鏋滀紶缁檢-paging + getFixtureList({ pageNum, pageSize }) + .then((res: any) => { + // 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡 + paging.value.completeByTotal(res.rows, res.total) + }) + .catch((res) => { + // 濡傛灉璇锋眰澶辫触鍐檖aging.value.complete(false)锛屼細鑷姩灞曠ず閿欒椤甸潰 + // 娉ㄦ剰锛屾瘡娆¢兘闇�瑕佸湪catch涓啓杩欏彞璇濆緢楹荤儲锛寊-paging鎻愪緵浜嗘柟妗堝彲浠ュ叏灞�缁熶竴澶勭悊 + // 鍦ㄥ簳灞傜殑缃戠粶璇锋眰鎶涘嚭寮傚父鏃讹紝鍐檜ni.$emit('z-paging-error-emit');鍗冲彲 + paging.value.complete(false) + }) +} + +/** + * 宸ュ叿鏉$洰鐐瑰嚮浜嬩欢 + * @param item + */ +function itemClick(item: any) {} + +/** + * 鍏跺畠椤甸潰閫夋嫨宸ュ叿 + * @param item + */ +function handleSelectFixture(item: any) { + if (isSelectFixture.value) { + emitSelectFixture(item) + uni.navigateBack() + } +} + +/** + * 閫夋嫨宸ュ叿鍥炶皟 + * @param equ + */ +function emitSelectFixture(fixture: any) { + eventChannel.value.emit('selectFixture', { + data: fixture, + }) +} + +const eventChannel = ref<any>() +onMounted(() => { + const instance: any = getCurrentInstance().proxy + const event = instance.getOpenerEventChannel() + eventChannel.value = event + event.on('OnSelectFixture', function (data) { + isSelectFixture.value = true + console.log('OnSelectFixture', data) + }) +}) +</script> + +<style scoped lang="scss"> +.menu-title-box { + height: 30rpx; + line-height: 30rpx; +} + +.slot-img { + width: 72rpx; + height: 72rpx; + margin-right: 24rpx; +} +.text-mini { + font-size: 22rpx; +} + +.menu-indicator { + width: 6rpx; + height: 22rpx; + border-radius: 10rpx; + background-color: $uni-color-primary; +} +:deep(.wd-card__footer) { + padding: 10rpx !important; +} +:deep(.wd-card__title-content) { + padding: 20rpx 0 !important; +} +</style> diff --git a/eims-ui-mobile/src/pages/home/index.vue b/eims-ui-mobile/src/pages/home/index.vue index 3351c06..0d22564 100644 --- a/eims-ui-mobile/src/pages/home/index.vue +++ b/eims-ui-mobile/src/pages/home/index.vue @@ -145,7 +145,13 @@ name: '璁惧绠$悊', icon: '/static/menu/menu1.png', path: 'pages/equ/equ-list', - } + }, + { + id: 2, + name: '宸ュ叿绠$悊', + icon: '/static/menu/menu1.png', + path: 'pages/fixture/fixture-list', + }, ]) const inspectMenu = reactive([ @@ -158,26 +164,26 @@ { id: 1, name: '鐐规姹囨��', - icon: '/static/menu/menu2.png', + icon: '/static/menu/menu4.png', path: 'pages/inspect/insp-st', }, { id: 2, name: '淇濆吇姹囨��', - icon: '/static/menu/menu1.png', + icon: '/static/menu/menu3.png', path: 'pages/maint/maint-st', }, { id: 3, - name: '鐐规璁板綍', - icon: '/static/menu/menu3.png', - path: 'pages/inspect/insp-record', + name: '璁惧鎶ヤ慨', + icon: '/static/menu/menu1.png', + path: 'pages/repair/req-list', }, { id: 4, - name: '鐐规璁″垝', - icon: '/static/menu/menu4.png', - path: 'pages/inspect/insp-add', + name: '璁惧缁翠慨', + icon: '/static/menu/menu2.png', + path: 'pages/repair/res-list', }, ]) @@ -223,4 +229,7 @@ height: 72rpx; margin-left: 4rpx; } +:deep(.wd-grid-item__content){ + align-items: center; +} </style> diff --git a/eims-ui-mobile/src/pages/inspect/insp-record.vue b/eims-ui-mobile/src/pages/inspect/insp-record.vue index cf97685..7b64703 100644 --- a/eims-ui-mobile/src/pages/inspect/insp-record.vue +++ b/eims-ui-mobile/src/pages/inspect/insp-record.vue @@ -200,7 +200,7 @@ getInspStRecordList(params) .then((res: any) => { // 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡 - paging.value.complete(res.rows) + paging.value.completeByTotal(res.rows, res.total) }) .catch((res) => { // 濡傛灉璇锋眰澶辫触鍐檖aging.value.complete(false)锛屼細鑷姩灞曠ず閿欒椤甸潰 diff --git a/eims-ui-mobile/src/pages/inspect/insp-st.vue b/eims-ui-mobile/src/pages/inspect/insp-st.vue index f53f836..44d5ef2 100644 --- a/eims-ui-mobile/src/pages/inspect/insp-st.vue +++ b/eims-ui-mobile/src/pages/inspect/insp-st.vue @@ -15,10 +15,8 @@ <wd-drop-menu-item v-model="viewMode" :options="viewModeList" @change="handleViewMode" /> <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" /> </wd-drop-menu> - <wd-divider></wd-divider> </template> <view class="bg-base"> - <view class="w-full h-[24rpx]"></view> <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id"> <template #title> <view class="flex justify-between"> @@ -103,7 +101,7 @@ getInspStList({ pageNum, pageSize, viewMode: viewMode.value }) .then((res: any) => { // 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡 - paging.value.complete(res.rows) + paging.value.completeByTotal(res.rows, res.total) }) .catch((res) => { // 濡傛灉璇锋眰澶辫触鍐檖aging.value.complete(false)锛屼細鑷姩灞曠ず閿欒椤甸潰 @@ -127,7 +125,7 @@ uni.$on('insp-st-refresh', reloadData) }) onUnload(() => { - uni.$off('insp-st-refres', reloadData) + uni.$off('insp-st-refresh', reloadData) }) </script> diff --git a/eims-ui-mobile/src/pages/maint/maint-order.vue b/eims-ui-mobile/src/pages/maint/maint-order.vue index d4fd359..bd77876 100644 --- a/eims-ui-mobile/src/pages/maint/maint-order.vue +++ b/eims-ui-mobile/src/pages/maint/maint-order.vue @@ -283,7 +283,7 @@ getMaintStOrderList(params) .then((res: any) => { // 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡 - paging.value.complete(res.rows) + paging.value.completeByTotal(res.rows, res.total) }) .catch((res) => { // 濡傛灉璇锋眰澶辫触鍐檖aging.value.complete(false)锛屼細鑷姩灞曠ず閿欒椤甸潰 diff --git a/eims-ui-mobile/src/pages/maint/maint-st.vue b/eims-ui-mobile/src/pages/maint/maint-st.vue index 3ad9077..f7ce57c 100644 --- a/eims-ui-mobile/src/pages/maint/maint-st.vue +++ b/eims-ui-mobile/src/pages/maint/maint-st.vue @@ -15,10 +15,8 @@ <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" /> <wd-drop-menu-item v-model="status" :options="statusList" @change="handleStatus" /> </wd-drop-menu> - <wd-divider></wd-divider> </template> <view class="bg-base"> - <view class="w-full h-[24rpx]"></view> <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id"> <template #title> <view class="flex justify-between"> @@ -123,7 +121,7 @@ getMaintStList(params) .then((res: any) => { // 璇峰嬁鍦ㄧ綉缁滆姹傚洖璋冧腑缁檇ataList璧嬪�硷紒锛佸彧闇�瑕佽皟鐢╟omplete灏卞彲浠ヤ簡 - paging.value.complete(res.rows) + paging.value.completeByTotal(res.rows, res.total) }) .catch((res) => { // 濡傛灉璇锋眰澶辫触鍐檖aging.value.complete(false)锛屼細鑷姩灞曠ず閿欒椤甸潰 @@ -143,7 +141,6 @@ paging.value.reload() } onLoad(() => { - queryList() uni.$on('maint-st-refresh', reloadData) }) onUnload(() => { diff --git a/eims-ui-mobile/src/pages/repair/repair-add.vue b/eims-ui-mobile/src/pages/repair/repair-add.vue new file mode 100644 index 0000000..12a7620 --- /dev/null +++ b/eims-ui-mobile/src/pages/repair/repair-add.vue @@ -0,0 +1,408 @@ +<route lang="json5" type="page"> +{ + layout: 'default', + style: { + navigationBarTitleText: '娣诲姞鎶ヤ慨', + 'app-plus': { + titleNView: { + buttons: [ + { + text: '鎻愪氦', + fontSize: '14px', + color: '#FFFFFF', + }, + { + text: '', + fontSize: '24px', + color: '#FFFFFF', + }, + ], + }, + }, + }, +} +</route> + +<template> + <view class="bg-base"> + <wd-form ref="form" :model="model"> + <wd-cell-group custom-class="group" title="绫诲瀷淇℃伅" border> + <wd-picker + prop="reqType" + :columns="reqList" + label-key="dictLabel" + value-key="dictValue" + label="鏁呴殰绫诲瀷" + v-model="model.reqType" + @confirm="handleConfirmReqType" + /> + </wd-cell-group> + + <wd-cell-group + v-if="model.reqType === '1'" + custom-class="mt-2" + title="璁惧淇℃伅" + use-slot + border + > + <template #value> + <view class="text-color-gray flex items-center"> + <wd-icon class="icon-color-base" name="scan" size="30rpx"></wd-icon> + <text class="ml-1">鎵澶囩爜娣诲姞</text> + </view> + </template> + <wd-input + @click.stop="handleSelectEqu" + label="璁惧鍚嶇О" + label-width="200rpx" + prop="equName" + readonly + required + suffix-icon="arrow-right" + clearable + v-model="model.equName" + placeholder="璇烽�夋嫨璁惧" + /> + </wd-cell-group> + + <wd-cell-group + v-if="model.reqType === '2'" + custom-class="mt-2" + title="宸ュ叿淇℃伅" + use-slot + border + > + <template #value> + <view class="text-color-gray flex items-center"> + <wd-icon class="icon-color-base" name="scan" size="30rpx"></wd-icon> + <text class="ml-1">鎵伐鍏风爜娣诲姞</text> + </view> + </template> + <wd-input + @click.stop="handleSelectFixture" + label="宸ュ叿鍚嶇О" + label-width="200rpx" + prop="fixtureName" + readonly + required + suffix-icon="arrow-right" + clearable + v-model="model.fixtureName" + placeholder="璇烽�夋嫨宸ュ叿" + /> + </wd-cell-group> + + <wd-cell-group custom-class="mt-2" title="鏁呴殰淇℃伅" border> + <wd-input + v-if="false" + label="鎶ヤ慨鍗曞彿" + placeholder="璇风敓鎴愭姤淇崟鍙�" + label-width="200rpx" + v-model="model.code" + prop="code" + > + <template #suffix> + <wd-button size="small" icon="edit-outline" @click.stop="handleRepairCode"> + 鐢熸垚 + </wd-button> + </template> + </wd-input> + + <wd-textarea + label="鎶ヤ慨鎻忚堪" + label-width="200rpx" + type="textarea" + v-model="model.reqDesc" + auto-height + :maxlength="200" + show-word-limit + placeholder="璇疯緭鍏ユ姤淇弿杩�" + clearable + prop="reqDesc" + /> + <wd-cell title="鎶ヤ慨鍥剧墖" title-width="200rpx" prop="fileList"> + <wd-upload + :auto-upload="false" + :file-list="model.fileList" + :action="VITE_UPLOAD_BASEURL" + @change="handleFileChange" + ></wd-upload> + </wd-cell> + + <wd-datetime-picker + label="鍙戠敓鏃堕棿" + label-width="200rpx" + placeholder="璇烽�夋嫨鏁呴殰鍙戠敓鏃堕棿" + prop="occTime" + v-model="occTime" + @open="openOccTime" + @confirm="handleOccTimeConfirm" + /> + </wd-cell-group> + + <wd-cell-group custom-class="mt-2" title="鍏朵粬淇℃伅" border> + <wd-picker + :columns="faultList" + label-key="dictLabel" + value-key="dictValue" + label="鏁呴殰绫诲埆" + v-model="model.faultType" + @confirm="handleConfirmFaultType" + /> + <wd-picker + :columns="urgencyList" + label-key="dictLabel" + value-key="dictValue" + label="绱ф�ョ▼搴�" + v-model="model.urgencyLevel" + @confirm="handleConfirmUrgencyLevel" + /> + </wd-cell-group> + </wd-form> + </view> +</template> +<script setup lang="ts"> +import { reactive, ref } from 'vue' +import { getEnvBaseUploadUrl } from '@/utils' +import { generateCode } from '@/service/utils' +import { addRepairReq } from '@/service/repair' +import { formatDate } from '@/utils/DateUtils' +import { useToast, useMessage } from 'wot-design-uni' +import { useUserStore } from '@/store' +import { + DICT_REPAIR_FAULT_TYPE, + DICT_REPAIR_REQ_TYPE, + DICT_REPAIR_URGENCY_LEVEL, + getDictInfo, +} from '@/service/dict' + +const VITE_UPLOAD_BASEURL = `${getEnvBaseUploadUrl()}` +const message = useMessage() +const toast = useToast() +const userStore = useUserStore() + +// 鎶ヤ慨绫诲瀷 +const reqList = ref<any>([]) +// 鏁呴殰绫诲埆 +const faultList = ref<any>([]) +// 绱ф�ョ▼搴� +const urgencyList = ref<any>([]) + +const form = ref() +const occTime = ref(0) +const model = reactive<{ + code: string + status: string + reqDesc: string + occTime: string + reqTime: string + reqDept: number | string + reqUser: number | string + equId: string + equName: string + reqType: string + faultType: string + urgencyLevel: string + fixtureId: string + fixtureName: string + fileList: [] +}>({ + code: '', + reqDesc: '', + status: '', + occTime: '', + reqTime: '', + reqDept: null, + reqUser: null, + equId: '', + equName: '', + reqType: '', + faultType: '', + urgencyLevel: '', + fixtureId: '', + fixtureName: '', + fileList: [], +}) + +/** + * 閫夋嫨璁惧 + */ +function handleSelectEqu() { + uni.navigateTo({ + url: '/pages/equ/equ-list', + events: { + // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� + selectEqu: function (data) { + model.equId = data.data.equId + model.equName = data.data.equName + }, + }, + success: function (res) { + // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� + res.eventChannel.emit('OnSelectEqu', { data: '鐐规椤甸潰閫夋嫨璁惧' }) + }, + }) +} + +/** + * 閫夋嫨宸ュ叿 + */ +function handleSelectFixture() { + uni.navigateTo({ + url: '/pages/fixture/fixture-list', + events: { + // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� + selectFixture: function (data) { + model.fixtureId = data.data.id + model.fixtureName = data.data.fixtureName + }, + }, + success: function (res) { + // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� + res.eventChannel.emit('OnSelectFixture', { data: '娣诲姞缁翠慨椤甸潰閫夋嫨宸ュ叿' }) + }, + }) +} + +/** + * 鐢熸垚鎶ヤ慨缂栧彿 + */ +async function handleRepairCode() { + try { + const code: any = await generateCode('BXD') + model.code = code + console.log('鐢熸垚鎶ヤ慨鍗曞彿:', code) + + message + .confirm({ + msg: '纭畾鎻愪氦锛�', + title: '鎻愮ず', + beforeConfirm: ({ resolve }) => { + resolve(true) + handleAddRepairReq() + }, + }) + .then(() => {}) + .catch((error) => { + console.log(error) + }) + } catch (error) { + console.error('鐢熸垚鎶ヤ慨鍗曞彿澶辫触:', error) + toast.error('鐢熸垚鎶ヤ慨鍗曞彿澶辫触,璇锋鏌ョ綉缁滃悗閲嶈瘯') + } +} + +function handleAddRepairReq() { + // 琛ュ厖蹇呰瀛楁 + model.status = '0' + model.reqTime = formatDate(new Date()) + model.reqDept = userStore?.userInfo?.deptId + model.reqUser = userStore?.userInfo?.userId + addRepairReq(model) + .then((res: any) => { + if (res?.code === 200) { + toast.success(res?.msg) + uni.$emit('req-list-refresh') + setTimeout(() => { + uni.navigateBack() + }, 1500) + } + }) + .catch((res) => { + toast.error(res?.data?.msg || '璇锋眰澶辫触') + }) +} + +/** + * 涓婁紶鐐规鍥剧墖 + * @param fileList + */ +function handleFileChange({ fileList }) { + model.fileList = fileList +} + +function checkData() { + if (!model.reqType) { + toast.error('璇烽�夋嫨鎶ヤ慨绫诲瀷') + return false + } + if (model.reqType === '1' && !model.equId) { + toast.error('璇烽�夋嫨鎶ヤ慨璁惧') + return false + } + if (model.reqType === '2' && !model.fixtureId) { + toast.error('璇烽�夋嫨鎶ヤ慨宸ュ叿') + return false + } + if (!model.occTime) { + toast.error('璇烽�夊彂鐢熸椂闂�') + return false + } + return true +} + +function handleSubmit() { + if (!checkData()) { + return false + } + handleRepairCode() +} + +/** + * 鎵撳紑鍙戠敓鏃堕棿 鏃堕棿閫夋嫨鍣� + */ +function openOccTime() { + occTime.value = Date.now() +} +/** + * 纭閫夋嫨鍙戠敓鏃堕棿 + */ +function handleOccTimeConfirm({ value }) { + model.occTime = formatDate(new Date(value)) +} + +/** + * 閫夋嫨鎶ヤ慨绫诲瀷 + */ +function handleConfirmReqType({ value }) { +} + +/** + * 閫夋嫨鏁呴殰绫诲埆 + */ +function handleConfirmFaultType({ value }) { +} + +/** + * 閫夋嫨绱ф�ョ▼搴� + */ +function handleConfirmUrgencyLevel({ value }) { +} + +async function initData() { + const reqTypeList = await getDictInfo(DICT_REPAIR_REQ_TYPE) + reqList.value = reqTypeList + + const fList = await getDictInfo(DICT_REPAIR_FAULT_TYPE) + faultList.value = fList + + const uList = await getDictInfo(DICT_REPAIR_URGENCY_LEVEL) + urgencyList.value = uList +} + +onNavigationBarButtonTap((e) => { + if (e.index === 0) { + handleSubmit() + } +}) + +onLoad((options) => { + initData() +}) +</script> +<style scoped lang="scss"> +.footer { + background: white; + padding: 60rpx 42rpx; +} +</style> diff --git a/eims-ui-mobile/src/pages/repair/req-list.vue b/eims-ui-mobile/src/pages/repair/req-list.vue new file mode 100644 index 0000000..190468e --- /dev/null +++ b/eims-ui-mobile/src/pages/repair/req-list.vue @@ -0,0 +1,316 @@ +<route lang="json5"> +{ + layout: 'default', + needLogin: true, + style: { + navigationBarTitleText: '璁惧鎶ヤ慨', + 'app-plus': { + titleNView: { + buttons: [ + { + text: '鏂板', + fontSize: '14px', + color: '#FFFFFF', + }, + { + text: '', + fontSize: '24px', + color: '#FFFFFF', + }, + ], + }, + }, + }, +} +</route> +<template> + <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time> + <template #top> + <wd-drop-menu v-if="!isSelectReq"> + <wd-drop-menu-item + v-model="reqTypeId" + label-key="dictLabel" + value-key="dictValue" + :options="reqTypeList" + @change="handleReqType" + /> + <wd-drop-menu-item + v-model="status" + label-key="dictLabel" + value-key="dictValue" + :options="statusList" + @change="handleReqStatu" + /> + </wd-drop-menu> + </template> + + <view class="bg-base"> + <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id"> + <template #title> + <view class="flex justify-between items-center"> + <view class="flex items-center menu-title-box"> + <view class="menu-indicator"></view> + <text class="ml-1 text-xs">{{ item.code }}</text> + </view> + + <view> + <wd-button size="small" v-if="item.status === '0'" type="info">寰呮帴鍗�</wd-button> + <wd-button size="small" v-else-if="item.status === '1'" type="warning"> + 宸叉帴鍗� + </wd-button> + <wd-button size="small" v-else-if="item.status === '2'" type="primary"> + 缁翠慨涓� + </wd-button> + <wd-button size="small" v-else-if="item.status === '3'" type="success"> + 宸插畬鎴� + </wd-button> + </view> + </view> + </template> + <wd-swipe-action> + <view class="flex h-[160rpx] items-center" @click.stop="itemClick(item)"> + <image + v-if="item.reqType === '1'" + class="slot-img text-center" + src="/static/ico/ico-huiyi.png" + /> + <image + v-else-if="item.reqType === '2'" + class="slot-img text-center" + src="/static/ico/ico-setting.png" + /> + <image + v-else-if="item.reqType === '3'" + class="slot-img text-center" + src="/static/ico/ico-faxian.png" + /> + <view class="flex-1 mt-1"> + <view class="text-color-base"> + <template v-if="item.reqType === '1'"> + <text>璁惧绫诲瀷</text> + <text class="mx-2">|</text> + <text>{{ item.equName }}</text> + </template> + + <template v-if="item.reqType === '2'"> + <text>宸ュ叿绫诲瀷</text> + <text class="mx-2">|</text> + <text>{{ item.fixtureName }}</text> + </template> + + <template v-if="item.reqType === '3'"> + <text>鍏朵粬绫诲瀷</text> + </template> + <view class="text-color-gray mt-1 text-mini"> + <text>鍙戠敓鏃堕棿: {{ item.occTime }}</text> + </view> + + <view class="text-color-gray mt-1 text-mini"> + <text>鎶ヤ慨鏃堕棿: {{ item.reqTime }}</text> + </view> + <view class="text-color-gray mt-1 text-mini"> + <text>鎶ヤ慨浜�: {{ item.reqUserName }}</text> + </view> + </view> + <view class="text-color-gray text-xs mt-1"> + {{ item.location }} {{ item.madeIn }} + </view> + </view> + <view v-if="isSelectReq"> + <wd-button size="small" icon="edit-outline" @click.stop="handleSelectReq(item)"> + 閫変腑 + </wd-button> + </view> + </view> + <template #right> + <view class="h-full px-3 flex items-center"> + <wd-button size="small" type="error" @click.stop="handleDelete(item)">鍒犻櫎</wd-button> + </view> + </template> + </wd-swipe-action> + </wd-card> + </view> + </z-paging> +</template> + +<script setup lang="ts"> +import { onMounted, getCurrentInstance, ref } from 'vue' +import { useToast, useMessage } from 'wot-design-uni' +import { getRepairReqList, delRepairReq } from '@/service/repair' +import { DICT_REPAIR_REQ_STATUS, DICT_REPAIR_REQ_TYPE, getDictInfo } from '@/service/dict' + +const message = useMessage() +const toast = useToast() +// 鎶ヤ慨鍗曠被鍨� +const reqTypeId = ref<number>(-1) +// 鎶ヤ慨鍗曞鐞嗙姸鎬� +const status = ref<number>(-1) + +const isSelectReq = ref(false) + +const reqTypeList = ref<any>([{ dictLabel: '鎵�鏈夌被鍨�', dictValue: -1 }]) +const statusList = ref<any>([{ dictLabel: '鎵�鏈夌姸鎬�', dictValue: -1 }]) +function handleReqType({ value }) { + reloadData() +} +function handleReqStatu({ value }) { + reloadData() +} + +const paging = ref(null) +const dataList = ref([]) + +const queryList = (pageNum?: number, pageSize?: number) => { + const parmams = { + pageNum, + pageSize, + reqType: reqTypeId.value, + status: status.value, + } + if (reqTypeId.value === -1) { + delete parmams.reqType + } + if (status.value === -1) { + delete parmams.status + } + + getRepairReqList(parmams) + .then((res: any) => { + paging.value.completeByTotal(res.rows, res.total) + }) + .catch((res) => { + paging.value.complete(false) + }) +} +function reloadData() { + paging.value.reload() +} + +/** + * 鍒犻櫎 + * @param item + */ +function handleDelete(item: any) { + message + .confirm({ + msg: '纭畾鍒犻櫎锛�', + title: '鎻愮ず', + beforeConfirm: ({ resolve }) => { + resolve(true) + if (item.status !== '0') { + toast.error('璇ユ姤淇崟宸茶鎺ュ崟锛岃鑱旂郴绠$悊鍛�!') + } else { + delRepairReq(item.id) + .then((res: any) => { + if (res?.code === 200) { + toast.success('鍒犻櫎鎴愬姛') + reloadData() + } + }) + .catch((res) => { + toast.error('鍒犻櫎澶辫触') + }) + } + }, + }) + .then(() => {}) + .catch((error) => { + console.log(error) + }) +} + +/** + * 鏉$洰鐐瑰嚮浜嬩欢 + * @param item + */ +function itemClick(item: any) {} + +/** + * 鍏跺畠椤甸潰閫夋嫨鎶ヤ慨鍗� + * @param item + */ +function handleSelectReq(item: any) { + if (isSelectReq.value) { + emitSelectReq(item) + uni.navigateBack() + } +} + +/** + * 閫夋嫨鍥炶皟 + * @param req + */ +function emitSelectReq(req: any) { + eventChannel.value.emit('selectReq', { + data: req, + }) +} + +onNavigationBarButtonTap((e) => { + if (e.index === 0 && !isSelectReq.value) { + uni.navigateTo({ + url: `/pages/repair/repair-add`, + }) + } +}) + +const eventChannel = ref<any>() +onMounted(() => { + const instance: any = getCurrentInstance().proxy + const event = instance.getOpenerEventChannel() + eventChannel.value = event + event.on('OnSelectReq', function (data) { + isSelectReq.value = true + // 鍙樉绀烘湭鎺ュ崟鏁版嵁 + status.value = 0 + console.log('OnSelectReq', data) + }) +}) + +async function initData() { + const rList: any = await getDictInfo(DICT_REPAIR_REQ_TYPE) + reqTypeList.value.push(...rList) + const sList: any = await getDictInfo(DICT_REPAIR_REQ_STATUS) + statusList.value.push(...sList) +} + +onLoad(() => { + initData() + uni.$on('req-list-refresh', reloadData) +}) +onUnload(() => { + uni.$off('req-list-refresh', reloadData) +}) +</script> + +<style scoped lang="scss"> +.menu-title-box { + height: 30rpx; + line-height: 30rpx; +} + +.slot-img { + width: 72rpx; + height: 72rpx; + margin-right: 24rpx; +} +.text-mini { + font-size: 22rpx; +} + +.menu-indicator { + width: 6rpx; + height: 22rpx; + border-radius: 10rpx; + background-color: $uni-color-primary; +} +:deep(.wd-card__title-content) { + padding: 16rpx !important; +} +:deep(.wd-card__content) { + padding: 16rpx !important; +} +:deep(.wd-card__footer) { + padding: 10rpx !important; +} +</style> diff --git a/eims-ui-mobile/src/pages/repair/res-list.vue b/eims-ui-mobile/src/pages/repair/res-list.vue new file mode 100644 index 0000000..2f3951c --- /dev/null +++ b/eims-ui-mobile/src/pages/repair/res-list.vue @@ -0,0 +1,278 @@ +<route lang="json5"> +{ + layout: 'default', + needLogin: true, + style: { + navigationBarTitleText: '璁惧缁翠慨', + 'app-plus': { + titleNView: { + buttons: [ + { + text: '鎺ュ崟', + fontSize: '14px', + color: '#FFFFFF', + }, + { + text: '', + fontSize: '24px', + color: '#FFFFFF', + }, + ], + }, + }, + }, +} +</route> +<template> + <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time> + <template #top> + <wd-drop-menu> + <wd-drop-menu-item + v-model="resTypeId" + label-key="dictLabel" + value-key="dictValue" + :options="resTypeList" + @change="handleResType" + /> + <wd-drop-menu-item + v-model="status" + label-key="dictLabel" + value-key="dictValue" + :options="statusList" + @change="handleResStatu" + /> + </wd-drop-menu> + </template> + + <view class="bg-base"> + <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id"> + <template #title> + <view class="flex justify-between items-center"> + <view class="flex items-center menu-title-box"> + <view class="menu-indicator"></view> + <text class="ml-1 text-xs">{{ item.resCode }}</text> + <text class="text-color-gray ml-2 text-mini">鎺ュ崟:{{ item.createTime }}</text> + </view> + + <view> + <wd-tag size="small" v-if="item.status === '1'" type="warning">宸叉帴鍗�</wd-tag> + <wd-tag size="small" v-else-if="item.status === '2'" type="primary">缁翠慨涓�</wd-tag> + <wd-tag size="small" v-else-if="item.status === '3'" type="success">宸插畬鎴�</wd-tag> + </view> + </view> + </template> + <view class="flex h-[240rpx] items-center" @click.stop="itemClick(item)"> + <image + v-if="item.reqType === '1'" + class="slot-img text-center" + src="/static/ico/ico-huiyi.png" + /> + <image + v-else-if="item.reqType === '2'" + class="slot-img text-center" + src="/static/ico/ico-setting.png" + /> + <image + v-else-if="item.reqType === '3'" + class="slot-img text-center" + src="/static/ico/ico-faxian.png" + /> + <view class="flex-1 mt-1"> + <view class="text-color-base"> + <template v-if="item.reqType === '1'"> + <text>璁惧绫诲瀷</text> + <text class="mx-2">|</text> + <text>{{ item.equName }}</text> + </template> + + <template v-if="item.reqType === '2'"> + <text>宸ュ叿绫诲瀷</text> + <text class="mx-2">|</text> + <text>{{ item.fixtureName }}</text> + </template> + + <template v-if="item.reqType === '3'"> + <text>鍏朵粬绫诲瀷</text> + </template> + <view class="text-color-gray mt-1 text-mini"> + <text>鎶ヤ慨浜�: {{ item.reqUserName }}</text> + </view> + <view class="text-color-gray mt-1 text-mini"> + <text>鎶ヤ慨鏃堕棿: {{ item.reqTime }}</text> + </view> + + <view class="text-color-gray mt-1 text-mini"> + <text>寮�濮嬫椂闂�: {{ item.startTime }}</text> + </view> + <view class="text-color-gray mt-1 text-mini"> + <text>瀹屾垚鏃堕棿: {{ item.endTime }}</text> + </view> + <view class="text-color-gray mt-1 text-mini"> + <text>缁翠慨浜�: {{ item.resUserName }}</text> + </view> + </view> + </view> + <view> + <wd-button v-if="item.status === '1'" size="small" icon="edit-outline">寮�濮嬬淮淇�</wd-button> + <wd-button v-if="item.status === '2'" size="small" icon="edit-outline">缁翠慨涓�</wd-button> + <wd-button v-if="item.status === '3'" size="small" icon="edit-outline">宸插畬鎴�</wd-button> + </view> + </view> + </wd-card> + </view> + </z-paging> +</template> + +<script setup lang="ts"> +import { onMounted, getCurrentInstance, ref } from 'vue' +import { useToast, useMessage } from 'wot-design-uni' +import { getRepairResList, addRepairRes } from '@/service/repair' +import { DICT_REPAIR_RES_STATUS, DICT_REPAIR_REQ_TYPE, getDictInfo } from '@/service/dict' +import { useUserStore } from '@/store' +const userStore = useUserStore() + +const message = useMessage() +const toast = useToast() +// 缁翠慨鍗曠被鍨� +const resTypeId = ref<number>(0) +// 缁翠慨鍗曞鐞嗙姸鎬� +const status = ref<number>(0) + +const isSelectRes = ref(false) + +const resTypeList = ref<any>([{ dictLabel: '鎵�鏈夌被鍨�', dictValue: 0 }]) +const statusList = ref<any>([{ dictLabel: '鎵�鏈夌姸鎬�', dictValue: 0 }]) +function handleResType({ value }) { + reloadData() +} +function handleResStatu({ value }) { + reloadData() +} + +const paging = ref(null) +const dataList = ref([]) + +const queryList = (pageNum?: number, pageSize?: number) => { + const parmams = { + pageNum, + pageSize, + reqType: resTypeId.value, + status: status.value, + } + if (resTypeId.value === 0) { + delete parmams.reqType + } + if (status.value === 0) { + delete parmams.status + } + getRepairResList(parmams) + .then((res: any) => { + paging.value.completeByTotal(res.rows, res.total) + }) + .catch((res) => { + paging.value.complete(false) + }) +} +function reloadData() { + paging.value.reload() +} + +/** + * 鏉$洰鐐瑰嚮浜嬩欢 + * @param item + */ +function itemClick(item: any) {} + +onNavigationBarButtonTap((e) => { + if (e.index === 0) { + handleSelectReq() + } +}) + +/** + * 閫夋嫨鎶ヤ慨鍗� + */ +function handleSelectReq() { + uni.navigateTo({ + url: '/pages/repair/req-list', + events: { + // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� + selectReq: function (data) { + console.error(data) + // 閫夋嫨鎶ヤ慨鍗曞悗锛屼慨鏀规姤淇崟鐘舵�佸拰鏂板缁翠慨宸ュ崟 + const resCode = `WXD${data.data.code.slice(3)}` + const deptId = userStore?.userInfo?.deptId + const userId = userStore?.userInfo?.userId + const resData = { + reqId: data.data.id, + reqCode: data.data.code, + reqUser: data.data.reqUser, + reqDept: data.data.reqDept, + resCode, + status: '1', + resUser: userId, + resDept: deptId, + } + addRepairRes(resData) + .then((res: any) => { + if (res.code === 200) { + toast.success(res?.msg || '鎿嶄綔鎴愬姛') + reloadData() + } else { + toast.error(res?.msg || '鐢熸垚缁翠慨宸ュ崟澶辫触锛岃閲嶈瘯') + } + }) + .catch((res) => { + toast.error(res?.msg || '鐢熸垚缁翠慨宸ュ崟澶辫触锛岃閲嶈瘯') + }) + }, + }, + success: function (res) { + // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� + res.eventChannel.emit('OnSelectReq', { data: '缁翠慨鍗曢〉闈㈤�夋嫨鎶ヤ慨鍗�' }) + }, + }) +} + +async function initData() { + const rList: any = await getDictInfo(DICT_REPAIR_REQ_TYPE) + resTypeList.value.push(...rList) + const sList: any = await getDictInfo(DICT_REPAIR_RES_STATUS) + statusList.value.push(...sList) +} +onLoad((options) => { + initData() +}) +</script> + +<style scoped lang="scss"> +.menu-title-box { + height: 30rpx; + line-height: 30rpx; +} + +.slot-img { + width: 72rpx; + height: 72rpx; + margin-right: 24rpx; +} +.text-mini { + font-size: 22rpx; +} + +.menu-indicator { + width: 6rpx; + height: 22rpx; + border-radius: 10rpx; + background-color: $uni-color-primary; +} +:deep(.wd-card__title-content) { + padding: 16rpx !important; +} +:deep(.wd-card__content) { + padding: 16rpx !important; +} +:deep(.wd-card__footer) { + padding: 10rpx !important; +} +</style> diff --git a/eims-ui-mobile/src/service/.DS_Store b/eims-ui-mobile/src/service/.DS_Store new file mode 100644 index 0000000..c50b3b4 --- /dev/null +++ b/eims-ui-mobile/src/service/.DS_Store Binary files differ diff --git a/eims-ui-mobile/src/service/dict.d.ts b/eims-ui-mobile/src/service/dict.d.ts new file mode 100644 index 0000000..e46092f --- /dev/null +++ b/eims-ui-mobile/src/service/dict.d.ts @@ -0,0 +1,17 @@ +export interface DictData { + createBy: string; + createTime: string; + cssClass: string; + default: boolean; + dictCode: number; + dictLabel: string; + dictSort: number; + dictType: string; + dictValue: string; + isDefault: string; + listClass: string; + remark: string; + status: string; + updateBy?: any; + updateTime?: any; +} diff --git a/eims-ui-mobile/src/service/dict.ts b/eims-ui-mobile/src/service/dict.ts new file mode 100644 index 0000000..d59eecf --- /dev/null +++ b/eims-ui-mobile/src/service/dict.ts @@ -0,0 +1,13 @@ +import { http } from '@/utils/http' +import type { DictData } from './dict.d' + + +export const DICT_REPAIR_REQ_TYPE = 'repair_req_type' +export const DICT_REPAIR_URGENCY_LEVEL = 'repair_urgency_level' +export const DICT_REPAIR_FAULT_TYPE = 'repair_fault_type' +export const DICT_REPAIR_REQ_STATUS = 'repair_req_status' +export const DICT_REPAIR_RES_STATUS = 'repair_res_status' + +export const getDictInfo = (dictType: string) => { + return http.get<DictData[]>(`/system/dict/data/type/${dictType}`) +} diff --git a/eims-ui-mobile/src/service/fixture.d.ts b/eims-ui-mobile/src/service/fixture.d.ts new file mode 100644 index 0000000..53da524 --- /dev/null +++ b/eims-ui-mobile/src/service/fixture.d.ts @@ -0,0 +1,95 @@ +export interface FixtureVO { + /** + * + */ + id: number | string; + + /** + * 娌诲叿缂栫爜 + */ + fixtureCode: string; + + /** + * 娌诲叿鍚嶇О + */ + fixtureName: string; + + /** + * 娌诲叿锛堝伐鍏凤級绫诲瀷 + */ + fixtureType: number; + + /** + * 娌诲叿鎻忚堪 + */ + fixtureDesc: string; + + /** + * 鍊熺敤閮ㄩ棬 + */ + borrowDept: number | string; + /** + * 鍊熺敤閮ㄩ棬 + */ + borrowDeptName: string; + + /** + * 鍊熺敤浜� + */ + borrowUser: number | string; + /** + * 鍊熺敤浜� + */ + borrowUserName: string; + /** + * 鍊熺敤鐘舵�� + */ + borrowStatus: string; + + createTime: string; + + /** + * 鐘舵�侊紙瀛楀吀锛� + */ + status: string; + + /** + * 璧勪骇缂栧彿 + */ + assetNo: string; + + /** + * 鍨嬪彿 + */ + modelNo: string; + + /** + * 瑙勬牸 + */ + specNo: string; + + /** + * 鍒堕�犲晢 + */ + madeIn: string; + + /** + * 閲囪喘鏃ユ湡 + */ + purchaseDate: string; + + /** + * 浣跨敤鏃ユ湡 + */ + deployDate: string; + + /** + * 浣跨敤骞撮檺 + */ + serviceLife: number; + + /** + * 澶囨敞 + */ + remark: string; +} diff --git a/eims-ui-mobile/src/service/fixture.ts b/eims-ui-mobile/src/service/fixture.ts new file mode 100644 index 0000000..f25af40 --- /dev/null +++ b/eims-ui-mobile/src/service/fixture.ts @@ -0,0 +1,9 @@ +import { http } from '@/utils/http' +import type { FixtureVO } from './fixture.d' + +/** + * 宸ュ叿鍒楄〃 + */ +export const getFixtureList = (params: any) => { + return http.get<FixtureVO[]>('/eims/fixture/list', params) +} diff --git a/eims-ui-mobile/src/service/repair.d.ts b/eims-ui-mobile/src/service/repair.d.ts new file mode 100644 index 0000000..65eb8fd --- /dev/null +++ b/eims-ui-mobile/src/service/repair.d.ts @@ -0,0 +1,159 @@ +export interface RepairReqVO { + /** + * 鎶ヤ慨id + */ + id: number | string; + + /** + * 鎶ヤ慨鍗曞彿 + */ + code: string; + + /** + * 鎶ヤ慨鐘舵�� + */ + status: string; + + /** + * 鍙戠敓浜嬩欢 + */ + occTime: string; + + /** + * 鎶ヤ慨鏃堕棿 + */ + reqTime: string; + + /** + * 鎶ヤ慨浜洪儴闂� + */ + reqDept: number; + + /** + * 鎶ヤ慨浜� + */ + reqUser: number; + + /** + * 鎶ヤ慨鎻忚堪 + */ + reqDesc: string; + + /** + * 绱ф�ョ▼搴� + */ + urgencyLevel: string; + + /** + * 鏁呴殰鍥剧墖 + */ + faultPicture: string; + + /** + * 鎶ヤ慨绫诲瀷 + */ + reqType: string; + + /** + * 璁惧id + */ + equId: number | string; + + /** + * 缁翠慨鍗昳d + */ + repairId: number | string; + + /** + * 缁翠慨浜洪儴闂� + */ + repairDept: number; + + /** + * 缁翠慨浜� + */ + repairUser: number; + + /** + * 鏁呴殰绫诲埆 + */ + faultType: string; + + /** + * 澶囨敞 + */ + remark: string; +} + +export interface RepairResVO { + /** + * + */ + id: number | string; + + /** + * 鎶ヤ慨鍗昳d + */ + reqId: number | string; + + /** + * 缁翠慨鍗曞彿 + */ + resCode: string; + + /** + * 缁翠慨浜� + */ + resUser: number; + + /** + * 缁翠慨浜洪儴闂� + */ + resDept: number; + + /** + * 鍘熷洜鍒嗘瀽 + + */ + resReason: string; + + /** + * 澶勭悊鎺柦 + */ + resHandle: string; + + /** + * 棰勯槻鎺柦 + */ + resPrevent: string; + + /** + * 缁翠慨鐘舵��(瀛楀吀) + */ + status: string; + + /** + * 寮�濮嬫椂闂� + */ + startTime: string; + + /** + * 缁撴潫鏃堕棿 + */ + endTime: string; + + /** + * 浣跨敤宸ュ叿 + */ + useFixture: string; + + /** + * 浣跨敤澶囦欢 + */ + useParts: string; + + /** + * 澶囨敞 + */ + remark: string; +} diff --git a/eims-ui-mobile/src/service/repair.ts b/eims-ui-mobile/src/service/repair.ts new file mode 100644 index 0000000..b763de3 --- /dev/null +++ b/eims-ui-mobile/src/service/repair.ts @@ -0,0 +1,42 @@ +import { http } from '@/utils/http' +import type { RepairReqVO, RepairResVO } from './repair.d' +type ID = number | string + +/** + * 鏂板鎶ヤ慨鍗� + * @param data + */ +export const addRepairReq = (data: any) => { + return http.post<void>('/eims/repairReq', data) +} +/** + * 鍒犻櫎鎶ヤ慨鍗� + * @param id + */ +export const delRepairReq = (id: ID) => { + return http.del<void>(`/eims/repairReq/${id}`) +} +/** + * 鎶ヤ慨鍗曞垪琛� + */ +export const getRepairReqList = (params: any) => { + return http.get<RepairReqVO[]>('/eims/repairReq/list', params) +} + + + + + +/** + * 缁翠慨鍗曞垪琛� + */ +export const getRepairResList = (params: any) => { + return http.get<RepairResVO[]>('/eims/repairRes/list', params) +} +/** + * 鏂板缁翠慨鍗� + * @param data + */ +export const addRepairRes = (data: any) => { + return http.post<void>('/eims/repairRes/add', data) +} diff --git a/eims-ui-mobile/src/service/utils.ts b/eims-ui-mobile/src/service/utils.ts new file mode 100644 index 0000000..925609e --- /dev/null +++ b/eims-ui-mobile/src/service/utils.ts @@ -0,0 +1,9 @@ +import { http } from '@/utils/http' + +/** + * 鐢熸垚鍚勭鍗曞彿 + * @param prefix 鍗曞彿鍓嶇紑 + */ +export const generateCode = (prefix: string) => { + return http.get<string>(`/eims/generate/${prefix}`) +} diff --git a/eims-ui-mobile/src/static/ico/ico-faxian.png b/eims-ui-mobile/src/static/ico/ico-faxian.png new file mode 100644 index 0000000..84bed39 --- /dev/null +++ b/eims-ui-mobile/src/static/ico/ico-faxian.png Binary files differ diff --git a/eims-ui-mobile/src/static/ico/ico-huiyi.png b/eims-ui-mobile/src/static/ico/ico-huiyi.png new file mode 100644 index 0000000..8797ef9 --- /dev/null +++ b/eims-ui-mobile/src/static/ico/ico-huiyi.png Binary files differ diff --git a/eims-ui-mobile/src/static/ico/ico-setting.png b/eims-ui-mobile/src/static/ico/ico-setting.png new file mode 100644 index 0000000..3863a0f --- /dev/null +++ b/eims-ui-mobile/src/static/ico/ico-setting.png Binary files differ diff --git a/eims-ui-mobile/src/style/index.scss b/eims-ui-mobile/src/style/index.scss index 032124f..a35dd3f 100644 --- a/eims-ui-mobile/src/style/index.scss +++ b/eims-ui-mobile/src/style/index.scss @@ -24,6 +24,12 @@ .text-color-gray { color: $uni-text-color-grey; } +.text-color-primary { + color: $uni-color-primary; +} +.text-color-success { + color: $uni-color-success; +} // 鍥炬爣棰滆壊 .icon-color-base { diff --git a/eims-ui-mobile/src/types/uni-pages.d.ts b/eims-ui-mobile/src/types/uni-pages.d.ts index 23e19a1..6b710ba 100644 --- a/eims-ui-mobile/src/types/uni-pages.d.ts +++ b/eims-ui-mobile/src/types/uni-pages.d.ts @@ -7,6 +7,7 @@ url: "/pages/home/index" | "/pages/equ/equ-list" | "/pages/equ/index" | + "/pages/fixture/fixture-list" | "/pages/inspect/insp-add" | "/pages/inspect/insp-record" | "/pages/inspect/insp-st" | @@ -15,6 +16,9 @@ "/pages/maint/maint-st" | "/pages/maint/order-detail" | "/pages/my/index" | + "/pages/repair/repair-add" | + "/pages/repair/req-list" | + "/pages/repair/res-list" | "/pages/spare/index"; } interface RedirectToOptions extends NavigateToOptions {} diff --git a/eims-ui-mobile/src/utils/http.ts b/eims-ui-mobile/src/utils/http.ts index 7314ccd..b9f2ada 100644 --- a/eims-ui-mobile/src/utils/http.ts +++ b/eims-ui-mobile/src/utils/http.ts @@ -119,6 +119,14 @@ }) } +export const httpDel = <T>(url: string) => { + return http<T>({ + url, + method: 'DELETE', + }) +} + http.get = httpGet http.post = httpPost http.put = httpPut +http.del = httpDel diff --git a/eims-ui/apps/web-antd/src/views/eims/repair-req/data.tsx b/eims-ui/apps/web-antd/src/views/eims/repair-req/data.tsx index 4946d81..f3d1323 100644 --- a/eims-ui/apps/web-antd/src/views/eims/repair-req/data.tsx +++ b/eims-ui/apps/web-antd/src/views/eims/repair-req/data.tsx @@ -135,11 +135,20 @@ minWidth: 200 }, { + title: '鍙戠敓鏃堕棿', + field: 'occTime', + sortable: true, + minWidth: 200 + }, + { title: '鏁呴殰绫诲埆', field: 'faultType', minWidth: 100, slots: { default: ({ row }) => { + if(!row.faultType){ + return '' + } return renderDict(row.faultType, DictEnum.REPAIR_FAULT_TYPE); } } diff --git a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairReqBo.java b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairReqBo.java index 87684ac..2e62264 100644 --- a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairReqBo.java +++ b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairReqBo.java @@ -31,13 +31,11 @@ /** * 鎶ヤ慨鍗曞彿 */ - @NotBlank(message = "鎶ヤ慨鍗曞彿涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) private String code; /** * 鎶ヤ慨鐘舵�� */ - @NotBlank(message = "鎶ヤ慨鐘舵�佷笉鑳戒负绌�", groups = { AddGroup.class, EditGroup.class }) private String status; /** @@ -55,25 +53,21 @@ /** * 鎶ヤ慨浜洪儴闂� */ - @NotNull(message = "鎶ヤ慨浜洪儴闂ㄤ笉鑳戒负绌�", groups = { AddGroup.class, EditGroup.class }) private Long reqDept; /** * 鎶ヤ慨浜� */ - @NotNull(message = "鎶ヤ慨浜轰笉鑳戒负绌�", groups = { AddGroup.class, EditGroup.class }) private Long reqUser; /** * 鎶ヤ慨鎻忚堪 */ - @NotBlank(message = "鎶ヤ慨鎻忚堪涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) private String reqDesc; /** * 绱ф�ョ▼搴� */ - @NotBlank(message = "绱ф�ョ▼搴︿笉鑳戒负绌�", groups = { AddGroup.class, EditGroup.class }) private String urgencyLevel; /** @@ -84,7 +78,6 @@ /** * 鎶ヤ慨绫诲瀷 */ - @NotBlank(message = "鎶ヤ慨绫诲瀷涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) private String reqType; /** @@ -115,7 +108,6 @@ /** * 鏁呴殰绫诲埆 */ - @NotBlank(message = "鏁呴殰绫诲埆涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) private String faultType; /** diff --git a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairResBo.java b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairResBo.java index 5ddb4c2..3b7f3c2 100644 --- a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairResBo.java +++ b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsRepairResBo.java @@ -115,6 +115,7 @@ // 鍏宠仈琛ㄥ瓧娈� private String reqCode;//鎶ヤ慨鍗曠紪鐮� + private String reqType;//鎶ヤ慨鍗曠被鍨� diff --git a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsRepairResVo.java b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsRepairResVo.java index 856a25f..6436efc 100644 --- a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsRepairResVo.java +++ b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsRepairResVo.java @@ -2,6 +2,7 @@ import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.translation.annotation.Translation; import org.dromara.common.translation.constant.TransConstant; import org.dromara.eims.domain.EimsRepairRes; @@ -27,7 +28,7 @@ @Data @ExcelIgnoreUnannotated @AutoMapper(target = EimsRepairRes.class) -public class EimsRepairResVo implements Serializable { +public class EimsRepairResVo extends BaseEntity implements Serializable { @Serial private static final long serialVersionUID = 1L; @@ -127,7 +128,7 @@ */ @ExcelProperty(value = "澶囨敞") private String remark; - + /** * 璇勪环id */ diff --git a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java index 8afbba1..323765b 100644 --- a/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java +++ b/eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsRepairResServiceImpl.java @@ -111,7 +111,7 @@ */ @Transactional(rollbackFor = Exception.class) @Override - public Boolean insertByBo(EimsRepairResBo bo) { + public synchronized Boolean insertByBo(EimsRepairResBo bo) { EimsRepairRes add = MapstructUtils.convert(bo, EimsRepairRes.class); validEntityBeforeSave(add); boolean flag = baseMapper.insert(add) > 0; @@ -272,6 +272,7 @@ qw.like(StringUtils.isNotBlank(bo.getResCode()), "res.res_code", bo.getResCode()); qw.like(StringUtils.isNotBlank(bo.getReqCode()), "req.code", bo.getReqCode()); qw.eq(bo.getResUser() != null, "res.res_user", bo.getResUser()); + qw.eq(bo.getReqType() != null, "req.req_type", bo.getReqType()); qw.eq(bo.getReqUser() != null, "res.req_user", bo.getReqUser()); List<Long> resDeptIds = getAllDescendantIds(bo.getResDept()); -- Gitblit v1.9.3