|
@@ -3,26 +3,34 @@
|
|
|
<view class="carrier-info uni-column">
|
|
|
<view class="carrier-code uni-row">
|
|
|
<text>箱号</text>
|
|
|
- <text style="margin-left: 24rpx;">D2423156000691</text>
|
|
|
+ <text style="margin-left: 24rpx;">{{processInspecion.lot.allCarrierName}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="info-row uni-row">
|
|
|
+ <view class="label">图号</view>
|
|
|
+ <view class="value">{{ processInspecion.lot.drawingNumber }}</view>
|
|
|
</view>
|
|
|
<view class="info-row uni-row">
|
|
|
<view class="label">批次号</view>
|
|
|
- <view class="value">{{ data.lot_code }}</view>
|
|
|
+ <view class="value">{{ processInspecion.lot.lotCode }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="info-row uni-row">
|
|
|
+ <view class="label">工艺版本</view>
|
|
|
+ <view class="value">{{ processInspecion.lot.technologyVersion }}</view>
|
|
|
</view>
|
|
|
<view class="info-row uni-row">
|
|
|
<view class="label">产品描述</view>
|
|
|
- <view class="value">{{ data.product_description }}</view>
|
|
|
+ <view class="value">{{processInspecion.lot. productDescription }}</view>
|
|
|
</view>
|
|
|
<view class="info-row uni-row">
|
|
|
<view class="label">当前工序</view>
|
|
|
- <view class="value">{{ data.current_process }}</view>
|
|
|
+ <view class="value">{{ processInspecion.lot.processAlias }}</view>
|
|
|
</view>
|
|
|
<view class="info-row uni-row">
|
|
|
<view class="label">投产数量</view>
|
|
|
- <view class="value">{{ data.production_quantity }}</view>
|
|
|
+ <view class="value">{{ processInspecion.lot.pudName }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 废品信息 -->
|
|
|
<view class="title unfit-title uni-row">
|
|
|
<text>废品信息</text>
|
|
@@ -30,20 +38,28 @@
|
|
|
</view>
|
|
|
<view class="unfit-container">
|
|
|
<view class="unfit-item-container uni-column" v-for="(item, index) in unfitInfos" :key="index">
|
|
|
- <view class="title uni-row">
|
|
|
+ <!-- 暂时注释,后续会使用 -->
|
|
|
+ <!-- <view class="title uni-row">
|
|
|
<text>检查项-{{ item.title }}</text>
|
|
|
<uni-icons type="trash" size="24" color="#fc6565" @click="handleDelWaste(index)" />
|
|
|
+ </view> -->
|
|
|
+ <!-- <view class="standard">检查标准:{{ item.standard }}</view> -->
|
|
|
+ <view class="resu uni-row">
|
|
|
+ <view class="label">检查标准</view>
|
|
|
+ <input v-model="item.checkStandard" placeholder="请输入检查标准" />
|
|
|
+ <uni-icons type="trash" size="24" style="margin-left: 55rpx;" color="#fc6565"
|
|
|
+ @click="handleDelWaste(index)" />
|
|
|
</view>
|
|
|
- <view class="standard">检查标准:{{ item.standard }}</view>
|
|
|
+
|
|
|
<view class="result uni-row">
|
|
|
<view class="label">检查结果</view>
|
|
|
- <input v-model="item.result" placeholder="请输入检查结果" />
|
|
|
+ <input v-model="item.checkResult" placeholder="请输入检查结果" />
|
|
|
<view class="label" style="text-align: right; padding-right: 16rpx;">数量</view>
|
|
|
- <input class="number" type="number" v-model="item.number" placeholder="" />
|
|
|
+ <input class="number" type="number" v-model="item.rejectNum" placeholder="" />
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 咨询部分 -->
|
|
|
<view class="title">咨询</view>
|
|
|
<view class="consultation-container uni-column">
|
|
@@ -51,92 +67,248 @@
|
|
|
<view class="question uni-column">
|
|
|
<view class="label uni-row">
|
|
|
<text>问题描述</text>
|
|
|
- <text style="color: #fcab53">{{ item.answer === '' ? '待回复' : '已回复' }}</text>
|
|
|
+ <text :style="selectType(item)">{{ selectText(item) }}</text>
|
|
|
</view>
|
|
|
- <view class="content">{{ item.question }}</view>
|
|
|
+ <view class="content">{{ item.content }}</view>
|
|
|
</view>
|
|
|
- <view v-if="item.answer !== ''" class="answer" style="margin-top: 24rpx; padding-top: 24rpx; border-top: 1px dotted #aaaaaa;">
|
|
|
+ <!-- 不需要暂时注释 -->
|
|
|
+ <!-- <view v-if="item.answer !== ''" class="answer"
|
|
|
+ style="margin-top: 24rpx; padding-top: 24rpx; border-top: 1px dotted #aaaaaa;">
|
|
|
<view class="label">回复</view>
|
|
|
<view class="content">{{ item.answer }}</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<!-- 报工部分 -->
|
|
|
<view class="daywork-container">
|
|
|
+ <!-- 此处后续要加上条件限制,当状态为合格或不合格的时候不能修改状态,需要有权限的人来进行修改 -->
|
|
|
<view class="result uni-row">
|
|
|
<view class="label">检测量</view>
|
|
|
- <input type="number" placeholder="请输入检测量" />
|
|
|
+ <input type="number" v-model="processInspecion.examiningNum" placeholder="请输入检测量" />
|
|
|
<view class="label" style="text-align: right; padding-right: 24rpx">废品量</view>
|
|
|
- <input type="number" placeholder="请输入废品量" />
|
|
|
+ <input type="number" v-model="processInspecion.rejectNum" placeholder="请输入废品量" />
|
|
|
+ </view>
|
|
|
+ <view class="result uni-row">
|
|
|
+ <view class="label" style="margin-top: 20rpx; margin-right: 10rpx;">序检状态</view>
|
|
|
+ <uni-data-checkbox style="margin-top: 20rpx;" v-model="processInspecion.status" :localdata="range"
|
|
|
+ @change="change"></uni-data-checkbox>
|
|
|
</view>
|
|
|
<view class="remark uni-row">
|
|
|
<view class="label">备注</view>
|
|
|
- <textarea />
|
|
|
+ <textarea v-model="processInspecion.remark" />
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="btns-container uni-row">
|
|
|
- <view class="finished-btn">结束报工</view>
|
|
|
+ <view class="finished-btn" @click="endWork">结束报工</view>
|
|
|
<view class="question-btn uni-column" @click.stop="handleAddConsultation">
|
|
|
<uni-icons type="headphones" size="24" />
|
|
|
<text>咨询</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
- import { ref } from 'vue'
|
|
|
- import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
|
|
|
-
|
|
|
- const data = ref({
|
|
|
- lot_code: 'D2423156000691',
|
|
|
- current_process: '热处理',
|
|
|
- product_description: '产品描述',
|
|
|
- production_quantity: 300
|
|
|
+ import {
|
|
|
+ ref,
|
|
|
+ onMounted,
|
|
|
+ getCurrentInstance
|
|
|
+
|
|
|
+ } from 'vue'
|
|
|
+ import {
|
|
|
+ onLoad,
|
|
|
+ onReady,
|
|
|
+ onUnload,
|
|
|
+ onShow
|
|
|
+ } from '@dcloudio/uni-app'
|
|
|
+ import {
|
|
|
+ store
|
|
|
+ } from '@/store/index.js'
|
|
|
+ import {
|
|
|
+ saveProcessInspecion,
|
|
|
+ selectInspecion
|
|
|
+ } from '@/api/business/processInspection.js'
|
|
|
+ const lot = ref({})
|
|
|
+ const unfitInfos = ref([]) //废品信息
|
|
|
+ const consultations = ref([]) //咨询信息
|
|
|
+ const processInspecion = ref({
|
|
|
+ remark: "",
|
|
|
+ rejectNum: 0,
|
|
|
+ examiningNum: 0,
|
|
|
+ status: 0,
|
|
|
})
|
|
|
- const unfitInfos = ref([])
|
|
|
- const consultations = ref([])
|
|
|
-
|
|
|
+
|
|
|
+ const consul = [{
|
|
|
+ value: 0,
|
|
|
+ text: "待确认",
|
|
|
+ type: "color: #fcab53"
|
|
|
+ }, {
|
|
|
+ value: 2,
|
|
|
+ text: "合格",
|
|
|
+ type: "color: #55ff7f"
|
|
|
+ }, {
|
|
|
+ value: 1,
|
|
|
+ text: "不合格",
|
|
|
+ type: "color: #ff0c2c"
|
|
|
+ }]
|
|
|
+
|
|
|
+ const range = [{
|
|
|
+ value: 0,
|
|
|
+ text: "待确认",
|
|
|
+ type: "color: #fcab53"
|
|
|
+ }, {
|
|
|
+ value: 1,
|
|
|
+ text: "合格",
|
|
|
+ type: "color: #55ff7f"
|
|
|
+ }, {
|
|
|
+ value: 2,
|
|
|
+ text: "不合格",
|
|
|
+ type: "color: #ff0c2c"
|
|
|
+ }]
|
|
|
+
|
|
|
/***************************** 页面生命周期函数 *****************************/
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ const instance = getCurrentInstance().proxy
|
|
|
+ const eventChannel = instance.getOpenerEventChannel();
|
|
|
+
|
|
|
+ eventChannel.on('processInspectionFrom', function(data) {
|
|
|
+
|
|
|
+ console.log('acceptDataFromOpenerPage', data)
|
|
|
+ if (data && data.data) {
|
|
|
+ processInspecion.value.lot = data.data;
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
onShow(() => {
|
|
|
-
|
|
|
+ if (store.processInspection != null) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ processInspecion.value = store.processInspection
|
|
|
+ selectInspecion(processInspecion.value).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ processInspecion.value = res.data;
|
|
|
+ unfitInfos.value = res.data.dayworkItemRejects;
|
|
|
+ consultations.value = res.data.dayworkItemConsults;
|
|
|
+ console.log("res", res);
|
|
|
+ uni.hideLoading();
|
|
|
+ // getInspecion();
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
/***************************** 定义了一些方法 *****************************/
|
|
|
+ //咨询文本
|
|
|
+ function selectText(item) {
|
|
|
+ for (var i = 0; i < consul.length; i++) {
|
|
|
+ if (item.status == consul[i].value) {
|
|
|
+ return consul[i].text
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询咨询列表
|
|
|
+ function getInspecion() {
|
|
|
+
|
|
|
+ processInspecion.value = store.processInspection
|
|
|
+ selectInspecion(processInspecion.value).then(res => {
|
|
|
+ console.log("咨询", res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ console.log("res", res);
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //结束报工按钮
|
|
|
+ function endWork() {
|
|
|
+ processInspecion.value.dayworkItemConsults = consultations.value;
|
|
|
+ processInspecion.value.dayworkItemRejects = unfitInfos.value;
|
|
|
+ processInspecion.value.user = store.userInfo;
|
|
|
+
|
|
|
+ console.log("结束报工保存", processInspecion.value);
|
|
|
+ saveProcessInspecion(processInspecion.value).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/processInspection/index'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //咨询样式
|
|
|
+ function selectType(item) {
|
|
|
+ for (var i = 0; i < consul.length; i++) {
|
|
|
+ if (item.status == consul[i].value) {
|
|
|
+ return consul[i].type
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
const addWasteInfo = (data) => {
|
|
|
const info = {
|
|
|
title: data.title,
|
|
|
- standard: data.standard
|
|
|
+ checkStandard: data.standard
|
|
|
}
|
|
|
unfitInfos.value.push(info)
|
|
|
}
|
|
|
const addConsultation = (data) => {
|
|
|
const info = {
|
|
|
- question: data.question,
|
|
|
- answer: '123'
|
|
|
+ content: data.question,
|
|
|
+ status: 0
|
|
|
}
|
|
|
consultations.value.push(info)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/***************************** 定义了一些事件 *****************************/
|
|
|
// 添加不合格信息
|
|
|
const handleAddWaste = () => {
|
|
|
- // 监听事件
|
|
|
- uni.$once('addWasteInfoEvent',(data)=>{
|
|
|
- addWasteInfo(data)
|
|
|
- })
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/processInspection/options"
|
|
|
- })
|
|
|
+ let info = {}
|
|
|
+ unfitInfos.value.push(info)
|
|
|
+
|
|
|
+ // 监听事件,暂时不用,后续会使用
|
|
|
+ // uni.$once('addWasteInfoEvent', (data) => {
|
|
|
+ // addWasteInfo(data)
|
|
|
+ // })
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: "/pages/processInspection/options"
|
|
|
+ // })
|
|
|
}
|
|
|
// 删除不合格信息
|
|
|
const handleDelWaste = (index) => {
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
content: '确定删除该项?',
|
|
|
- success: function (res) {
|
|
|
+ success: function(res) {
|
|
|
if (res.confirm) {
|
|
|
unfitInfos.value.splice(index, 1)
|
|
|
} else if (res.cancel) {
|
|
@@ -145,16 +317,26 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- // 添加不合格信息
|
|
|
+
|
|
|
+ // 咨询
|
|
|
const handleAddConsultation = () => {
|
|
|
// 监听事件
|
|
|
- uni.$once('addWasteConsultationEvent',(data)=>{
|
|
|
+ uni.$once('addWasteConsultationEvent', (data) => {
|
|
|
addConsultation(data)
|
|
|
})
|
|
|
+
|
|
|
uni.navigateTo({
|
|
|
- url: "/pages/processInspection/consultation"
|
|
|
+ url: "/pages/processInspection/consultation",
|
|
|
+ success: (res) => {
|
|
|
+ // 通过eventChannel向被打开页面传送数据
|
|
|
+ res.eventChannel.emit("processInspectionConsultation", {
|
|
|
+ data: processInspecion.value.lot
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: "/pages/processInspection/consultation"
|
|
|
+ // })
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -163,33 +345,35 @@
|
|
|
height: 100%;
|
|
|
background-color: #ececec;
|
|
|
font-size: 28rpx;
|
|
|
-
|
|
|
- > .title {
|
|
|
+
|
|
|
+ >.title {
|
|
|
font-weight: 700;
|
|
|
margin: 24rpx 16rpx;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.carrier-info {
|
|
|
margin: 32rpx 16rpx 0 16rpx;
|
|
|
padding: 24rpx;
|
|
|
background-color: #ffffff;
|
|
|
border-radius: 8rpx;
|
|
|
-
|
|
|
+
|
|
|
.carrier-code {
|
|
|
font-size: 32rpx;
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.info-row {
|
|
|
margin-top: 16rpx;
|
|
|
color: #767676;
|
|
|
-
|
|
|
+
|
|
|
.label {
|
|
|
width: 160rpx;
|
|
|
}
|
|
|
+
|
|
|
.value {
|
|
|
flex: 1;
|
|
|
-
|
|
|
+
|
|
|
textarea {
|
|
|
flex: 1;
|
|
|
border: 1px solid #888888;
|
|
@@ -199,15 +383,17 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.unfit-title {
|
|
|
margin-bottom: 24rpx;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
-
|
|
|
+
|
|
|
text {
|
|
|
font-size: 28rpx;
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
+
|
|
|
.add-btn {
|
|
|
padding: 12rpx 32rpx;
|
|
|
background-color: #a4adb3;
|
|
@@ -216,45 +402,62 @@
|
|
|
font-size: 24rpx;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.unfit-container {
|
|
|
padding: 24rpx;
|
|
|
margin: 0 16rpx;
|
|
|
background-color: #ffffff;
|
|
|
border-radius: 12rpx;
|
|
|
-
|
|
|
+
|
|
|
.unfit-item-container {
|
|
|
position: relative;
|
|
|
-
|
|
|
- > * {
|
|
|
+
|
|
|
+ >* {
|
|
|
margin-bottom: 24rpx;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.title {
|
|
|
font-weight: 700;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
-
|
|
|
+
|
|
|
image {
|
|
|
width: 40rpx;
|
|
|
height: 40rpx;
|
|
|
}
|
|
|
}
|
|
|
- .standard {
|
|
|
+
|
|
|
+ .standard {}
|
|
|
+
|
|
|
+ .resu {
|
|
|
+ width: 100%;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ input {
|
|
|
+ margin-left: 20rpx;
|
|
|
+ width: 200rpx;
|
|
|
+ height: 56rpx;
|
|
|
+ flex: 1;
|
|
|
+ border: 1px solid #9f9f9f;
|
|
|
+ font-size: 28rpx;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
.result {
|
|
|
align-items: center;
|
|
|
border-bottom: 1px solid #9f9f9f;
|
|
|
padding-bottom: 32rpx;
|
|
|
-
|
|
|
+
|
|
|
.label {
|
|
|
flex: 1;
|
|
|
}
|
|
|
+
|
|
|
input {
|
|
|
width: 280rpx;
|
|
|
height: 56rpx;
|
|
|
border: 1px solid #9f9f9f;
|
|
|
font-size: 28rpx;
|
|
|
-
|
|
|
+
|
|
|
&.number {
|
|
|
width: 104rpx;
|
|
|
text-align: center;
|
|
@@ -262,6 +465,7 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.unfit-item-container:last-child {
|
|
|
.result {
|
|
|
border-bottom: none;
|
|
@@ -269,50 +473,56 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.consultation-container {
|
|
|
margin: 0 16rpx;
|
|
|
padding: 24rpx;
|
|
|
background-color: #ffffff;
|
|
|
border-radius: 8rpx;
|
|
|
-
|
|
|
+
|
|
|
.consultation-item-container {
|
|
|
margin-bottom: 24rpx;
|
|
|
border-bottom: 2px solid #888888;
|
|
|
padding-bottom: 24rpx;
|
|
|
}
|
|
|
+
|
|
|
.consultation-item-container:last-child {
|
|
|
margin-bottom: 0;
|
|
|
border-bottom: 0;
|
|
|
padding-bottom: 0;
|
|
|
}
|
|
|
-
|
|
|
- .question, .answer {
|
|
|
+
|
|
|
+ .question,
|
|
|
+ .answer {
|
|
|
.label {
|
|
|
justify-content: space-between;
|
|
|
margin-bottom: 16rpx;
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
+
|
|
|
.content {
|
|
|
line-height: 40rpx;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.answer {
|
|
|
margin-top: 24rpx;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.daywork-container {
|
|
|
margin-top: 24rpx;
|
|
|
padding: 24rpx;
|
|
|
background-color: #ffffff;
|
|
|
border: 1px solid #bcbcbc;
|
|
|
-
|
|
|
+
|
|
|
.result {
|
|
|
align-items: center;
|
|
|
-
|
|
|
+
|
|
|
.label {
|
|
|
width: 112rpx;
|
|
|
}
|
|
|
+
|
|
|
input {
|
|
|
flex: 1;
|
|
|
height: 56rpx;
|
|
@@ -321,22 +531,24 @@
|
|
|
text-align: center;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.remark {
|
|
|
margin-top: 24rpx;
|
|
|
+
|
|
|
.label {
|
|
|
width: 112rpx;
|
|
|
}
|
|
|
+
|
|
|
textarea {
|
|
|
flex: 1;
|
|
|
border: 1px solid #9f9f9f;
|
|
|
height: 168rpx;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.btns-container {
|
|
|
margin-top: 24rpx;
|
|
|
-
|
|
|
+
|
|
|
.finished-btn {
|
|
|
display: flex;
|
|
|
flex: 1;
|
|
@@ -348,14 +560,16 @@
|
|
|
align-items: center;
|
|
|
border-radius: 8rpx;
|
|
|
}
|
|
|
+
|
|
|
.question-btn {
|
|
|
width: 80rpx;
|
|
|
align-items: flex-end;
|
|
|
-
|
|
|
+
|
|
|
image {
|
|
|
width: 48rpx;
|
|
|
height: 48rpx;
|
|
|
}
|
|
|
+
|
|
|
text {
|
|
|
font-size: 24rpx;
|
|
|
}
|