|
@@ -51,14 +51,14 @@
|
|
|
</view>
|
|
|
<view class="unfit-container">
|
|
|
<view class="unfit-item-container uni-column" v-for="(item, index) in unfitInfos" :key="index">
|
|
|
- <view class="resu uni-row">
|
|
|
- <view class="label">检查标准</view>
|
|
|
- <view class="value" style="margin-left:16rpx;width: 400rpx;">{{ item.checkStandard }}</view>
|
|
|
- <uni-icons v-if="editable()" type="trash" size="24" style="margin-left: 55rpx;" color="#fc6565"
|
|
|
- @click="handleDelWaste(index)" />
|
|
|
- </view>
|
|
|
-
|
|
|
- <!-- <view class="result uni-row">
|
|
|
+ <view class="resu uni-row">
|
|
|
+ <view class="label">检查标准</view>
|
|
|
+ <view class="value" style="margin-left:16rpx;width: 400rpx;">{{ item.checkStandard }}</view>
|
|
|
+ <uni-icons v-if="editable()" type="trash" size="24" style="margin-left: 55rpx;" color="#fc6565"
|
|
|
+ @click="handleDelWaste(index)" />
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- <view class="result uni-row">
|
|
|
<view class="label">检查结果</view>
|
|
|
<input v-model="item.checkResult" placeholder="请输入检查结果" />
|
|
|
<view class="label" style="text-align: right; padding-right: 16rpx;">数量
|
|
@@ -66,29 +66,29 @@
|
|
|
<input class="number" type="number" @blur="rejectNumberChange" v-model="item.rejectNum"
|
|
|
placeholder="" />
|
|
|
</view> -->
|
|
|
- <view class="resu uni-row">
|
|
|
- <view class="label">检查结果</view>
|
|
|
- <input v-if="editable()" v-model="item.checkResult" placeholder="请输入检查结果" maxlength="50" />
|
|
|
- <view v-else class="value" style="margin-left:16rpx;">{{ item.checkResult }}</view>
|
|
|
- </view>
|
|
|
- <view class="resu uni-row">
|
|
|
- <view class="label">超差范围</view>
|
|
|
- <input v-if="editable()" v-model="item.exceedLimits" placeholder="请输入超差范围" maxlength="50" />
|
|
|
- <view v-else class="value" style="margin-left:16rpx;">{{ item.exceedLimits }}</view>
|
|
|
- </view>
|
|
|
- <view class="resu uni-row">
|
|
|
- <view :class="!editable() ? 'label' : ''">检查量</view>
|
|
|
- <input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
|
|
|
- v-model="item.examiningNum" placeholder="" />
|
|
|
- <view v-else class="number value" style="margin-left:16rpx;">{{ item.examiningNum }}</view>
|
|
|
- <view :class="!editable() ? 'label' : ''" style="margin-left: 16rpx;">不良品量</view>
|
|
|
- <input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
|
|
|
- v-model="item.disqualificationNum" placeholder="" />
|
|
|
- <view v-else class="value" style="margin-left:16rpx;">{{ item.disqualificationNum }}</view>
|
|
|
- </view>
|
|
|
+ <view class="resu uni-row">
|
|
|
+ <view class="label">检查结果</view>
|
|
|
+ <input v-if="editable()" v-model="item.checkResult" placeholder="请输入检查结果" maxlength="50" />
|
|
|
+ <view v-else class="value" style="margin-left:16rpx;">{{ item.checkResult }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="resu uni-row">
|
|
|
+ <view class="label">超差范围</view>
|
|
|
+ <input v-if="editable()" v-model="item.exceedLimits" placeholder="请输入超差范围" maxlength="50" />
|
|
|
+ <view v-else class="value" style="margin-left:16rpx;">{{ item.exceedLimits }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="resu uni-row">
|
|
|
+ <view :class="!editable() ? 'label' : ''">检查量</view>
|
|
|
+ <input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
|
|
|
+ v-model="item.examiningNum" placeholder="" />
|
|
|
+ <view v-else class="number value" style="margin-left:16rpx;">{{ item.examiningNum }}</view>
|
|
|
+ <view :class="!editable() ? 'label' : ''" style="margin-left: 16rpx;">不良品量</view>
|
|
|
+ <input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
|
|
|
+ v-model="item.disqualificationNum" placeholder="" />
|
|
|
+ <view v-else class="value" style="margin-left:16rpx;">{{ item.disqualificationNum }}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-<!-- 拍照上传部分 -->
|
|
|
+ <!-- 拍照上传部分 -->
|
|
|
<view class="title unfit-title uni-row">
|
|
|
<text>拍照上传</text>
|
|
|
</view>
|
|
@@ -96,7 +96,8 @@
|
|
|
margin: 0 16rpx;
|
|
|
background-color: #ffffff;
|
|
|
border-radius: 12rpx;">
|
|
|
- <uni-file-picker v-model="photoList" :readonly="!editable()" return-type="array" :image-styles="imageStyles" @select="select" file-mediatype="image" class="my-files" @delete="handleDeletedPhoto" ></uni-file-picker>
|
|
|
+ <uni-file-picker v-model="photoList" :readonly="!editable()" return-type="array" :image-styles="imageStyles"
|
|
|
+ @select="select" file-mediatype="image" class="my-files" @delete="handleDeletedPhoto"></uni-file-picker>
|
|
|
</view>
|
|
|
<!-- 咨询部分 -->
|
|
|
<view v-if="editable()" class="title unfit-title uni-row">
|
|
@@ -107,7 +108,8 @@
|
|
|
<view class="question uni-column">
|
|
|
<view class="label uni-row">
|
|
|
<text>问题描述</text>
|
|
|
- <text :style="selectType(item)">{{item.consultDepartment == 0?'技术':'品管'}} {{ selectText(item) }}</text>
|
|
|
+ <text :style="selectType(item)">{{item.consultDepartment == 0?'技术':'品管'}}
|
|
|
+ {{ selectText(item) }}</text>
|
|
|
</view>
|
|
|
<view class="content">{{ item.content }}</view>
|
|
|
</view>
|
|
@@ -122,22 +124,35 @@
|
|
|
:localdata="range"></uni-data-checkbox>
|
|
|
</view>
|
|
|
<view v-if="editable()">
|
|
|
- <view v-if="showTransfer" class="list-title uni-row" style="margin-top: 16rpx;">
|
|
|
- <text class="label">是否移交仪器室</text><text> 否</text>
|
|
|
- <switch class="switch" @change="switchChange" style="transform:scale(0.7);margin-top: -16rpx;" color="rgba(255,85,85,1)" />
|
|
|
- <text>是</text>
|
|
|
- </view>
|
|
|
- <view v-else class="list-title uni-row" style="margin-top: 16rpx;">
|
|
|
- <text class="label">已经移交给仪器室</text>
|
|
|
- </view>
|
|
|
+ <view v-if="showTransfer" class="list-title uni-row" style="margin-top: 16rpx;">
|
|
|
+ <text class="label">是否移交仪器室</text><text> 否</text>
|
|
|
+ <!-- <switch class="switch" @change="switchChange" style="transform:scale(0.7);margin-top: -16rpx;"
|
|
|
+ color="rgba(255,85,85,1)" /> -->
|
|
|
+ <zero-switch v-model="processInspecion.flag" @change="switchChange" active-color="rgba(255,85,85,1)"
|
|
|
+ :size="18" style="transform:scale(0.9);margin-top: -9rpx;"></zero-switch>
|
|
|
+ <text>是</text>
|
|
|
+ </view>
|
|
|
+ <view v-else class="list-title uni-row" style="margin-top: 16rpx;">
|
|
|
+ <text class="label">已经移交给仪器室</text>
|
|
|
+ </view>
|
|
|
+ <view class="list-title uni-row" style="margin-top: 16rpx;">
|
|
|
+ <text class="label">全项已检</text><text> 否</text>
|
|
|
+ <!-- <switch :checked="isAllChecked" class="switch" :disabled="!showTransfer || processInspecion.flag"
|
|
|
+ @change="switchAllCheckChange" style="transform:scale(0.7);margin-top: -16rpx;"
|
|
|
+ color="rgba(255,85,85,1)" /> -->
|
|
|
+ <zero-switch v-model="isAllChecked" :disabled="!showTransfer || processInspecion.flag"
|
|
|
+ @change="switchAllCheckChange" active-color="rgba(255,85,85,1)" :size="18"
|
|
|
+ style="transform:scale(0.9);margin-top: -9rpx;"></zero-switch>
|
|
|
+ <text>是</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view v-if="editable()" class="remark uni-row">
|
|
|
+ <view v-if="editable()" class="remark uni-row">
|
|
|
<view class="label">备注</view>
|
|
|
<textarea v-if="editable()" v-model="processInspecion.remark" />
|
|
|
<view v-else class="value">{{ processInspecion.remark }}</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="btns-container uni-row">
|
|
|
+ <view class="btns-container uni-row">
|
|
|
<view class="finished-btn" @click="endWork">提交</view>
|
|
|
<view v-if="editable()" class="question-btn uni-column" @click.stop="handleAddConsultation">
|
|
|
<uni-icons type="headphones" size="24" />
|
|
@@ -175,13 +190,16 @@
|
|
|
import {
|
|
|
getInspectionStandardsList
|
|
|
} from '@/api/business/inspectionStandards.js'
|
|
|
- import {getURL} from '@/api/sys/user.js'
|
|
|
+ import {
|
|
|
+ getURL
|
|
|
+ } from '@/api/sys/user.js'
|
|
|
const lot = ref({})
|
|
|
const isEventTriggered = ref(false); // 创建一个标志位
|
|
|
const unfitInfos = ref([]) //废品信息
|
|
|
const consultations = ref([]) //咨询信息
|
|
|
const flag = ref(false)
|
|
|
const showTransfer = ref(true)
|
|
|
+ const isAllChecked = ref(false)
|
|
|
const selectInspectionChamber = ref(null)
|
|
|
// 创建一个引用来存储最后一次请求的时间戳
|
|
|
const lastRequestTimestamp = ref(0);
|
|
@@ -197,15 +215,16 @@
|
|
|
const selected = ref([]);
|
|
|
const selectedPhotos = ref([])
|
|
|
const imageStyles = {
|
|
|
- width:60,
|
|
|
- height:60
|
|
|
- }
|
|
|
+ width: 60,
|
|
|
+ height: 60
|
|
|
+ }
|
|
|
const initStatus = ref(0)
|
|
|
const editable = () => {
|
|
|
if (initStatus.value == 0 && store.userInfo.roles.some(item => item.roleKey == 'firstArticleInspection')) {
|
|
|
return true
|
|
|
}
|
|
|
- if (store.userInfo.roles.some(item => item.roleKey == 'firstArticleInspection') && processInspecion.value.firstUpdaterId == store.userInfo.userId) {
|
|
|
+ if (store.userInfo.roles.some(item => item.roleKey == 'firstArticleInspection') && processInspecion.value
|
|
|
+ .firstUpdaterId == store.userInfo.userId) {
|
|
|
return true
|
|
|
} else {
|
|
|
return false
|
|
@@ -242,7 +261,7 @@
|
|
|
|
|
|
/***************************** 页面生命周期函数 *****************************/
|
|
|
|
|
|
- function init(){
|
|
|
+ function init() {
|
|
|
const instance = getCurrentInstance().proxy
|
|
|
const eventChannel = instance.getOpenerEventChannel();
|
|
|
|
|
@@ -257,74 +276,96 @@
|
|
|
|
|
|
onLoad(() => {
|
|
|
uni.$off('addWasteInfoEvent');
|
|
|
- if(!flag.value){
|
|
|
- if (store.processInspection != null) {
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中'
|
|
|
- });
|
|
|
- processInspecion.value = store.processInspection
|
|
|
- selectInspecion(processInspecion.value).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- processInspecion.value = res.data;
|
|
|
- processInspecion.value.flag = false
|
|
|
- unfitInfos.value = res.data.processInspectionDetails;
|
|
|
- initStatus.value = res.data.status
|
|
|
- selectedPhotos.value = res.data.processInspectionPictureList
|
|
|
- photoList.value = res.data.processInspectionPictureList.map(item => {
|
|
|
- return { ...item, url: webHost.value + item.url };
|
|
|
- });
|
|
|
- consultations.value = res.data.dayworkItemConsults;
|
|
|
- console.log("res", res);
|
|
|
- console.log(processInspecion.value)
|
|
|
- //判断是否移交到了仪器室
|
|
|
- getInstrumentRoomInspectionList()
|
|
|
- uni.hideLoading();
|
|
|
- // getInspecion();
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: res.msg,
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
- }else{
|
|
|
- init()
|
|
|
- }
|
|
|
+ if (!flag.value) {
|
|
|
+ if (store.processInspection != null) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ processInspecion.value = store.processInspection
|
|
|
+ selectInspecion(processInspecion.value).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ processInspecion.value = res.data;
|
|
|
+ processInspecion.value.flag = false
|
|
|
+ unfitInfos.value = res.data.processInspectionDetails;
|
|
|
+ initStatus.value = res.data.status
|
|
|
+ selectedPhotos.value = res.data.processInspectionPictureList
|
|
|
+ photoList.value = res.data.processInspectionPictureList.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ url: webHost.value + item.url
|
|
|
+ };
|
|
|
+ });
|
|
|
+ consultations.value = res.data.dayworkItemConsults;
|
|
|
+ console.log("res", res);
|
|
|
+ console.log(processInspecion.value)
|
|
|
+ //判断是否移交到了仪器室
|
|
|
+ getInstrumentRoomInspectionList()
|
|
|
+ uni.hideLoading();
|
|
|
+ // getInspecion();
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ init()
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
function getInstrumentRoomInspectionList() {
|
|
|
- getInstrumentRoomInspection(processInspecion.value).then(res =>{
|
|
|
- if(res.data.length >0) {
|
|
|
+ getInstrumentRoomInspection(processInspecion.value).then(res => {
|
|
|
+ if (res.data.length > 0) {
|
|
|
showTransfer.value = false
|
|
|
- }else {
|
|
|
+ processInspecion.value.flag = true
|
|
|
+ } else {
|
|
|
showTransfer.value = true
|
|
|
+ processInspecion.value.flag = false
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
function switchChange(event) {
|
|
|
- if (event.detail.value) {
|
|
|
+ console.log(event)
|
|
|
+ // if (event.detail.value) {
|
|
|
+ if (event) {
|
|
|
processInspecion.value.flag = true
|
|
|
+ processInspecion.value.isAllChecked = 0
|
|
|
+ isAllChecked.value = false
|
|
|
} else {
|
|
|
processInspecion.value.flag = false
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ function switchAllCheckChange(event) {
|
|
|
+ console.log(event)
|
|
|
+ // if (event.detail.value) {
|
|
|
+ if (event) {
|
|
|
+ processInspecion.value.isAllChecked = 1
|
|
|
+ } else {
|
|
|
+ processInspecion.value.isAllChecked = 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
function getOringicalList() {
|
|
|
console.log(processInspecion.value)
|
|
|
- //查询该产品,当前工序,当前检查绑定的检查
|
|
|
- getInspectionStandardsList({
|
|
|
- productId:processInspecion.value.lot.productId,
|
|
|
- processId:processInspecion.value.lot.processId,
|
|
|
- inspectionCode:"firstArticleInspection"
|
|
|
- }).then(res =>{
|
|
|
- unfitInfos.value = res.rows.map(item => {
|
|
|
- // 映射新的数组,包含 inspectionStandardsId 和 checkStandard 属性
|
|
|
- return {
|
|
|
- inspectionStandardsId: item.id, // 从 item 中获取 id
|
|
|
- checkStandard: item.standard // 从 item 中获取 standard
|
|
|
- };
|
|
|
- });
|
|
|
- })
|
|
|
+ //查询该产品,当前工序,当前检查绑定的检查
|
|
|
+ getInspectionStandardsList({
|
|
|
+ productId: processInspecion.value.lot.productId,
|
|
|
+ processId: processInspecion.value.lot.processId,
|
|
|
+ inspectionCode: "firstArticleInspection"
|
|
|
+ }).then(res => {
|
|
|
+ unfitInfos.value = res.rows.map(item => {
|
|
|
+ // 映射新的数组,包含 inspectionStandardsId 和 checkStandard 属性
|
|
|
+ return {
|
|
|
+ inspectionStandardsId: item.id, // 从 item 中获取 id
|
|
|
+ checkStandard: item.standard // 从 item 中获取 standard
|
|
|
+ };
|
|
|
+ });
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/***************************** 定义了一些方法 *****************************/
|
|
@@ -335,78 +376,87 @@
|
|
|
return consul[i].text
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
function upLoadImageHandler(arg) {
|
|
|
- getURL(arg).then(res =>{
|
|
|
+ getURL(arg).then(res => {
|
|
|
let data = JSON.parse(res)
|
|
|
- selectedPhotos.value.push({
|
|
|
- url:data.fileName,
|
|
|
- pictureName:data.originalFilename
|
|
|
- })
|
|
|
- console.log(selectedPhotos.value)
|
|
|
- })
|
|
|
+ selectedPhotos.value.push({
|
|
|
+ url: data.fileName,
|
|
|
+ pictureName: data.originalFilename
|
|
|
+ })
|
|
|
+ console.log(selectedPhotos.value)
|
|
|
+ })
|
|
|
}
|
|
|
- function select (e) {
|
|
|
+
|
|
|
+ function select(e) {
|
|
|
console.log(e)
|
|
|
const {
|
|
|
tempFilePaths,
|
|
|
tempFiles
|
|
|
- } = e
|
|
|
- tempFiles.forEach((item,index)=>{
|
|
|
- upLoadImageHandler({ filePath: tempFilePaths[index],name:item.name})
|
|
|
+ } = e
|
|
|
+ tempFiles.forEach((item, index) => {
|
|
|
+ upLoadImageHandler({
|
|
|
+ filePath: tempFilePaths[index],
|
|
|
+ name: item.name
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
-function handleDeletedPhoto(e) {
|
|
|
+
|
|
|
+ function handleDeletedPhoto(e) {
|
|
|
let fileName = selectedPhotos.value.map(info => info.pictureName)
|
|
|
const firstSlashIndex = e.tempFile.url.lastIndexOf('/');
|
|
|
const lastSlashIndex = e.tempFile.url.lastIndexOf('_');
|
|
|
- const type = e.tempFile.url.substring(firstSlashIndex + 1,lastSlashIndex)
|
|
|
- const pictureName = e.tempFile.url.substring(firstSlashIndex + 1,lastSlashIndex) +e.tempFile.url.substring(e.tempFile.url.lastIndexOf('.') -1 + 1);;
|
|
|
- let index = -1; // 初始化 index 为 -1,表示未找到
|
|
|
-
|
|
|
- // 首先检查 e.tempFile.name 是否存在
|
|
|
- if (fileName.findIndex(name => name === e.tempFile.name) !== -1) {
|
|
|
- index = fileName.findIndex(name => name === e.tempFile.name);
|
|
|
- }
|
|
|
- // 如果 e.tempFile.name 不存在,检查 e.tempFile.pictureName 是否存在
|
|
|
- else if (fileName.findIndex(name => name === e.tempFile.pictureName) !== -1) {
|
|
|
- index = fileName.findIndex(name => name === e.tempFile.pictureName);
|
|
|
- }
|
|
|
- // 如果以上两个都不存在,检查 pictureName 是否存在
|
|
|
- else if (fileName.findIndex(name => name === pictureName) !== -1) {
|
|
|
- index = fileName.findIndex(name => name === pictureName);
|
|
|
- }
|
|
|
- selectedPhotos.value.splice(index,1)
|
|
|
+ const type = e.tempFile.url.substring(firstSlashIndex + 1, lastSlashIndex)
|
|
|
+ const pictureName = e.tempFile.url.substring(firstSlashIndex + 1, lastSlashIndex) + e.tempFile.url.substring(e
|
|
|
+ .tempFile.url.lastIndexOf('.') - 1 + 1);;
|
|
|
+ let index = -1; // 初始化 index 为 -1,表示未找到
|
|
|
+
|
|
|
+ // 首先检查 e.tempFile.name 是否存在
|
|
|
+ if (fileName.findIndex(name => name === e.tempFile.name) !== -1) {
|
|
|
+ index = fileName.findIndex(name => name === e.tempFile.name);
|
|
|
+ }
|
|
|
+ // 如果 e.tempFile.name 不存在,检查 e.tempFile.pictureName 是否存在
|
|
|
+ else if (fileName.findIndex(name => name === e.tempFile.pictureName) !== -1) {
|
|
|
+ index = fileName.findIndex(name => name === e.tempFile.pictureName);
|
|
|
+ }
|
|
|
+ // 如果以上两个都不存在,检查 pictureName 是否存在
|
|
|
+ else if (fileName.findIndex(name => name === pictureName) !== -1) {
|
|
|
+ index = fileName.findIndex(name => name === pictureName);
|
|
|
+ }
|
|
|
+ selectedPhotos.value.splice(index, 1)
|
|
|
}
|
|
|
- function handleDrawingMenu(){
|
|
|
- // 对 technologicalProcessDetailId 进行URL编码
|
|
|
- var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
|
|
|
- var enTechnologicalProcessId = encodeURIComponent(processInspecion.value.lot.technologicalProcessId);
|
|
|
- var enprocessCode = encodeURIComponent(processInspecion.value.lot.processCode);
|
|
|
- var encodeCode = encodeURIComponent(processInspecion.value.lot.lotCode);
|
|
|
- var enProcessAlias = encodeURIComponent(processInspecion.value.lot.processAlias);
|
|
|
- // 构建查询参数字符串
|
|
|
- var queryParam = `param1=${encodedId}¶m2=${encodeCode}¶m3=${enprocessCode}¶m4=${enTechnologicalProcessId}¶m5=${enProcessAlias}`;
|
|
|
-
|
|
|
- // 使用模板字符串构建完整的URL
|
|
|
- var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
|
|
|
-
|
|
|
- // 导航到指定页面
|
|
|
- uni.navigateTo({
|
|
|
+
|
|
|
+ function handleDrawingMenu() {
|
|
|
+ // 对 technologicalProcessDetailId 进行URL编码
|
|
|
+ var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
|
|
|
+ var enTechnologicalProcessId = encodeURIComponent(processInspecion.value.lot.technologicalProcessId);
|
|
|
+ var enprocessCode = encodeURIComponent(processInspecion.value.lot.processCode);
|
|
|
+ var encodeCode = encodeURIComponent(processInspecion.value.lot.lotCode);
|
|
|
+ var enProcessAlias = encodeURIComponent(processInspecion.value.lot.processAlias);
|
|
|
+ // 构建查询参数字符串
|
|
|
+ var queryParam =
|
|
|
+ `param1=${encodedId}¶m2=${encodeCode}¶m3=${enprocessCode}¶m4=${enTechnologicalProcessId}¶m5=${enProcessAlias}`;
|
|
|
+
|
|
|
+ // 使用模板字符串构建完整的URL
|
|
|
+ var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
|
|
|
+
|
|
|
+ // 导航到指定页面
|
|
|
+ uni.navigateTo({
|
|
|
url: navigateUrl
|
|
|
- });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
const rejectNumberChange = () => {
|
|
|
- let sumDisqualificationNum = 0
|
|
|
- let sumExaminingNum = 0
|
|
|
- unfitInfos.value.forEach(v => {
|
|
|
- sumDisqualificationNum += (v.disqualificationNum != null ? Number(v.disqualificationNum) : 0)
|
|
|
- sumExaminingNum += (v.examiningNum != null ? Number(v.examiningNum) : 0)
|
|
|
- })
|
|
|
- processInspecion.value.disqualificationNum = sumDisqualificationNum
|
|
|
- processInspecion.value.examiningNum = sumExaminingNum
|
|
|
- console.log(processInspecion.value)
|
|
|
+ let sumDisqualificationNum = 0
|
|
|
+ let sumExaminingNum = 0
|
|
|
+ unfitInfos.value.forEach(v => {
|
|
|
+ sumDisqualificationNum += (v.disqualificationNum != null ? Number(v.disqualificationNum) : 0)
|
|
|
+ sumExaminingNum += (v.examiningNum != null ? Number(v.examiningNum) : 0)
|
|
|
+ })
|
|
|
+ processInspecion.value.disqualificationNum = sumDisqualificationNum
|
|
|
+ processInspecion.value.examiningNum = sumExaminingNum
|
|
|
+ console.log(processInspecion.value)
|
|
|
}
|
|
|
|
|
|
//查询咨询列表
|
|
@@ -430,35 +480,35 @@ function handleDeletedPhoto(e) {
|
|
|
//结束报工按钮
|
|
|
function endWork() {
|
|
|
let unf = unfitInfos.value;
|
|
|
- if(store.userInfo.roles.some(item => item.roleKey == 'firstArticleInspection')) {
|
|
|
- for (var i = 0; i < unfitInfos.value.length; i++) {
|
|
|
+ if (store.userInfo.roles.some(item => item.roleKey == 'firstArticleInspection')) {
|
|
|
+ for (var i = 0; i < unfitInfos.value.length; i++) {
|
|
|
|
|
|
- if (unf[i].examiningNum < 0 || unf[i].disqualificationNum < 0) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '检查量,不良品量不能小于0',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- return
|
|
|
+ if (unf[i].examiningNum < 0 || unf[i].disqualificationNum < 0) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '检查量,不良品量不能小于0',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (unf[i].examiningNum > processInspecion.value.lot.pudName) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '检查量不能大于投产量'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
- if (unf[i].examiningNum > processInspecion.value.lot.pudName) {
|
|
|
+
|
|
|
+
|
|
|
+ if (processInspecion.value.disqualificationNum > processInspecion.value.lot.pudName) {
|
|
|
uni.showToast({
|
|
|
icon: 'none',
|
|
|
- title: '检查量不能大于投产量'
|
|
|
+ title: '不良品量不能大于投产量'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if (processInspecion.value.disqualificationNum > processInspecion.value.lot.pudName) {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: '不良品量不能大于投产量'
|
|
|
- })
|
|
|
- return
|
|
|
}
|
|
|
-}
|
|
|
save();
|
|
|
|
|
|
|
|
@@ -488,40 +538,41 @@ function handleDeletedPhoto(e) {
|
|
|
processInspecion.value.processInspectionPictureList = selectedPhotos.value
|
|
|
processInspecion.value.isReviewer = store.isReviewer
|
|
|
console.log(processInspecion.value)
|
|
|
- if(processInspecion.value.flag) {
|
|
|
+ if (processInspecion.value.flag) {
|
|
|
//打开选择仪器室的弹窗
|
|
|
selectInspectionChamber.value.open()
|
|
|
console.log(processInspecion.value)
|
|
|
- }else{
|
|
|
- saveFirstInspection(processInspecion.value).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- let index = 0;
|
|
|
- console.log(store.isReviewer)
|
|
|
- for (let i = 0; i < pages.length; i++) {
|
|
|
+ } else {
|
|
|
+ saveFirstInspection(processInspecion.value).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ let index = 0;
|
|
|
+ console.log(store.isReviewer)
|
|
|
+ for (let i = 0; i < pages.length; i++) {
|
|
|
|
|
|
- if (!store.isReviewer && pages[i].$page.fullPath == "/pages/reportingForWork/index") {
|
|
|
+ if (!store.isReviewer && pages[i].$page.fullPath == "/pages/reportingForWork/index") {
|
|
|
|
|
|
- index = pages.length - i - 1;
|
|
|
- }
|
|
|
- if (store.isReviewer && pages[i].$page.fullPath == "/pages/firstInspection/index") {
|
|
|
-
|
|
|
- index = pages.length - i - 1;
|
|
|
+ index = pages.length - i - 1;
|
|
|
+ }
|
|
|
+ if (store.isReviewer && pages[i].$page.fullPath == "/pages/firstInspection/index") {
|
|
|
+
|
|
|
+ index = pages.length - i - 1;
|
|
|
+ }
|
|
|
}
|
|
|
+ console.log("index", index);
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: index
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
}
|
|
|
- console.log("index", index);
|
|
|
- uni.navigateBack({
|
|
|
- delta: index
|
|
|
- });
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: res.msg,
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
function handleSelectInspectionChamber(data) {
|
|
|
processInspecion.value.inspectionChamberId = data
|
|
|
console.log(processInspecion.value)
|
|
@@ -531,9 +582,9 @@ function handleDeletedPhoto(e) {
|
|
|
let pages = getCurrentPages();
|
|
|
console.log(store.isReviewer)
|
|
|
for (let i = 0; i < pages.length; i++) {
|
|
|
-
|
|
|
- if ( pages[i].$page.fullPath == "/pages/reportingForWork/index") {
|
|
|
-
|
|
|
+
|
|
|
+ if (pages[i].$page.fullPath == "/pages/reportingForWork/index") {
|
|
|
+
|
|
|
index = pages.length - i - 1;
|
|
|
}
|
|
|
}
|
|
@@ -564,7 +615,7 @@ function handleDeletedPhoto(e) {
|
|
|
}
|
|
|
|
|
|
const addWasteInfo = (data) => {
|
|
|
- console.log(data,"55555555")
|
|
|
+ console.log(data, "55555555")
|
|
|
flag.value = true
|
|
|
var info = {
|
|
|
inspectionStandardsId: data.id,
|
|
@@ -574,11 +625,11 @@ function handleDeletedPhoto(e) {
|
|
|
console.log(data)
|
|
|
}
|
|
|
const addConsultation = (data) => {
|
|
|
- let info = data
|
|
|
- info.forEach(item =>{
|
|
|
- item.status = 0
|
|
|
- })
|
|
|
- consultations.value = consultations.value.concat(info)
|
|
|
+ let info = data
|
|
|
+ info.forEach(item => {
|
|
|
+ item.status = 0
|
|
|
+ })
|
|
|
+ consultations.value = consultations.value.concat(info)
|
|
|
isEventTriggered.value = true; // 更新标志位状态
|
|
|
}
|
|
|
|
|
@@ -594,10 +645,10 @@ function handleDeletedPhoto(e) {
|
|
|
var enprocessId = encodeURIComponent(processInspecion.value.lot.processId);
|
|
|
// 构建查询参数字符串
|
|
|
var queryParam = `param1=${encodedId}¶m2=${enprocessId}`;
|
|
|
-
|
|
|
+
|
|
|
// 使用模板字符串构建完整的URL
|
|
|
var navigateUrl = `/pages/firstInspection/options?${queryParam}`;
|
|
|
-
|
|
|
+
|
|
|
// 导航到指定页面
|
|
|
uni.navigateTo({
|
|
|
url: navigateUrl
|
|
@@ -675,6 +726,7 @@ function handleDeletedPhoto(e) {
|
|
|
.label {
|
|
|
width: 160rpx;
|
|
|
}
|
|
|
+
|
|
|
.drawing-btn {
|
|
|
padding: 12rpx 32rpx;
|
|
|
background-color: #0055ff;
|
|
@@ -755,9 +807,10 @@ function handleDeletedPhoto(e) {
|
|
|
font-size: 28rpx;
|
|
|
}
|
|
|
}
|
|
|
- .uni-input-input:disabled {
|
|
|
- background-color: #f5f7fa;
|
|
|
- }
|
|
|
+
|
|
|
+ .uni-input-input:disabled {
|
|
|
+ background-color: #f5f7fa;
|
|
|
+ }
|
|
|
|
|
|
.result {
|
|
|
align-items: center;
|
|
@@ -831,10 +884,12 @@ function handleDeletedPhoto(e) {
|
|
|
padding: 24rpx;
|
|
|
background-color: #ffffff;
|
|
|
border: 1px solid #bcbcbc;
|
|
|
- .switch {
|
|
|
+
|
|
|
+ .switch {
|
|
|
margin-top: -4px;
|
|
|
//align-items: center;
|
|
|
}
|
|
|
+
|
|
|
.result {
|
|
|
align-items: center;
|
|
|
|
|
@@ -894,20 +949,25 @@ function handleDeletedPhoto(e) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.switch {
|
|
|
margin-top: -8rpx;
|
|
|
align-items: center;
|
|
|
transform: scale(0.7);
|
|
|
}
|
|
|
}
|
|
|
- input:disabled {background-color: #00ff00;}
|
|
|
+
|
|
|
+ input:disabled {
|
|
|
+ background-color: #00ff00;
|
|
|
+ }
|
|
|
+
|
|
|
.my-files {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
-
|
|
|
+
|
|
|
:deep(.uni-file-picker__container) {
|
|
|
- flex-direction: row;
|
|
|
-
|
|
|
+ flex-direction: row;
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</style>
|