小程序下料报工更改

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' businessType: 'PROJECT_ORDER'
} }
formData.value.operateLogs = (await getOperateLogPage(logParams)).list formData.value.operateLogs = (await getOperateLogPage(logParams)).list
if (formData.value.operateLogs && formData.value.operateLogs.length >= 2) { console.log(formData.value.operateLogs)
if(formData.value.operateLogs.length ==2){ // if (formData.value.operateLogs && formData.value.operateLogs.length >= 2) {
const approveLog = formData.value.operateLogs[0] // if(formData.value.operateLogs.length ==2){
formData.value.approveTime = approveLog.startTime // const approveLog = formData.value.operateLogs[0]
formData.value.approveUserName = approveLog.userNickname // formData.value.approveTime = approveLog.startTime
}else{ // formData.value.approveUserName = approveLog.userNickname
const auditLog = formData.value.operateLogs[0] // }else if(formData.value.operateLogs.length ==3){
formData.value.auditTime = auditLog.startTime // const auditLog = formData.value.operateLogs[1]
formData.value.auditUserName = auditLog.userNickname // formData.value.auditTime = auditLog.startTime
const approveLog = formData.value.operateLogs[1] // formData.value.auditUserName = auditLog.userNickname
formData.value.approveTime = approveLog.startTime // const approveLog = formData.value.operateLogs[2]
formData.value.approveUserName = approveLog.userNickname // formData.value.approveTime = approveLog.startTime
} // formData.value.approveUserName = approveLog.userNickname
// const auditLog = formData.value.operateLogs[3] // }
// formData.value.auditTime = auditLog.startTime // // const auditLog = formData.value.operateLogs[3]
// formData.value.auditUserName = auditLog.userNickname // // 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; formData.value.propertynew = propertynew;
// loading .value = false; // loading .value = false;

View File

@ -99,7 +99,19 @@ onMounted(async () => {
queryParams.subOrDetailName=getStoredSearchValue() queryParams.subOrDetailName=getStoredSearchValue()
await getListData(); 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 isScanning = ref(false)
const handleDetail = async (item) => { const handleDetail = async (item) => {
@ -253,7 +265,7 @@ const handleSearch = async (e) => {
<view class="label">零件名称: {{ item.materialName }}</view> <view class="label">零件名称: {{ item.materialName }}</view>
</view> </view>
<view class="row-item"> <view class="row-item">
<view class="label" >派工工序: <span style="font-weight: bold;">{{ item.procedureName }}</span></view> <view class="label" >派工工序: {{ item.procedureName }}</view>
</view> </view>
</view> </view>
@ -280,7 +292,7 @@ const handleSearch = async (e) => {
<view <view
class="product-item" class="product-item"
:style=" :style="
item.endTime < todayStr item.endTime < todayStr && props.orderState != '2'
? 'color:red' ? 'color:red'
: null : null
" "

View File

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