小程序下料报工更改

This commit is contained in:
z 2026-01-15 14:53:54 +08:00
parent 4f0b5cca6a
commit 0275ee21b5
3 changed files with 70 additions and 26 deletions

View File

@ -792,22 +792,43 @@ const open = async (id: number,propertynew :number) => {
businessType: 'PROJECT_ORDER'
}
formData.value.operateLogs = (await getOperateLogPage(logParams)).list
if (formData.value.operateLogs && formData.value.operateLogs.length >= 2) {
if(formData.value.operateLogs.length ==2){
const approveLog = formData.value.operateLogs[0]
formData.value.approveTime = approveLog.startTime
formData.value.approveUserName = approveLog.userNickname
}else{
const auditLog = formData.value.operateLogs[0]
formData.value.auditTime = auditLog.startTime
formData.value.auditUserName = auditLog.userNickname
const approveLog = formData.value.operateLogs[1]
formData.value.approveTime = approveLog.startTime
formData.value.approveUserName = approveLog.userNickname
}
// const auditLog = formData.value.operateLogs[3]
console.log(formData.value.operateLogs)
// if (formData.value.operateLogs && formData.value.operateLogs.length >= 2) {
// if(formData.value.operateLogs.length ==2){
// const approveLog = formData.value.operateLogs[0]
// formData.value.approveTime = approveLog.startTime
// formData.value.approveUserName = approveLog.userNickname
// }else if(formData.value.operateLogs.length ==3){
// const auditLog = formData.value.operateLogs[1]
// formData.value.auditTime = auditLog.startTime
// formData.value.auditUserName = auditLog.userNickname
// const approveLog = formData.value.operateLogs[2]
// formData.value.approveTime = approveLog.startTime
// formData.value.approveUserName = approveLog.userNickname
// }
// // const auditLog = formData.value.operateLogs[3]
// // formData.value.auditTime = auditLog.startTime
// // formData.value.auditUserName = auditLog.userNickname
// }
if (formData.value.operateLogs){
const filteredLogs = formData.value.operateLogs
?.filter(item => item.type == 9)
?.sort((a, b) => new Date(b.startTime) - new Date(a.startTime))
?.[0]; // undefined
console.log(filteredLogs)
const logs = formData.value.operateLogs
?.filter(item => item.type == 10)
?.sort((a, b) => new Date(b.startTime) - new Date(a.startTime))
?.[0]; // undefined
if (logs){
formData.value.auditTime = logs.startTime
formData.value.auditUserName = logs.userNickname
}
if (filteredLogs){
formData.value.approveTime = filteredLogs.startTime
formData.value.approveUserName = filteredLogs.userNickname
}
}
formData.value.propertynew = propertynew;
// loading .value = false;

View File

@ -99,7 +99,19 @@ onMounted(async () => {
queryParams.subOrDetailName=getStoredSearchValue()
await getListData();
});
// onShow(async () => {
// const today = new Date();
// const year = today.getFullYear();
// const month = String(today.getMonth() + 1).padStart(2, "0");
// const day = String(today.getDate()).padStart(2, "0");
// isFinish.value = false;
// isLoading.value = false;
// queryParams.pageNo = 1;
// todayStr.value = `${year}-${month}-${day}`;
// searchVal.value=getStoredSearchValue()
// queryParams.subOrDetailName=getStoredSearchValue()
// await getListData();
// });
const isScanning = ref(false)
const handleDetail = async (item) => {
@ -253,7 +265,7 @@ const handleSearch = async (e) => {
<view class="label">零件名称: {{ item.materialName }}</view>
</view>
<view class="row-item">
<view class="label" >派工工序: <span style="font-weight: bold;">{{ item.procedureName }}</span></view>
<view class="label" >派工工序: {{ item.procedureName }}</view>
</view>
</view>
@ -280,7 +292,7 @@ const handleSearch = async (e) => {
<view
class="product-item"
:style="
item.endTime < todayStr
item.endTime < todayStr && props.orderState != '2'
? 'color:red'
: null
"

View File

@ -81,6 +81,14 @@
//
const handleComplate = async () => {
// if (historyList.value.length<=0){
// uni.showToast({
// icon: 'none',
// duration: 3000,
// title: ',',
// })
// return
// }
isLoading.value = true;
const params = {
id: detailInfo.value?.id,
@ -223,12 +231,10 @@
reportPrice.value = price.toFixed(2)
}
}
}else {
weight.value=0.00
reportPrice.value=0.00
}
}
const handleWidhtChange =async (val) => {
if (val){
widht.value=parseFloat(val).toFixed(2)
if (matType.value=='1'||matType.value=='3'){
if (length.value>0&&hight.value>0){
@ -239,7 +245,9 @@
}
}
}
}
const handleHightChange =async (val) => {
if (val){
hight.value=parseFloat(val).toFixed(2)
if (matType.value=='1'||matType.value=='3'){
if (widht.value>0&&length.value>0){
@ -261,14 +269,17 @@
reportPrice.value= price.toFixed(2)
}
}
}
}
const handleWeightChange =async (val) => {
if (val){
weight.value=parseFloat(val).toFixed(2)
var price = weight.value * detailInfo.value.price;
reportPrice.value= price.toFixed(2)
}
}
const onClear= async (type)=>{
console.log(type)
uni.hideKeyboard()
weight.value=0.00
reportPrice.value= 0.00
@ -457,13 +468,13 @@
</view>
<view class="item">
<view class="label"><span class="star">*</span>重量</view>
<uni-easyinput class="val" type="number" v-model="weight" clearable @change="handleWeightChange"
<uni-easyinput class="val" type="number" v-model="weight" clearable @change="handleWeightChange" @clear="onClear('weight')"
placeholder="请输入重量"></uni-easyinput>
<view class="unit" >Kg</view>
</view>
<view class="item">
<view class="label"><span class="star">*</span>总价</view>
<uni-easyinput class="val" type="number" v-model="reportPrice" clearable
<uni-easyinput class="val" type="number" v-model="reportPrice" clearable @clear="onClear('reportPrice')"
placeholder="请输入总价"></uni-easyinput>
<view class="unit" ></view>
</view>