Browse Source

1、工序报工-前端表单页面优化

master
bjang03 7 months ago
parent
commit
82de2b6a57
  1. 41
      src/pages/mes/workScheduling/processReportForm.vue
  2. 26
      src/pages/mes/workScheduling/processReportPeopleCheck.vue
  3. 6
      src/pages/mes/workScheduling/workScheduling.vue

41
src/pages/mes/workScheduling/processReportForm.vue

@ -21,19 +21,26 @@
</view>
</view>
<view v-for="item in list" class="list">
<view v-for="(item,index) in list" class="list">
<view class="item">
<view class="dec">
<view>&nbsp;员工姓名</view>
<view>&nbsp;&nbsp;&nbsp;{{ item.personName }}</view>
</view>
<view class="dec">
<view><span style="color: red">*</span>报工数量</view>
<view><input class="uni-input" type="number" inputmode="numeric" placeholder="请输入报工数量" v-model="item.reportCount" /></view>
</view>
<view class="dec">
<view><span style="color: red">*</span>报工工时</view>
<view><input class="uni-input" type="number" inputmode="numeric" placeholder="请输入报工工时" v-model="item.workTerm" /></view>
<view style="width: 100%">
<view class="dec" style="width: 90%">
<view>&nbsp;员工姓名</view>
<view>&nbsp;&nbsp;&nbsp;{{ item.personName }}</view>
</view>
<view class="dec" style="width: 90%">
<view><span style="color: red">*</span>报工数量</view>
<view><input class="uni-input" type="number" inputmode="numeric" placeholder="请输入报工数量" v-model="item.reportCount" /></view>
</view>
<view class="dec" style="width: 90%">
<view><span style="color: red">*</span>报工工时</view>
<view><input class="uni-input" type="number" inputmode="numeric" placeholder="请输入报工工时" v-model="item.workTerm" /></view>
</view>
</view>
<view style="width: 45rpx;" @click="remove(index)">
<image style="width: 45rpx;height: 45rpx;" src="/static/icons/close-circle.svg"></image>
</view>
</view>
</view>
</view>
@ -52,6 +59,7 @@ import { onShow } from "@dcloudio/uni-app"
import { getCurrentInstance, ref } from "vue"
/* 引入API */
import * as workSchedulingApi from "@/api/mes/workScheduling"
import { _confirm, _toast } from "@/utils/common"
const { proxy } = getCurrentInstance()
let show = ref(false)
@ -87,7 +95,15 @@ function openDetail(item: any) {
console.log(item)
// proxy.$tab.navigateTo(`/pages/mes/orderDapPlan/detail?obj=${item}`)
}
function remove(index){
if (list.value.length > 1) {
_confirm('确定要删除吗?',function(){
list.value.splice(index, 1)
})
}else{
_toast("最少需要上报一项")
}
}
/* 通用方法 */
onShow(() => {
list.value = uni.getStorageSync("processReportList")
@ -165,7 +181,6 @@ function bindDateChange(e){
}
&:nth-child(2) {
color: #999999;
flex: 1;
width: 0px;
word-wrap: break-word;

26
src/pages/mes/workScheduling/processReportPeopleCheck.vue

@ -24,11 +24,12 @@
<script setup lang="ts">
/* 初始化 */
import { onShow } from "@dcloudio/uni-app"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { getCurrentInstance, ref } from "vue"
/* 引入API */
import tags from "@components/tags/index.vue"
import * as workSchedulingApi from "@/api/mes/workScheduling"
import * as workSchedulingListApi from "@/api/mes/workScheduling"
const { proxy } = getCurrentInstance()
@ -39,6 +40,9 @@ tags.data = ref([
}
])
const data = ref({
planDayCode: '',
processCode: '',
teamCode: '',
searchValue: ''
})
let show = false
@ -47,17 +51,13 @@ let checked = []
const status = ref('loadmore')
/* 列表数据集 */
const list = ref([])
function checkChange(checkedArray: string | any[]) {
if (checkedArray.length == 0){
show = true
}
checked = checkedArray
}
/* 列表调用API方法 */
async function getList() {
if (status.value === 'nomore') return
status.value = 'loading'
proxy.$modal.loading('加载中')
// "{"status":"1","remark":null,"planMasterCode":"PO20240429-0015","schedulingCode":"9bb4ab0cfcc14e3284833506b5041571","productCode":"015.886-117","productName":null,"workroomCode":"work1","lineCode":"work1-line1","prouteCode":"015.886-117","planCount":25,"finishCount":0,"qualifiedCount":null,"unqualifiedCount":null,"flagDo":"0","planSubCode":null,"workingNode":"QD_HJ_01","workingTaskSort":1,"formType":"BATCH","workSort":0,"currentWorkstation":null,"planStartTime":null,"planEndTime":1714388234000,"realStartTime":null,"realFinishedTime":null,"qualityFormNo":null,"reason":null,"planNoDay":null,"batchCode":"M015.886-117-001","id":61,"createTime":1714370517000,"creator":"1"}"
await workSchedulingApi.getConfigProcessWorker({
planDayCode: "PO20240429-0008",
processCode: "DLJ_CY_01",
@ -76,7 +76,9 @@ async function getList() {
})
proxy.$modal.closeLoading()
}
function checkChange(checkedArray) {
checked = checkedArray
}
/* 打开详情页 */
function openDetail(item: any) {
console.log(item)
@ -89,11 +91,19 @@ onShow(() => {
getList()
})
function onSubmit() {
if (checked.length == 0){
show = true
}
uni.setStorageSync("processReportList", checked)
uni.redirectTo({
url: "./processReportForm"
})
}
onLoad((option) => {
debugger
data.value = JSON.parse(option.params)
debugger
})
</script>
<style lang="scss" scoped>

6
src/pages/mes/workScheduling/workScheduling.vue

@ -67,6 +67,7 @@
<u-button type="primary" size="medium" @click="receiveBasicItem(item)" style="margin-left: 5px;width: 20px;">领料</u-button>
<u-button type="warning" size="medium" @click="addBasicItem(item)" style="margin-left: 5px;width: 20px;">补料</u-button>
<u-button type="success" size="medium" @click="completeHandle(item)" style="margin-left: 5px;width: 20px;">完工</u-button>
<u-button type="success" size="medium" @click="reportHandle(item)" style="margin-left: 5px;width: 20px;">报工</u-button>
</view>
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
@ -288,6 +289,11 @@ function completeHandle(item) {
// proxy.$modal.closeLoading()
// })
}
function reportHandle(item) {
uni.redirectTo({
url: "/pages/mes/workScheduling/processReportPeopleCheck?params="+JSON.stringify(item)
})
}
//
function callBasicItem(item){
console.log(item)

Loading…
Cancel
Save