| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | layout: 'default', |
| | | style: { |
| | | navigationBarTitleText: '添加报修', |
| | | 'app-plus': { |
| | | titleNView: { |
| | | buttons: [ |
| | | { |
| | | text: '提交', |
| | | fontSize: '14px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | { |
| | | text: '', |
| | | fontSize: '24px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | }, |
| | | needLogin: true, |
| | | style: { navigationBarTitleText: '添加报修', navigationStyle: 'custom' }, |
| | | } |
| | | </route> |
| | | |
| | | <template> |
| | | <view class="bg-base"> |
| | | <wd-navbar |
| | | title="添加报修" |
| | | left-arrow |
| | | @click-left="goBack" |
| | | right-text="提交" |
| | | @click-right="handleSubmit" |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | ></wd-navbar> |
| | | <wd-form ref="form" :model="model"> |
| | | <wd-cell-group custom-class="group" title="类型信息" border> |
| | | <wd-picker |
| | |
| | | /> |
| | | <wd-cell title="报修图片" title-width="200rpx" prop="fileList"> |
| | | <wd-upload |
| | | :auto-upload="false" |
| | | :file-list="model.fileList" |
| | | v-model:file-list="model.fileList" |
| | | :action="VITE_UPLOAD_BASEURL" |
| | | @change="handleFileChange" |
| | | @success="handleUploadSuccess" |
| | | ></wd-upload> |
| | | </wd-cell> |
| | | |
| | |
| | | @open="openOccTime" |
| | | @confirm="handleOccTimeConfirm" |
| | | /> |
| | | <!-- <wd-picker |
| | | :columns="urgencyList" |
| | | label-key="dictLabel" |
| | | value-key="dictValue" |
| | | label="紧急程度" |
| | | v-model="model.urgencyLevel" |
| | | @confirm="handleConfirmUrgencyLevel" |
| | | /> --> |
| | | <wd-cell title="紧急程度" title-width="200rpx" prop="urgencyLevel"> |
| | | <wd-radio-group v-model="model.urgencyLevel" inline shape="dot"> @change="handleConfirmUrgencyLevel"> |
| | | <wd-radio v-for="item in urgencyList" :value="item.dictValue">{{item.dictLabel}}</wd-radio> |
| | | </wd-radio-group> |
| | | </wd-cell> |
| | | |
| | | </wd-cell-group> |
| | | |
| | | <wd-cell-group custom-class="mt-2" title="其他信息" border> |
| | | |
| | | <wd-button style="margin: 20px" block @click="handleSubmit">提交</wd-button> |
| | | |
| | | <!-- <wd-cell-group custom-class="mt-2" title="其他信息" border> |
| | | <wd-picker |
| | | :columns="faultList" |
| | | label-key="dictLabel" |
| | |
| | | v-model="model.urgencyLevel" |
| | | @confirm="handleConfirmUrgencyLevel" |
| | | /> |
| | | </wd-cell-group> |
| | | </wd-cell-group> --> |
| | | </wd-form> |
| | | </view> |
| | | </template> |
| | |
| | | fixtureName: '', |
| | | fileList: [], |
| | | }) |
| | | |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | /** |
| | | * 选择设备 |
| | | */ |
| | | function handleSelectEqu() { |
| | | if(reqTypeDis.value){ |
| | | if (reqTypeDis.value) { |
| | | return false |
| | | } |
| | | uni.navigateTo({ |
| | |
| | | model.reqTime = formatDate(new Date()) |
| | | model.reqDept = userStore?.userInfo?.deptId |
| | | model.reqUser = userStore?.userInfo?.userId |
| | | console.log('model', model) |
| | | const map = model.fileList?.map((file) => file.url) |
| | | console.log('map', map) |
| | | model.faultPicture = map.join(',') |
| | | addRepairReq(model) |
| | | .then((res: any) => { |
| | | if (res?.code === 200) { |
| | |
| | | } |
| | | }) |
| | | .catch((res) => { |
| | | console.error('添加报修失败:', res) |
| | | toast.error(res?.data?.msg || '请求失败') |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 上传点检图片 |
| | | * @param fileList |
| | | */ |
| | | function handleFileChange({ fileList }) { |
| | | model.fileList = fileList |
| | | |
| | | function handleUploadSuccess({ file, fileList }) { |
| | | console.log('handleUploadSuccess', file) |
| | | // 判断 file.response是不是 对象,不是对象将json字符串转换为对象 |
| | | if (typeof file.response === 'string') { |
| | | file.response = JSON.parse(file.response) |
| | | console.log('file.response', file.response) |
| | | file.ossId = file.response.data.ossId |
| | | file.url = file.response.data.url |
| | | } |
| | | } |
| | | |
| | | function checkData() { |
| | |
| | | */ |
| | | function openOccTime() { |
| | | occTime.value = Date.now() |
| | | console.log('openOccTime', occTime) |
| | | model.occTime = formatDate(new Date(occTime.value)) |
| | | } |
| | | /** |
| | | * 确认选择发生时间 |
| | | */ |
| | | function handleOccTimeConfirm({ value }) { |
| | | console.log('handleOccTimeConfirm', value) |
| | | model.occTime = formatDate(new Date(value)) |
| | | } |
| | | |
| | | /** |
| | | * 选择报修类型 |
| | | */ |
| | | function handleConfirmReqType({ value }) { |
| | | } |
| | | function handleConfirmReqType({ value }) {} |
| | | |
| | | /** |
| | | * 选择故障类别 |
| | | */ |
| | | function handleConfirmFaultType({ value }) { |
| | | } |
| | | function handleConfirmFaultType({ value }) {} |
| | | |
| | | /** |
| | | * 选择紧急程度 |
| | | */ |
| | | function handleConfirmUrgencyLevel({ value }) { |
| | | } |
| | | function handleConfirmUrgencyLevel({ value }) {} |
| | | |
| | | async function initData() { |
| | | const reqTypeList = await getDictInfo(DICT_REPAIR_REQ_TYPE) |
| | |
| | | const uList = await getDictInfo(DICT_REPAIR_URGENCY_LEVEL) |
| | | urgencyList.value = uList |
| | | } |
| | | |
| | | onNavigationBarButtonTap((e) => { |
| | | if (e.index === 0) { |
| | | handleSubmit() |
| | | } |
| | | }) |
| | | |
| | | onLoad((options) => { |
| | | Object.assign(option, options) |