|
@@ -3,16 +3,22 @@
|
|
<view class="list-container">
|
|
<view class="list-container">
|
|
<view class="list-title uni-row">
|
|
<view class="list-title uni-row">
|
|
<text class="label">合格量</text>
|
|
<text class="label">合格量</text>
|
|
- <input class="input" style="width: 70%;" v-model="workInfo.qualifiedNum" placeholder="请输入合格量" />
|
|
|
|
|
|
+ <input class="input" @input="handleInputQualifiedNum" style="width: 70%;"
|
|
|
|
+ v-model="workInfo.qualifiedNum" placeholder="请输入合格量" />
|
|
</view>
|
|
</view>
|
|
<view class="list-title uni-row">
|
|
<view class="list-title uni-row">
|
|
<text class="label">废品信息</text>
|
|
<text class="label">废品信息</text>
|
|
- <view class="uni-row" style="justify-content: flex-end;"><text class="label" style="color: blue;" @click="handleAddWasteInfo">+添加</text></view>
|
|
|
|
|
|
+ <view class="uni-row" style="justify-content: flex-end;"><text class="label" style="color: blue;"
|
|
|
|
+ @click="handleAddWasteInfo">+添加</text></view>
|
|
</view>
|
|
</view>
|
|
<view class="list-title uni-row" v-for="(item, index) in wasteInfo">
|
|
<view class="list-title uni-row" v-for="(item, index) in wasteInfo">
|
|
<input class="input" style="width: 20%;" v-model="item.rejectNum" placeholder="废品量" />
|
|
<input class="input" style="width: 20%;" v-model="item.rejectNum" placeholder="废品量" />
|
|
- <input class="input" style="margin-left: 24rpx;width: 70%;" v-model="item.reason" placeholder="请输入废品原因" />
|
|
|
|
- <uni-icons class="icon-gear" type="close" size="60" color="red" @click="handleDeleteWasteInfo(index)"></uni-icons>
|
|
|
|
|
|
+ <!-- <input class="input" v-model="item.reason" placeholder="请输入废品原因" /> -->
|
|
|
|
+ <uni-data-select style="margin-left: 40rpx;width: 70%;" v-model="item.reason" :localdata="reasonList"
|
|
|
|
+ @change="handleTenantChange"></uni-data-select>
|
|
|
|
+
|
|
|
|
+ <uni-icons class="icon-gear" type="close" size="60" color="red"
|
|
|
|
+ @click="handleDeleteWasteInfo(index)"></uni-icons>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view class="list-title uni-row" style="margin-top: 48rpx;">
|
|
<view class="list-title uni-row" style="margin-top: 48rpx;">
|
|
@@ -20,15 +26,6 @@
|
|
<switch class="switch" @change="switchChange" color="rgba(255,85,85,1)" />
|
|
<switch class="switch" @change="switchChange" color="rgba(255,85,85,1)" />
|
|
<text>是</text>
|
|
<text>是</text>
|
|
</view>
|
|
</view>
|
|
- <!-- <view class="list-title"><text class="label">请选择设备:</text></view> -->
|
|
|
|
- <!-- <scroll-view class="scroll-container" scroll-y> -->
|
|
|
|
- <!-- <checkbox-group class="equipment-container uni-row" @change="checkboxChange">
|
|
|
|
- <checkbox v-for="(item,index) in equiments" class="checkbox" style="transform:scale(0.8)" :key="index"
|
|
|
|
- :value="item" :checked="item.checked">
|
|
|
|
- {{item}}
|
|
|
|
- </checkbox>
|
|
|
|
- </checkbox-group> -->
|
|
|
|
-
|
|
|
|
</view>
|
|
</view>
|
|
<view class="add-btn-container uni-row">
|
|
<view class="add-btn-container uni-row">
|
|
<button type="default" class="btn" @click="handleFinishReporting">结束报工</button>
|
|
<button type="default" class="btn" @click="handleFinishReporting">结束报工</button>
|
|
@@ -42,23 +39,38 @@
|
|
ref,
|
|
ref,
|
|
getCurrentInstance
|
|
getCurrentInstance
|
|
} from 'vue'
|
|
} from 'vue'
|
|
|
|
+ import {
|
|
|
|
+ onLoad
|
|
|
|
+ } from '@dcloudio/uni-app'
|
|
import {
|
|
import {
|
|
updateDayWorkItem,
|
|
updateDayWorkItem,
|
|
saveDayWorkItem
|
|
saveDayWorkItem
|
|
} from "@/api/business/dayWorkItem.js"
|
|
} from "@/api/business/dayWorkItem.js"
|
|
import {
|
|
import {
|
|
- timestampToTime
|
|
|
|
|
|
+ timestampToTime,
|
|
|
|
+ toHHmmss
|
|
} from '@/utils/common.js'
|
|
} from '@/utils/common.js'
|
|
const baseDialog = ref(null)
|
|
const baseDialog = ref(null)
|
|
const workInfo = ref({})
|
|
const workInfo = ref({})
|
|
const wasteInfo = ref([])
|
|
const wasteInfo = ref([])
|
|
- const open = (data) => {
|
|
|
|
|
|
+ const reasonList = ref([])
|
|
|
|
+ const emit = defineEmits(['reset'])
|
|
|
|
+
|
|
|
|
+ onLoad(() => {
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ function open(data) {
|
|
workInfo.value = data;
|
|
workInfo.value = data;
|
|
|
|
+ workInfo.value.qualifiedNum = null;
|
|
console.log(data)
|
|
console.log(data)
|
|
- wasteInfo.value =[]
|
|
|
|
|
|
+ wasteInfo.value = []
|
|
baseDialog.value.open()
|
|
baseDialog.value.open()
|
|
}
|
|
}
|
|
- const emit = defineEmits(['reset'])
|
|
|
|
|
|
+
|
|
|
|
+ function close() {
|
|
|
|
+ baseDialog.value.close()
|
|
|
|
+ }
|
|
|
|
|
|
function switchChange(event) {
|
|
function switchChange(event) {
|
|
if (event.detail.value) {
|
|
if (event.detail.value) {
|
|
@@ -67,20 +79,19 @@
|
|
}
|
|
}
|
|
|
|
|
|
function handleInputQualifiedNum() {
|
|
function handleInputQualifiedNum() {
|
|
- workInfo.value.qualifiedNum = workInfo.value.qualifiedNum.replace(/^0+|^-|[^\d]/g, '');
|
|
|
|
|
|
+ workInfo.value.qualifiedNum = workInfo.value.qualifiedNum.replace(/^0+|^-+|[^\d]/g, '');
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// function handleInputRejectNum() {
|
|
// function handleInputRejectNum() {
|
|
// workInfo.value.rejectNum = workInfo.value.rejectNum.replace(/^0+|^-|[^\d]/g, '');
|
|
// workInfo.value.rejectNum = workInfo.value.rejectNum.replace(/^0+|^-|[^\d]/g, '');
|
|
// }
|
|
// }
|
|
|
|
|
|
function handleFinishReporting() {
|
|
function handleFinishReporting() {
|
|
- console.log(workInfo.value)
|
|
|
|
|
|
+ close();
|
|
if (workInfo.value.status != '3') {
|
|
if (workInfo.value.status != '3') {
|
|
workInfo.value.status = '2';
|
|
workInfo.value.status = '2';
|
|
}
|
|
}
|
|
workInfo.value.endTime = timestampToTime(new Date());
|
|
workInfo.value.endTime = timestampToTime(new Date());
|
|
- console.log(workInfo.value)
|
|
|
|
saveDayWorkItem(workInfo.value).then(res => {
|
|
saveDayWorkItem(workInfo.value).then(res => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -88,9 +99,9 @@
|
|
title: '操作成功',
|
|
title: '操作成功',
|
|
duration: 2000
|
|
duration: 2000
|
|
});
|
|
});
|
|
- emit('reset');
|
|
|
|
uni.$emit('dayworkItemUpdate');
|
|
uni.$emit('dayworkItemUpdate');
|
|
baseDialog.value.close();
|
|
baseDialog.value.close();
|
|
|
|
+ workInfo.value.qualifiedNum = null;
|
|
} else {
|
|
} else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: 'error',
|
|
icon: 'error',
|
|
@@ -100,13 +111,21 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- function handleAddWasteInfo() {
|
|
|
|
- wasteInfo.value.push({ rejectNum: '', reason: '' })
|
|
|
|
- }
|
|
|
|
|
|
|
|
- function handleDeleteWasteInfo(index) {
|
|
|
|
- wasteInfo.value.splice(index,1)
|
|
|
|
- }
|
|
|
|
|
|
+ function handleAddWasteInfo() {
|
|
|
|
+ wasteInfo.value.push({
|
|
|
|
+ rejectNum: '',
|
|
|
|
+ reason: ''
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function handleDeleteWasteInfo(index) {
|
|
|
|
+ wasteInfo.value.splice(index, 1)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function handleTenantChange() {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
defineExpose({
|
|
defineExpose({
|
|
open
|
|
open
|
|
@@ -134,13 +153,13 @@
|
|
|
|
|
|
.input {
|
|
.input {
|
|
width: 40%;
|
|
width: 40%;
|
|
-
|
|
|
|
- height: 60rpx;
|
|
|
|
|
|
+ height: 66rpx;
|
|
padding-left: 10rpx;
|
|
padding-left: 10rpx;
|
|
-
|
|
|
|
font-size: 22rpx;
|
|
font-size: 22rpx;
|
|
- border: 1px solid #808080;
|
|
|
|
|
|
+ border: 1rpx solid #e1e1e1;
|
|
|
|
+ border-radius: 8rpx;
|
|
}
|
|
}
|
|
|
|
+
|
|
.icon-gear {
|
|
.icon-gear {
|
|
font-size: 56rpx;
|
|
font-size: 56rpx;
|
|
}
|
|
}
|