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. 133
      src/pages/repairOrder/detail.vue
  9. 46
      src/pages/repairOrder/index.vue
  10. 105
      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" : ""
}
},
{
"path" : "pages/repairOrder/customModal",
"style" :
{
"navigationBarTitleText" : ""
}
}
],
"tabBar": {

72
src/pages/overhaulOrder/addForm.vue

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

24
src/pages/overhaulOrder/addSubItem.vue

@ -11,10 +11,7 @@
<u-form-item label="预估分钟" prop="estimatedMinutes" required>
<u-input v-model="form.estimatedMinutes" type="number" placeholder="请输入预估分钟" maxlength="50" />
</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="chargePeoples" >
<u-form-item label="责任人" prop="chargePeoples" required>
<view class="select" @click="openSelecUser">
<view class="input" v-if='form.chargePeoples'>
{{selectFormatCheck(form.chargePeoples,selecUserList)}}
@ -25,6 +22,9 @@
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</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" >
<view class="select" @click="openSingleColumn('status',form.status,jxDetailsStatus,'form')">
<view class="input" v-if='form.status'>
@ -52,11 +52,11 @@
</u-form-item>
<u-form-item label="工程师确认" prop="engineer">
<u-input v-model="form.engineer" placeholder="请输入工程师确认" maxlength="50" />
</u-form-item>
</u-form-item> -->
</u-form>
<view class="list">
<!-- <view class="list">
<view class="title">
<span></span>备件
</view>
@ -83,7 +83,7 @@
<u-button type="primary" @click="open"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>添加备件</u-button>
</view>
</view>
</view> -->
<view class="footer">
<view class="btns">
<button class="reset" @click="reset">重置</button>
@ -175,6 +175,7 @@
estimatedMinutes: '',
actualMinutes: '',
chargePeoples: '',
chargePeoplesName : '',
status:null,
completionTime: '',
engineer: '',
@ -230,6 +231,10 @@
proxy.$modal.showToast('预估人数请输入正整数')
return;
}
if (!form.value.chargePeoples) {
proxy.$modal.showToast('请输入责任人')
return;
}
if (form.value.peoples > 100) {
proxy.$modal.showToast('预估人数不得超出100')
return;
@ -276,6 +281,7 @@
form.value.estimatedMinutes = ''
form.value.actualMinutes = ''
form.value.chargePeoples = ''
form.value.chargePeoplesName = ''
form.value.status = null
form.value.completionTime = ''
form.value.engineer = ''
@ -317,6 +323,7 @@
function selectFormatCheck(val, array) {
const arr = val.split(',').map(Number)
let str = array.filter(item => arr.includes(item.id)).map(item => item.name).join(',')
form.value.chargePeoplesName = str
return str
}
//
@ -451,8 +458,7 @@
if (option.factoryAreaNumber) factoryAreaNumber.value = option.factoryAreaNumber;
if (option.number) form.value.number = option.number;
if (option.deviceNumber) form.value.deviceNumber = option.deviceNumber;
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option
.data)).id) {
if (option.data && JSON.parse(decodeURIComponent(option.data))) {
form.value = JSON.parse(decodeURIComponent(option.data))
form.value.itemNumbers = form.value.items
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>
<view class="right">
<view class="title">
<view class="title-txt">
{{item.describes}}
<view class="title-txt" @click="showFullDescription(item.describes, $event)">
<span class="ellipsis">{{item.describes}}</span>
</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' />
@ -53,6 +53,8 @@
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</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>
</template>
@ -66,10 +68,13 @@
} from 'vue'
import * as repairOrderApi from "@/api/repairOrder"
import CustomModal from './customModal.vue'
const { proxy } = getCurrentInstance()
const repairOrderList = ref([])
const type = ref('')
const dialogVisible = ref(false)
const dialogContent = ref('')
//
function getList() {
@ -97,6 +102,13 @@
uni.$emit('chooseOrder',data)
proxy.$tab.navigateBack()
}
const showFullDescription = (description, event) => {
dialogContent.value = description
dialogVisible.value = true
if (event) {
event.stopPropagation();
}
}
onLoad((option) => {
if (option.type) type.value = option.type;
getList()
@ -133,6 +145,13 @@
width: 0px;
flex: 1;
word-wrap: break-word;
.ellipsis {
display: block;
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.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>

133
src/pages/repairOrder/detail.vue

@ -229,22 +229,42 @@
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
<!-- 完成类型 -->
<u-popup v-model="isShowSuccess" mode="center" border-radius="14">
<view class="popup-title">完成类型</view>
<view class="popup">
<u-radio-group v-model="result" @change="radioGroupChange">
<u-radio v-for="(item, index) in orderCompleteResult" :key="index" :name="item.value">
<div class="form-item">
<label class="form-label">完成方式</label>
<u-radio-group v-model="result" @change="radioGroupChange" class="radio-group">
<u-radio v-for="(item, index) in orderCompleteResult" :key="index" :name="item.value" class="radio-item">
{{ item.label }}
</u-radio>
</u-radio-group>
</div>
</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 class="popup-footer">
<view @click="isShowSuccess = false">取消</view>
<view class="sure" @click="orderClickFinish">确认</view>
</view>
</u-popup>
<!-- 验证完结-->
<u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">验证完结意见</view>
@ -287,6 +307,7 @@
import * as dictApi from "@/api/dict"
import * as repairOrderApi from "@/api/repairOrder"
import { useCountStore } from '@/store'
import * as repairRelationApi from "@/api/repairRelation"
const { proxy } = getCurrentInstance()
// store
@ -326,6 +347,9 @@
const field = ref('')
const maintenanceShift = ref([]) //
const faultType = ref([]) //
const isShowMultiSelect = ref(false)
const options = ref([])
const selectedOptions = ref([])
function change(index) {
current.value = index
changeItem.value = list.value[current.value]
@ -368,8 +392,39 @@
return;
}
}
// 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) {
result.value = e
if (e == 'TEMPORARILY') {
fetchOptions();
}else{
isShowMultiSelect.value =false;
}
}
function selectedOptionsChange(e){
selectedOptions.value = e
}
//
async function orderClickFinish() {
@ -415,7 +479,9 @@
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()
loading.value = false
})
@ -423,6 +489,12 @@
loading.value = true
await repairOrderApi.orderClickFinish(dataOne, type.value).then((res) => {
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('操作成功')
setTimeout(() => {
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>

46
src/pages/repairOrder/index.vue

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

105
src/pages/spotCheckOrder/addForm.vue

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

5
src/pages/spotCheckOrder/detail.vue

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

Loading…
Cancel
Save