Browse Source

新需求开发

master
ljlong_2630 4 months ago
parent
commit
77c4bc6a39
  1. 13
      src/api/repairRelation.ts
  2. 7
      src/pages.json
  3. 72
      src/pages/overhaulOrder/addForm.vue
  4. 24
      src/pages/overhaulOrder/addSubItem.vue
  5. 62
      src/pages/overhaulOrder/customModal.vue
  6. 23
      src/pages/overhaulOrder/reqairOrderList.vue
  7. 62
      src/pages/repairOrder/customModal.vue
  8. 153
      src/pages/repairOrder/detail.vue
  9. 46
      src/pages/repairOrder/index.vue
  10. 347
      src/pages/spotCheckOrder/addForm.vue
  11. 5
      src/pages/spotCheckOrder/detail.vue

13
src/api/repairRelation.ts

@ -0,0 +1,13 @@
import http from './http'
// 维修工单点检项关系查询
export function getRepairRelationNoPage(params) {
return http.get('/inspection/repair-relation/noPage',{params})
}
// 删除点检项和报修工单关系
export function deleteBatchByIds(ids: number[]) {
return http.delete(`/inspection/repair-relation/deleteBatchByIds?ids=` + ids)
}

7
src/pages.json

@ -272,6 +272,13 @@
{ {
"navigationBarTitleText" : "" "navigationBarTitleText" : ""
} }
},
{
"path" : "pages/repairOrder/customModal",
"style" :
{
"navigationBarTitleText" : ""
}
} }
], ],
"tabBar": { "tabBar": {

72
src/pages/overhaulOrder/addForm.vue

@ -46,6 +46,16 @@
<u-form-item label="所属厂区" prop="factoryAreaName" class="disabled"> <u-form-item label="所属厂区" prop="factoryAreaName" class="disabled">
<u-input v-model="form.factoryAreaName" placeholder="请输入所属厂区" disabled /> <u-input v-model="form.factoryAreaName" placeholder="请输入所属厂区" disabled />
</u-form-item> </u-form-item>
<u-form-item label="工单来源" prop="sourceType" class="disabled">
<view class="select" disabled>
<view class="input" v-if='form.sourceType'>
{{form.sourceTypeName}}
</view>
<view class="placeholder" v-else>
{{`请选择工单来源`}}
</view>
</view>
</u-form-item>
<u-form-item label="故障类型" prop="faultType" required> <u-form-item label="故障类型" prop="faultType" required>
<view class="select" @click="openSingleColumn('faultType',form.faultType,faultType)"> <view class="select" @click="openSingleColumn('faultType',form.faultType,faultType)">
<view class="input" v-if='form.faultType'> <view class="input" v-if='form.faultType'>
@ -81,7 +91,7 @@
<view class="title-txt"> <view class="title-txt">
{{item.name}} {{item.name}}
</view> </view>
<view class="" @click.stop="delService(item)"> <view v-if="!item.name_hide_delete" class="" @click.stop="delService(item)">
<u-icon name="trash" color="#aaaaaa" size="40"></u-icon> <u-icon name="trash" color="#aaaaaa" size="40"></u-icon>
</view> </view>
</view> </view>
@ -93,14 +103,14 @@
<view>预估分钟</view> <view>预估分钟</view>
<view>{{item.estimatedMinutes}}分钟</view> <view>{{item.estimatedMinutes}}分钟</view>
</view> </view>
<view class="dec2">
<view>实际分钟</view>
<view>{{item.actualMinutes}}分钟</view>
</view>
<view class="dec2"> <view class="dec2">
<view>责任人</view> <view>责任人</view>
<view>{{item.chargePeoplesName}}</view> <view>{{item.chargePeoplesName}}</view>
</view> </view>
<!-- <view class="dec2">
<view>实际分钟</view>
<view>{{item.actualMinutes}}分钟</view>
</view>
<view class="dec2"> <view class="dec2">
<view>完成情况</view> <view>完成情况</view>
<view> <view>
@ -134,7 +144,7 @@
数量{{cur.qty}} 数量{{cur.qty}}
</view> </view>
</view> </view>
</view> </view> -->
</view> </view>
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> --> <!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> -->
</view> </view>
@ -190,6 +200,7 @@
import * as repairOrderApi from "@/api/repairOrder" import * as repairOrderApi from "@/api/repairOrder"
import * as deviceApi from "@/api/device" import * as deviceApi from "@/api/device"
import * as deptApi from "@/api/dept" import * as deptApi from "@/api/dept"
import * as repairRelationApi from "@/api/repairRelation"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const loading = ref(false) const loading = ref(false)
@ -205,7 +216,9 @@
deviceNumber: '', deviceNumber: '',
faultTypeName: '', faultTypeName: '',
maintenance:'', maintenance:'',
subList: [] subList: [],
sourceType: '',
sourceTypeName: ''
}) })
@ -222,6 +235,7 @@
const isShowSelecUser = ref(false) const isShowSelecUser = ref(false)
const chooseUserInfo = ref(null) const chooseUserInfo = ref(null)
const serviceList = ref([]) const serviceList = ref([])
const sourceType = ref()
const list = ref([{ const list = ref([{
name: '检修内容' name: '检修内容'
}]) }])
@ -248,6 +262,24 @@
proxy.$modal.showToast('请选择维修人员') proxy.$modal.showToast('请选择维修人员')
return; return;
} }
for (let item of serviceList.value) {
if (item.name_hide_delete) {
if (!item.peoples) {
proxy.$modal.showToast('*'+item.name+'*的检修项的【预估人数】不能为空');
return; //
}
if (!item.estimatedMinutes) {
proxy.$modal.showToast('*'+item.name+'*的检修项的【预估分钟】不能为空');
return; //
}
if (!item.chargePeoples) {
proxy.$modal.showToast('*'+item.name+'*的检修项的【责任人】不能为空');
return; //
}
}
}
const data = { const data = {
id: form.value && form.value.id ? form.value.id : '', id: form.value && form.value.id ? form.value.id : '',
describes: form.value.describes, describes: form.value.describes,
@ -325,7 +357,10 @@
deviceNumber:'', deviceNumber:'',
faultTypeName:'', faultTypeName:'',
maintenance:'', maintenance:'',
subList: [] subList: [],
sourceType: '',
sourceTypeName: ''
} }
isDisabled.value = false isDisabled.value = false
} }
@ -444,6 +479,7 @@
isDisabled.value = form.value.maintenanceNumber || form.value.id ? true : false isDisabled.value = form.value.maintenanceNumber || form.value.id ? true : false
}; };
faultType.value = await dictApi.getDict('fault_type') faultType.value = await dictApi.getDict('fault_type')
sourceType.value = await dictApi.getDict('order_source_type')
uni.$on('chooseOrder', data => { uni.$on('chooseOrder', data => {
if (data) { if (data) {
form.value.maintenanceNumber = data.number form.value.maintenanceNumber = data.number
@ -453,6 +489,7 @@
form.value.factoryAreaName = data.factoryAreaName form.value.factoryAreaName = data.factoryAreaName
form.value.factoryAreaNumber = data.factoryAreaNumber form.value.factoryAreaNumber = data.factoryAreaNumber
form.value.subList= data.subList form.value.subList= data.subList
form.value.sourceType=data.sourceType
isDisabled.value = true isDisabled.value = true
} else { } else {
form.value.maintenanceNumber = '' form.value.maintenanceNumber = ''
@ -462,16 +499,27 @@
form.value.factoryAreaName = '' form.value.factoryAreaName = ''
form.value.factoryAreaNumber = '' form.value.factoryAreaNumber = ''
form.value.subList= [] form.value.subList= []
form.value.sourceType='0'
isDisabled.value = false isDisabled.value = false
} }
form.value.sourceTypeName = sourceType.value.find(item=>item.value == form.value.sourceType).label
if(form.value.sourceType == '1'){
repairRelationApi.getRepairRelationNoPage({repairNumber:form.value.maintenanceNumber}).then(response=>{
serviceList.value = response.data.map(item=>{
return {
name: item.spotInspectionName,
name_hide_delete: true,
}
})
})
}
}) })
// //
uni.$on('handleSubmitForm', (formData) => { uni.$on('handleSubmitForm', (formData) => {
// serviceList // serviceList
if (formData.id) { if (formData.name_hide_delete) {
// //
const index = serviceList.value.findIndex(item => item.id === formData.id); const index = serviceList.value.findIndex(item => item.name === formData.name);
if (index !== -1) { if (index !== -1) {
serviceList.value.splice(index, 1, formData); serviceList.value.splice(index, 1, formData);
} }
@ -606,6 +654,7 @@
font-size: 28rpx; font-size: 28rpx;
margin-top: 6rpx; margin-top: 6rpx;
color: #acacac; color: #acacac;
padding: 3rpx 30rpx;
uni-view { uni-view {
display: inline-block; display: inline-block;
} }
@ -768,7 +817,6 @@
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
border-bottom: 1px solid #e4e4e4; border-bottom: 1px solid #e4e4e4;
display: flex; display: flex;
.title-txt { .title-txt {
color: #409eff; color: #409eff;
font-size: 30rpx; font-size: 30rpx;

24
src/pages/overhaulOrder/addSubItem.vue

@ -11,10 +11,7 @@
<u-form-item label="预估分钟" prop="estimatedMinutes" required> <u-form-item label="预估分钟" prop="estimatedMinutes" required>
<u-input v-model="form.estimatedMinutes" type="number" placeholder="请输入预估分钟" maxlength="50" /> <u-input v-model="form.estimatedMinutes" type="number" placeholder="请输入预估分钟" maxlength="50" />
</u-form-item> </u-form-item>
<u-form-item label="实际分钟" prop="actualMinutes"> <u-form-item label="责任人" prop="chargePeoples" required>
<u-input v-model="form.actualMinutes" type="number" placeholder="请输入实际分钟" maxlength="50" />
</u-form-item>
<u-form-item label="责任人" prop="chargePeoples" >
<view class="select" @click="openSelecUser"> <view class="select" @click="openSelecUser">
<view class="input" v-if='form.chargePeoples'> <view class="input" v-if='form.chargePeoples'>
{{selectFormatCheck(form.chargePeoples,selecUserList)}} {{selectFormatCheck(form.chargePeoples,selecUserList)}}
@ -25,6 +22,9 @@
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> <u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view> </view>
</u-form-item> </u-form-item>
<!-- <u-form-item label="实际分钟" prop="actualMinutes">
<u-input v-model="form.actualMinutes" type="number" placeholder="请输入实际分钟" maxlength="50" />
</u-form-item>
<u-form-item label="完成情况" prop="status" > <u-form-item label="完成情况" prop="status" >
<view class="select" @click="openSingleColumn('status',form.status,jxDetailsStatus,'form')"> <view class="select" @click="openSingleColumn('status',form.status,jxDetailsStatus,'form')">
<view class="input" v-if='form.status'> <view class="input" v-if='form.status'>
@ -52,11 +52,11 @@
</u-form-item> </u-form-item>
<u-form-item label="工程师确认" prop="engineer"> <u-form-item label="工程师确认" prop="engineer">
<u-input v-model="form.engineer" placeholder="请输入工程师确认" maxlength="50" /> <u-input v-model="form.engineer" placeholder="请输入工程师确认" maxlength="50" />
</u-form-item> </u-form-item> -->
</u-form> </u-form>
<view class="list"> <!-- <view class="list">
<view class="title"> <view class="title">
<span></span>备件 <span></span>备件
</view> </view>
@ -83,7 +83,7 @@
<u-button type="primary" @click="open"><u-icon name="plus-circle" color="#ffffff" <u-button type="primary" @click="open"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>添加备件</u-button> size="36"></u-icon>添加备件</u-button>
</view> </view>
</view> </view> -->
<view class="footer"> <view class="footer">
<view class="btns"> <view class="btns">
<button class="reset" @click="reset">重置</button> <button class="reset" @click="reset">重置</button>
@ -175,6 +175,7 @@
estimatedMinutes: '', estimatedMinutes: '',
actualMinutes: '', actualMinutes: '',
chargePeoples: '', chargePeoples: '',
chargePeoplesName : '',
status:null, status:null,
completionTime: '', completionTime: '',
engineer: '', engineer: '',
@ -230,6 +231,10 @@
proxy.$modal.showToast('预估人数请输入正整数') proxy.$modal.showToast('预估人数请输入正整数')
return; return;
} }
if (!form.value.chargePeoples) {
proxy.$modal.showToast('请输入责任人')
return;
}
if (form.value.peoples > 100) { if (form.value.peoples > 100) {
proxy.$modal.showToast('预估人数不得超出100') proxy.$modal.showToast('预估人数不得超出100')
return; return;
@ -276,6 +281,7 @@
form.value.estimatedMinutes = '' form.value.estimatedMinutes = ''
form.value.actualMinutes = '' form.value.actualMinutes = ''
form.value.chargePeoples = '' form.value.chargePeoples = ''
form.value.chargePeoplesName = ''
form.value.status = null form.value.status = null
form.value.completionTime = '' form.value.completionTime = ''
form.value.engineer = '' form.value.engineer = ''
@ -317,6 +323,7 @@
function selectFormatCheck(val, array) { function selectFormatCheck(val, array) {
const arr = val.split(',').map(Number) const arr = val.split(',').map(Number)
let str = array.filter(item => arr.includes(item.id)).map(item => item.name).join(',') let str = array.filter(item => arr.includes(item.id)).map(item => item.name).join(',')
form.value.chargePeoplesName = str
return str return str
} }
// //
@ -451,8 +458,7 @@
if (option.factoryAreaNumber) factoryAreaNumber.value = option.factoryAreaNumber; if (option.factoryAreaNumber) factoryAreaNumber.value = option.factoryAreaNumber;
if (option.number) form.value.number = option.number; if (option.number) form.value.number = option.number;
if (option.deviceNumber) form.value.deviceNumber = option.deviceNumber; if (option.deviceNumber) form.value.deviceNumber = option.deviceNumber;
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option if (option.data && JSON.parse(decodeURIComponent(option.data))) {
.data)).id) {
form.value = JSON.parse(decodeURIComponent(option.data)) form.value = JSON.parse(decodeURIComponent(option.data))
form.value.itemNumbers = form.value.items form.value.itemNumbers = form.value.items
formatDate.value = form.value.completionTime ? proxy.$time.formatDate(form.value.completionTime) : '' formatDate.value = form.value.completionTime ? proxy.$time.formatDate(form.value.completionTime) : ''

62
src/pages/overhaulOrder/customModal.vue

@ -0,0 +1,62 @@
<template>
<div v-if="visible" class="modal-overlay" @click="close">
<div class="modal-content" @click.stop>
<div class="modal-body">
<p>{{ content }}</p>
</div>
<div class="modal-footer">
<button @click="close">关闭</button>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
content: {
type: String,
required: true
},
visible: {
type: Boolean,
required: true
}
},
methods: {
close() {
this.$emit('update:visible', false);
}
}
};
</script>
<style scoped>
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}
.modal-content {
background: white;
padding: 20px;
border-radius: 5px;
max-width: 500px;
width: 100%;
}
.modal-body {
margin-bottom: 20px;
}
.modal-footer {
text-align: right;
}
</style>

23
src/pages/overhaulOrder/reqairOrderList.vue

@ -6,8 +6,8 @@
<u-checkbox v-model="item.checked" shape="circle" style="margin-top: 8rpx;"></u-checkbox> <u-checkbox v-model="item.checked" shape="circle" style="margin-top: 8rpx;"></u-checkbox>
<view class="right"> <view class="right">
<view class="title"> <view class="title">
<view class="title-txt"> <view class="title-txt" @click="showFullDescription(item.describes, $event)">
{{item.describes}} <span class="ellipsis">{{item.describes}}</span>
</view> </view>
<u-tag text="待接单" v-if="item.status == 'PENDING'" bg-color='rgba(255,255,255,0)' color='#fe8463' <u-tag text="待接单" v-if="item.status == 'PENDING'" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle' /> border-color='#fe8463' type="primary" shape='circle' />
@ -53,6 +53,8 @@
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view> </view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
<!-- 自定义模态框 -->
<CustomModal :content="dialogContent" :visible="dialogVisible" @update:visible="dialogVisible = $event" />
</view> </view>
</template> </template>
@ -66,10 +68,13 @@
} from 'vue' } from 'vue'
import * as repairOrderApi from "@/api/repairOrder" import * as repairOrderApi from "@/api/repairOrder"
import CustomModal from './customModal.vue'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const repairOrderList = ref([]) const repairOrderList = ref([])
const type = ref('') const type = ref('')
const dialogVisible = ref(false)
const dialogContent = ref('')
// //
function getList() { function getList() {
@ -97,6 +102,13 @@
uni.$emit('chooseOrder',data) uni.$emit('chooseOrder',data)
proxy.$tab.navigateBack() proxy.$tab.navigateBack()
} }
const showFullDescription = (description, event) => {
dialogContent.value = description
dialogVisible.value = true
if (event) {
event.stopPropagation();
}
}
onLoad((option) => { onLoad((option) => {
if (option.type) type.value = option.type; if (option.type) type.value = option.type;
getList() getList()
@ -133,6 +145,13 @@
width: 0px; width: 0px;
flex: 1; flex: 1;
word-wrap: break-word; word-wrap: break-word;
.ellipsis {
display: block;
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
} }
.time { .time {

62
src/pages/repairOrder/customModal.vue

@ -0,0 +1,62 @@
<template>
<div v-if="visible" class="modal-overlay" @click="close">
<div class="modal-content" @click.stop>
<div class="modal-body">
<p>{{ content }}</p>
</div>
<div class="modal-footer">
<button @click="close">关闭</button>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
content: {
type: String,
required: true
},
visible: {
type: Boolean,
required: true
}
},
methods: {
close() {
this.$emit('update:visible', false);
}
}
};
</script>
<style scoped>
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}
.modal-content {
background: white;
padding: 20px;
border-radius: 5px;
max-width: 500px;
width: 100%;
}
.modal-body {
margin-bottom: 20px;
}
.modal-footer {
text-align: right;
}
</style>

153
src/pages/repairOrder/detail.vue

@ -229,22 +229,42 @@
</view> </view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view> </view>
<!-- 完成类型 -->
<u-popup v-model="isShowSuccess" mode="center" border-radius="14"> <u-popup v-model="isShowSuccess" mode="center" border-radius="14">
<view class="popup-title">完成类型</view> <view class="popup-title">完成类型</view>
<view class="popup"> <view class="popup">
<u-radio-group v-model="result" @change="radioGroupChange"> <div class="form-item">
<u-radio v-for="(item, index) in orderCompleteResult" :key="index" :name="item.value"> <label class="form-label">完成方式</label>
{{item.label}} <u-radio-group v-model="result" @change="radioGroupChange" class="radio-group">
</u-radio> <u-radio v-for="(item, index) in orderCompleteResult" :key="index" :name="item.value" class="radio-item">
</u-radio-group> {{ item.label }}
</view> </u-radio>
<view class="popup-footer"> </u-radio-group>
<view @click="isShowSuccess = false">取消</view> </div>
<view class="sure" @click="orderClickFinish">确认</view> </view>
<!-- 多选列表 -->
<view v-if="isShowMultiSelect" class="multi-select">
<div class="form-item">
<label class="form-label">点检问题完成项</label>
<div class="scroll-container">
<u-checkbox-group @change="selectedOptionsChange" class="checkbox-group">
<u-checkbox
v-model="item.checked"
v-for="(item, index) in options"
:key="index"
:name="item.value"
class="checkbox-item"
>
<span class="checkbox-label">{{ item.label }}</span>
</u-checkbox>
</u-checkbox-group>
</div>
</div>
</view> </view>
<view class="popup-footer">
<view @click="isShowSuccess = false">取消</view>
<view class="sure" @click="orderClickFinish">确认</view>
</view>
</u-popup> </u-popup>
<!-- 验证完结--> <!-- 验证完结-->
<u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14"> <u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">验证完结意见</view> <view class="popup-title">验证完结意见</view>
@ -287,6 +307,7 @@
import * as dictApi from "@/api/dict" import * as dictApi from "@/api/dict"
import * as repairOrderApi from "@/api/repairOrder" import * as repairOrderApi from "@/api/repairOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
import * as repairRelationApi from "@/api/repairRelation"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// store // store
@ -326,6 +347,9 @@
const field = ref('') const field = ref('')
const maintenanceShift = ref([]) // const maintenanceShift = ref([]) //
const faultType = ref([]) // const faultType = ref([]) //
const isShowMultiSelect = ref(false)
const options = ref([])
const selectedOptions = ref([])
function change(index) { function change(index) {
current.value = index current.value = index
changeItem.value = list.value[current.value] changeItem.value = list.value[current.value]
@ -368,8 +392,39 @@
return; return;
} }
} }
isShowSuccess.value = true
// result
if (result.value == 'TEMPORARILY') {
fetchOptions();
}else{
isShowMultiSelect.value =false;
}
isShowSuccess.value = true
} }
function fetchOptions() {
//
const tempParams = {
deviceNumber: data.value.deviceNumber,
type: data.value.type,
repairNumber: data.value.number,
};
repairRelationApi.getRepairRelationNoPage(tempParams).then(res=>{
options.value = res.data.map(element => {
return {
value: element.id,
label: element.spotInspectionName
};
})
if(options.value.length > 0){
isShowMultiSelect.value = true;
}else{
isShowMultiSelect.value =false;
}
});
}
/** /**
* 维修确认点击时间 * 维修确认点击时间
*/ */
@ -392,6 +447,15 @@
function radioGroupChange(e) { function radioGroupChange(e) {
result.value = e result.value = e
if (e == 'TEMPORARILY') {
fetchOptions();
}else{
isShowMultiSelect.value =false;
}
}
function selectedOptionsChange(e){
selectedOptions.value = e
} }
// //
async function orderClickFinish() { async function orderClickFinish() {
@ -415,7 +479,9 @@
faultType: data.value.faultType faultType: data.value.faultType
} }
// //
await repairOrderApi.repairOrderUpdate(dataTwo, type.value).then((res) => { }).catch(() => { await repairOrderApi.repairOrderUpdate(dataTwo, type.value).then((res) => {
}).catch(() => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
loading.value = false loading.value = false
}) })
@ -423,6 +489,12 @@
loading.value = true loading.value = true
await repairOrderApi.orderClickFinish(dataOne, type.value).then((res) => { await repairOrderApi.orderClickFinish(dataOne, type.value).then((res) => {
if (res.data) { if (res.data) {
if(result.value != 'TEMPORARILY') {
selectedOptions.value = options.value.map(option=>option.value)
}
if(selectedOptions.value.length>0){
repairRelationApi.deleteBatchByIds(selectedOptions.value)
}
proxy.$modal.showToast('操作成功') proxy.$modal.showToast('操作成功')
setTimeout(() => { setTimeout(() => {
proxy.$tab.navigateBack() proxy.$tab.navigateBack()
@ -1021,4 +1093,55 @@
} }
} }
.multi-select {
display: flex;
flex-direction: column;
align-items: flex-start; /* 左对齐 */
margin-top: 10px;
padding: 0 1.875rem 0;
}
.form-item {
display: flex;
flex-direction: column;
align-items: flex-start; /* 标签左对齐 */
margin-top: 10px;
}
.form-label {
margin-bottom: 5px;
}
.scroll-container {
max-height: 200px; /* 根据需要调整 */
overflow-y: auto;
width: 100%;
}
.radio-group,
.checkbox-group {
display: flex;
flex-direction: column;
align-items: center; /* 内容居中 */
width: 100%;
padding: 0 20px;
}
.radio-item,
.checkbox-item {
display: flex;
align-items: center; /* 复选框和内容在同一行 */
width: 100%;
padding: 5px 0;
}
.checkbox-label {
display: inline-block;
max-width: 150px; /* 根据需要调整 */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-left: 8px; /* 调整复选框与文本之间的距离 */
vertical-align: middle;
}
</style> </style>

46
src/pages/repairOrder/index.vue

@ -11,8 +11,8 @@
<view class="item" v-for="(item,index) in list" :key="index" > <view class="item" v-for="(item,index) in list" :key="index" >
<view class="" @click="itemClick(item,index)"> <view class="" @click="itemClick(item,index)">
<view class="title"> <view class="title">
<view class="title-txt"> <view class="title-txt" @click="showFullDescription(item.describes, $event)">
{{item.describes}} <span class="ellipsis">{{item.describes}}</span>
</view> </view>
<u-tag text="待接单" v-if="item.status == 'PENDING'" bg-color='rgba(255,255,255,0)' color='#fe8463' border-color='#fe8463' type="primary" shape='circle'/> <u-tag text="待接单" v-if="item.status == 'PENDING'" bg-color='rgba(255,255,255,0)' color='#fe8463' border-color='#fe8463' type="primary" shape='circle'/>
<u-tag text="已撤回" v-else-if="item.status=='REJECTED'" bg-color='rgba(255,255,255,0)' color='#d7d7d7' border-color='#d7d7d7 ' type="warning" shape='circle'/> <u-tag text="已撤回" v-else-if="item.status=='REJECTED'" bg-color='rgba(255,255,255,0)' color='#d7d7d7' border-color='#d7d7d7 ' type="warning" shape='circle'/>
@ -55,6 +55,8 @@
<u-loadmore :status="status" v-if="status != 'loadmore'" /> <u-loadmore :status="status" v-if="status != 'loadmore'" />
</view> </view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
<!-- 自定义模态框 -->
<CustomModal :content="dialogContent" :visible="dialogVisible" @update:visible="dialogVisible = $event" />
</view> </view>
</template> </template>
@ -71,6 +73,7 @@
} from 'vue' } from 'vue'
import * as repairOrderApi from "@/api/repairOrder" import * as repairOrderApi from "@/api/repairOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
import CustomModal from './customModal.vue'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// store // store
@ -82,6 +85,8 @@
}) })
const status = ref('loadmore') // const status = ref('loadmore') //
const list = ref([]) const list = ref([])
const dialogVisible = ref(false)
const dialogContent = ref('')
function itemClick(item, index) { function itemClick(item, index) {
proxy.$tab.navigateTo(`/pages/repairOrder/detail?type=${params.value.type}&number=${item.number}`) proxy.$tab.navigateTo(`/pages/repairOrder/detail?type=${params.value.type}&number=${item.number}`)
} }
@ -124,6 +129,13 @@
onReachBottom(() => { onReachBottom(() => {
getList() getList()
}) })
const showFullDescription = (description, event) => {
dialogContent.value = description
dialogVisible.value = true
if (event) {
event.stopPropagation();
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -134,17 +146,14 @@
.list { .list {
background: #f5f5f5; background: #f5f5f5;
margin-top: 20rpx; margin-top: 20rpx;
.item { .item {
padding: 30rpx 30rpx 0px 30rpx; padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx; margin-top: 20rpx;
background: white; background: white;
.title { .title {
display: flex; display: flex;
align-items: center; align-items: center;
padding-bottom: 20rpx; padding-bottom: 20rpx;
.title-txt { .title-txt {
color: #409eff; color: #409eff;
font-weight: bold; font-weight: bold;
@ -153,76 +162,66 @@
flex: 1; flex: 1;
word-wrap: break-word; word-wrap: break-word;
} }
.time { .time {
color: #919191; color: #919191;
} }
} }
.dec { .dec {
padding-bottom: 20rpx; padding-bottom: 20rpx;
span { span {
color: #999999; color: #999999;
} }
} }
.last { .last {
padding-bottom: 30rpx; padding-bottom: 30rpx;
} }
.bottom { .bottom {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
border-top: 1px solid #E4E4E4; border-top: 1px solid #E4E4E4;
padding: 20rpx 0px; padding: 20rpx 0px;
} }
} }
} }
.list { .list {
background: #f5f5f5; background: #f5f5f5;
margin-top: 20rpx; margin-top: 20rpx;
.item { .item {
padding: 30rpx 30rpx 0px 30rpx; padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx; margin-top: 20rpx;
background: white; background: white;
.title { .title {
display: flex; display: flex;
align-items: center; align-items: center;
padding-bottom: 20rpx; padding-bottom: 20rpx;
.title-txt { .title-txt {
color: #409eff; color: #409eff;
font-weight: bold; font-weight: bold;
font-size: 36rpx; font-size: 36rpx;
width: 0px; width: 0px;
flex: 1; flex: 1;
.ellipsis {
display: block;
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
} }
.time { .time {
color: #919191; color: #919191;
} }
} }
.dec { .dec {
padding-bottom: 20rpx; padding-bottom: 20rpx;
span { span {
color: #999999; color: #999999;
} }
} }
.last { .last {
padding-bottom: 30rpx; padding-bottom: 30rpx;
} }
.bottom { .bottom {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -230,13 +229,10 @@
border-top: 1px solid #E4E4E4; border-top: 1px solid #E4E4E4;
padding: 20rpx 0px; padding: 20rpx 0px;
position: relative; position: relative;
.button { .button {
position: absolute; position: absolute;
right: 0rpx; right: 0rpx;
} }
} }
} }
} }

347
src/pages/spotCheckOrder/addForm.vue

@ -65,7 +65,17 @@
</u-radio-group> </u-radio-group>
</view> </view>
<view class="dec">
<view class="">
<span v-if="item.numberNeedSwitch" class="required">*</span>
巡检点检记录:
</view>
<u-input
v-model="item.records"
:placeholder="'请输入巡检点检记录'"
:class="{'error': item.numberNeedSwitch && !item.records}"
/>
</view>
<!-- <view class="dec"> <!-- <view class="dec">
<view style="margin-right: 20rpx;">是否符合:</view> <view style="margin-right: 20rpx;">是否符合:</view>
<input type="radio" v-model="item.isConform1" value="true"> <input type="radio" v-model="item.isConform1" value="true">
@ -186,67 +196,82 @@
subList.value = res.data subList.value = res.data
subList.value.forEach(item => { subList.value.forEach(item => {
item.isConform = 'TRUE' item.isConform = 'TRUE'
item.records = ''
}) })
} else { } else {
proxy.$modal.showToast(`找不到该${type.value == 'DEVICE' ? '设备' : '模具'}`) proxy.$modal.showToast(`找不到该${type.value == 'DEVICE' ? '设备' : '模具'}`)
} }
}).catch(() => { }) }).catch(() => { })
} }
// //
function submit() { function submit() {
// //
if (!form.value.describes) { if (!form.value.describes) {
proxy.$modal.showToast('请输入点检描述') proxy.$modal.showToast('请输入点检描述');
return; return;
} }
if (!form.value.deviceNumber) { if (!form.value.deviceNumber) {
proxy.$modal.showToast(`请输入${type.value == 'DEVICE' ? '设备' : '模具'}编码`) proxy.$modal.showToast(`请输入${type.value == 'DEVICE' ? '设备' : '模具'}编码`);
return; return;
} }
if (!form.value.classes) { if (!form.value.classes) {
proxy.$modal.showToast('请选择班次') proxy.$modal.showToast('请选择班次');
return; return;
} }
if (subList.value.length == 0) { if (subList.value.length == 0) {
proxy.$modal.showToast('该设备无检修项目') proxy.$modal.showToast('该设备无检修项目');
return; return;
} }
// subList.value.forEach(item=>{
// item.isConform = !item.isConform1 ? 'FALSE' : 'TRUE' // subList
// }) let hasError = false;
const data = { subList.value.forEach(item => {
describes: form.value.describes, if (item.numberNeedSwitch && !item.records) {
deviceNumber: form.value.deviceNumber, hasError = true;
maintenances: form.value.maintenances, item.error = true; //
classes: form.value.classes, } else {
subList: subList.value, item.error = false; //
type: type.value }
} });
proxy.$modal.confirm('是否添加点检工单').then(() => {
proxy.$modal.loading('加载中') if (hasError) {
loading.value = true proxy.$modal.showToast('请填写所有必填的巡检点检记录');
spotCheckOrderApi.spotCheckOrderCreate(data, type.value).then((res) => { return;
proxy.$modal.closeLoading() }
if (res.data) {
proxy.$modal.showToast('添加成功') const data = {
setTimeout(() => { describes: form.value.describes,
proxy.$tab.navigateBack() deviceNumber: form.value.deviceNumber,
loading.value = false maintenances: form.value.maintenances,
}, 1500) classes: form.value.classes,
} else { subList: subList.value,
if (res.msg) { type: type.value
proxy.$modal.showToast(res.msg) };
} else {
proxy.$modal.showToast('添加失败') proxy.$modal.confirm('是否添加点检工单').then(() => {
} proxy.$modal.loading('加载中');
loading.value = false loading.value = true;
} spotCheckOrderApi.spotCheckOrderCreate(data, type.value).then((res) => {
}).catch(() => { proxy.$modal.closeLoading();
proxy.$modal.closeLoading() if (res.data) {
loading.value = false proxy.$modal.showToast('添加成功');
}) setTimeout(() => {
}) proxy.$tab.navigateBack();
loading.value = false;
}, 1500);
} else {
if (res.msg) {
proxy.$modal.showToast(res.msg);
} else {
proxy.$modal.showToast('添加失败');
}
loading.value = false;
}
}).catch(() => {
proxy.$modal.closeLoading();
loading.value = false;
});
});
} }
// //
function reset() { function reset() {
@ -290,118 +315,102 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.add-form-container { .add-form-container {
min-height: calc(100vh - 140rpx); min-height: calc(100vh - 140rpx);
background: white; background: white;
padding: 0px 0rpx 140rpx; padding: 0px 0rpx 140rpx;
} }
.u-form-item {
.u-form-item { padding: 20rpx 30rpx;
padding: 20rpx 30rpx; }
} .disabled {
background: #f5f5f5;
.disabled { }
background: #f5f5f5; .list {
} padding: 30rpx 30rpx;
.item {
.list { display: flex;
padding: 30rpx 30rpx; margin-bottom: 20rpx;
.item-box {
.item { background: #F5F5F5;
display: flex; border-radius: 12rpx;
margin-bottom: 20rpx; flex: 1;
width: 0rpx;
.item-box { }
background: #F5F5F5; .spare-title {
border-radius: 12rpx; padding: 20rpx 30rpx;
flex: 1; border-bottom: 1px solid #e4e4e4;
width: 0rpx; .title-txt {
} color: #409eff;
font-size: 30rpx;
.spare-title { font-weight: bold;
padding: 20rpx 30rpx; }
border-bottom: 1px solid #e4e4e4; }
.dec {
.title-txt { color: #9c9c9c;
color: #409eff; padding: 20rpx 30rpx 20rpx;
font-size: 30rpx; display: flex;
font-weight: bold; align-items: center;
} .required {
} color: red;
margin-right: 5rpx;
.dec { }
color: #9c9c9c; .error {
padding: 20rpx 30rpx 20rpx; border: 1px solid red !important;
display: flex; }
align-items: center; }
} }
}
} .select {
} display: flex;
align-items: center;
height: 72rpx;
.select { width: 100%;
display: flex; .input {
align-items: center; flex: 1;
height: 72rpx; font-size: 28rpx;
width: 100%; color: #000000;
}
.input { .placeholder {
flex: 1; flex: 1;
font-size: 28rpx; font-size: 28rpx;
color: #000000; color: rgb(192, 196, 204);
} }
}
.placeholder { .footer {
flex: 1; position: fixed;
font-size: 28rpx; bottom: 0px;
color: rgb(192, 196, 204); left: 0px;
width: 100%;
} }
} .btns {
display: flex;
.footer { button {
position: fixed; flex: 1;
bottom: 0px; }
left: 0px; .sure {
width: 100%; background: #409eff;
} color: white;
border-radius: 0px;
.btns { &::after {
display: flex; border: 1px solid #409eff;
border-radius: 0px;
}
button { }
flex: 1; .reset {
} background: #F5F5F5;
border-radius: 0px;
.sure { &::after {
background: #409eff; border-radius: 0px;
color: white; }
border-radius: 0px; }
}
&::after { .right-button {
border: 1px solid #409eff; background: #409eff;
border-radius: 0px; color: white;
} padding: 0rpx 30rpx;
} border-radius: 16rpx;
text-align: center;
.reset { font-size: 28rpx;
background: #F5F5F5; }
border-radius: 0px;
&::after {
border-radius: 0px;
}
}
}
.right-button {
background: #409eff;
color: white;
padding: 0rpx 30rpx;
border-radius: 16rpx;
text-align: center;
font-size: 28rpx;
}
</style> </style>

5
src/pages/spotCheckOrder/detail.vue

@ -80,6 +80,11 @@
是否符合: {{item.isConform=='TRUE'?'符合':'不符合'}} 是否符合: {{item.isConform=='TRUE'?'符合':'不符合'}}
</view> </view>
</view> </view>
<view class="dec">
<view class="">
巡检点检记录: {{item.records}}
</view>
</view>
<!-- <view class="dec"> <!-- <view class="dec">
<view style="margin-right: 20rpx;">是否符合:</view> <view style="margin-right: 20rpx;">是否符合:</view>

Loading…
Cancel
Save