|
|
|
@ -1,27 +1,40 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<view class="container">
|
|
|
|
<view>
|
|
|
|
|
|
|
|
<u-sticky
|
|
|
|
|
|
|
|
class="sticky"
|
|
|
|
|
|
|
|
:custom-nav-height="0"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<u-navbar
|
|
|
|
|
|
|
|
title="生产报工"
|
|
|
|
|
|
|
|
bg-color="transparent"
|
|
|
|
|
|
|
|
:title-style="{ fontWeight: 'bold' }"
|
|
|
|
|
|
|
|
:auto-back="true"
|
|
|
|
|
|
|
|
safe-area-inset-top
|
|
|
|
|
|
|
|
placeholder
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</u-sticky>
|
|
|
|
<uni-card :is-shadow="false" is-full>
|
|
|
|
<uni-card :is-shadow="false" is-full>
|
|
|
|
<text class="uni-h6">如个人无法填报,请寻找主管代为报工</text>
|
|
|
|
<el-text type="warning" class="uni-h6">如个人无法填报,请寻找主管代为报工</el-text>
|
|
|
|
</uni-card>
|
|
|
|
</uni-card>
|
|
|
|
<view class="example">
|
|
|
|
<view class="container">
|
|
|
|
<!-- 自定义表单校验 -->
|
|
|
|
<!-- 自定义表单校验 -->
|
|
|
|
<uni-forms ref="customForm" :rules="customRules" labelWidth="60px" :modelValue="customFormData">
|
|
|
|
<uni-forms ref="customForm" :rules="customRules" label-width="75px" :modelValue="customFormData">
|
|
|
|
<uni-forms-item label="工序" required name="orgType">
|
|
|
|
<uni-forms-item label="工序" required name="orgType">
|
|
|
|
<uni-data-checkbox v-model="customFormData.orgType" :localdata="processTypes()" @change="handleOrgTypeChange" />
|
|
|
|
<uni-data-checkbox v-model="customFormData.orgType" :localdata="processTypes()" @change="handleOrgTypeChange" />
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-forms-item>
|
|
|
|
<uni-forms-item label="班别" required name="groupType">
|
|
|
|
<uni-forms-item label="班别" required name="groupType" label-width="75px">
|
|
|
|
<uni-data-checkbox v-model="customFormData.groupType" :localdata="groupTypes()" />
|
|
|
|
<uni-data-checkbox v-model="customFormData.groupType" :localdata="groupTypes()" />
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-forms-item>
|
|
|
|
<uni-forms-item label="日期" required name="reportDateString">
|
|
|
|
<uni-forms-item label="日期" required name="reportDateString" label-width="75px">
|
|
|
|
<uni-datetime-picker v-model="customFormData.reportDateString" type="date" :clear-icon="true" @change="maskClick" />
|
|
|
|
<uni-datetime-picker v-model="customFormData.reportDateString" type="date" :clear-icon="true" @change="maskClick" />
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-forms-item>
|
|
|
|
<uni-forms-item label="工位" required name="orgId">
|
|
|
|
<uni-forms-item label="工位" required name="orgId" label-width="75px">
|
|
|
|
<uni-data-select v-model="customFormData.orgId" :localdata="orgIdList"></uni-data-select>
|
|
|
|
<uni-data-select v-model="customFormData.orgId" :localdata="orgIdList"></uni-data-select>
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-forms-item>
|
|
|
|
<uni-forms-item label="计时时段" name="reportTime">
|
|
|
|
<uni-forms-item label="计时时段" name="reportTime" label-width="75px">
|
|
|
|
<uni-easyinput type="text" v-model="customFormData.reportTime" placeholder="如:8:00-12:00" />
|
|
|
|
<uni-easyinput type="text" v-model="customFormData.reportTime" placeholder="如:8:00-12:00" />
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-forms-item>
|
|
|
|
<uni-forms-item label="总计时/h" required name="totalTime">
|
|
|
|
<uni-forms-item label="总计时/h" required name="totalTime" label-width="75px">
|
|
|
|
<uni-easyinput type="number" v-model="customFormData.totalTime" placeholder="" />
|
|
|
|
<uni-easyinput type="number" v-model="customFormData.totalTime" placeholder="" />
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-forms-item>
|
|
|
|
<uni-group title="card 模式" mode="card" v-for="(item,index) in customFormData.produceReportDetails" :key="item.id"
|
|
|
|
<uni-group title="card 模式" mode="card" v-for="(item,index) in customFormData.produceReportDetails" :key="item.id"
|
|
|
|
@ -29,12 +42,12 @@
|
|
|
|
<template v-slot:title>
|
|
|
|
<template v-slot:title>
|
|
|
|
<view class="uni-group-title">
|
|
|
|
<view class="uni-group-title">
|
|
|
|
<uni-row>
|
|
|
|
<uni-row>
|
|
|
|
<uni-col :span="20">
|
|
|
|
<uni-col :span="22">
|
|
|
|
<uni-forms-item label="产品" required name="planId">
|
|
|
|
<uni-forms-item label="产品" required name="planId" label-width="50px">
|
|
|
|
<uni-data-select v-model="customFormData.produceReportDetails[index].planId" :localdata="planProductList"></uni-data-select>
|
|
|
|
<uni-data-select v-model="customFormData.produceReportDetails[index].planId" :localdata="planProductList"></uni-data-select>
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-col>
|
|
|
|
</uni-col>
|
|
|
|
<uni-col :span="4" align="center">
|
|
|
|
<uni-col :span="2" class="u-p-t-10">
|
|
|
|
<!-- <button class="button" size="mini" type="warn" @click="del(item.id)">删除</button>-->
|
|
|
|
<!-- <button class="button" size="mini" type="warn" @click="del(item.id)">删除</button>-->
|
|
|
|
<uni-icons type="trash" size="25" color="red" @click="del(item.id)"></uni-icons>
|
|
|
|
<uni-icons type="trash" size="25" color="red" @click="del(item.id)"></uni-icons>
|
|
|
|
</uni-col>
|
|
|
|
</uni-col>
|
|
|
|
@ -42,9 +55,9 @@
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<uni-row>
|
|
|
|
<uni-row>
|
|
|
|
<uni-col :span="12">
|
|
|
|
<uni-col :span="12" class="u-p-r-30">
|
|
|
|
<uni-forms-item label="成品数" required name="qualityNumber">
|
|
|
|
<uni-forms-item label="成品数" required name="qualityNumber">
|
|
|
|
<uni-easyinput type="number" v-model="customFormData.produceReportDetails[index].qualityNumber" @change="changeNumber(item.id)"/>
|
|
|
|
<uni-easyinput type="number" v-model="customFormData.produceReportDetails[index].qualityNumber" @change="changeNumber(item.id)"/>
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-col>
|
|
|
|
</uni-col>
|
|
|
|
<uni-col :span="12">
|
|
|
|
<uni-col :span="12">
|
|
|
|
@ -54,7 +67,7 @@
|
|
|
|
</uni-col>
|
|
|
|
</uni-col>
|
|
|
|
</uni-row>
|
|
|
|
</uni-row>
|
|
|
|
<uni-row>
|
|
|
|
<uni-row>
|
|
|
|
<uni-col :span="12">
|
|
|
|
<uni-col :span="12" class="u-p-r-30">
|
|
|
|
<uni-forms-item label="总数" name="totalNumber">
|
|
|
|
<uni-forms-item label="总数" name="totalNumber">
|
|
|
|
<uni-easyinput disabled v-model="customFormData.produceReportDetails[index].totalNumber" placeholder="" />
|
|
|
|
<uni-easyinput disabled v-model="customFormData.produceReportDetails[index].totalNumber" placeholder="" />
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-forms-item>
|
|
|
|
@ -66,7 +79,7 @@
|
|
|
|
</uni-col>
|
|
|
|
</uni-col>
|
|
|
|
</uni-row>
|
|
|
|
</uni-row>
|
|
|
|
<uni-row>
|
|
|
|
<uni-row>
|
|
|
|
<uni-col :span="12">
|
|
|
|
<uni-col :span="12" class="u-p-r-30">
|
|
|
|
<uni-forms-item label="打包数" name="packageNumber">
|
|
|
|
<uni-forms-item label="打包数" name="packageNumber">
|
|
|
|
<uni-easyinput type="number" v-model="customFormData.produceReportDetails[index].packageNumber" />
|
|
|
|
<uni-easyinput type="number" v-model="customFormData.produceReportDetails[index].packageNumber" />
|
|
|
|
</uni-forms-item>
|
|
|
|
</uni-forms-item>
|
|
|
|
@ -79,12 +92,15 @@
|
|
|
|
</uni-row>
|
|
|
|
</uni-row>
|
|
|
|
</uni-group>
|
|
|
|
</uni-group>
|
|
|
|
</uni-forms>
|
|
|
|
</uni-forms>
|
|
|
|
<view class="button-group">
|
|
|
|
<view class="u-flex justify-end">
|
|
|
|
<button type="primary" size="mini" @click="add">
|
|
|
|
<view class="u-flex u-m-t-30">
|
|
|
|
<uni-icons type="plus" size="15"></uni-icons>
|
|
|
|
<u-button type="primary" @click="add" class="u-m-r-30">
|
|
|
|
新增产品
|
|
|
|
<uni-icons type="plus" class="u-m-r-10"/>新增产品
|
|
|
|
</button>
|
|
|
|
</u-button>
|
|
|
|
<button type="primary" size="mini" @click="submit('customForm')">保存</button>
|
|
|
|
<u-button type="success" @click="submit('customForm')">
|
|
|
|
|
|
|
|
<uni-icons type="checkbox" class="u-m-r-10"/>保存
|
|
|
|
|
|
|
|
</u-button>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
@ -147,12 +163,10 @@ export default {
|
|
|
|
updateId: undefined
|
|
|
|
updateId: undefined
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onLoad() {
|
|
|
|
onLoad() {
|
|
|
|
this.getOrgIdList()
|
|
|
|
this.getOrgIdList()
|
|
|
|
// this.getPlanProductList()
|
|
|
|
// this.getPlanProductList()
|
|
|
|
this.updateId = tab.getParams()
|
|
|
|
this.updateId = tab.getParams();
|
|
|
|
if(this.updateId){
|
|
|
|
if(this.updateId){
|
|
|
|
this.disableEnable = true
|
|
|
|
this.disableEnable = true
|
|
|
|
//请求编辑数据
|
|
|
|
//请求编辑数据
|
|
|
|
@ -184,7 +198,6 @@ export default {
|
|
|
|
submit(ref) {
|
|
|
|
submit(ref) {
|
|
|
|
if(this.customFormData.reportDateString.length<11)this.customFormData.reportDateString+=' 00:00:00';
|
|
|
|
if(this.customFormData.reportDateString.length<11)this.customFormData.reportDateString+=' 00:00:00';
|
|
|
|
this.customFormData.reportType = '个人';
|
|
|
|
this.customFormData.reportType = '个人';
|
|
|
|
console.log(this.customFormData);
|
|
|
|
|
|
|
|
this.$refs[ref].validate().then(res => {
|
|
|
|
this.$refs[ref].validate().then(res => {
|
|
|
|
var ok = 1;
|
|
|
|
var ok = 1;
|
|
|
|
if(this.customFormData.produceReportDetails && this.customFormData.produceReportDetails.length > 0) {
|
|
|
|
if(this.customFormData.produceReportDetails && this.customFormData.produceReportDetails.length > 0) {
|
|
|
|
@ -220,7 +233,6 @@ export default {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch(err => {
|
|
|
|
}).catch(err => {
|
|
|
|
console.log('err', err);
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
maskClick(e){
|
|
|
|
maskClick(e){
|
|
|
|
@ -290,34 +302,40 @@ export default {
|
|
|
|
(Number(this.customFormData.produceReportDetails[index].qualityNumber)*100/Number(this.customFormData.produceReportDetails[index].totalNumber)).toFixed(2);
|
|
|
|
(Number(this.customFormData.produceReportDetails[index].qualityNumber)*100/Number(this.customFormData.produceReportDetails[index].totalNumber)).toFixed(2);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleOrgTypeChange(e){
|
|
|
|
handleOrgTypeChange(e){
|
|
|
|
console.log(e)
|
|
|
|
|
|
|
|
this.getPlanProductList()
|
|
|
|
this.getPlanProductList()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.example {
|
|
|
|
.sticky {
|
|
|
|
padding: 15px;
|
|
|
|
background: linear-gradient(180deg, #d4e9ff 0%, #f3f9ff 100%);
|
|
|
|
background-color: #fff;
|
|
|
|
backdrop-filter: blur(27.18px);
|
|
|
|
}
|
|
|
|
box-shadow: 0 1px 1px 0 rgba(0, 72, 145, 0.1),
|
|
|
|
|
|
|
|
0 0.5px 0 0 rgba(0, 0, 0, 0.1);
|
|
|
|
.button-group {
|
|
|
|
}
|
|
|
|
margin-top: 15px;
|
|
|
|
.container {
|
|
|
|
display: flex;
|
|
|
|
padding: 15px;
|
|
|
|
justify-content: space-around;
|
|
|
|
background-color: #fff;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.button {
|
|
|
|
.uniui-plus:before{
|
|
|
|
display: flex;
|
|
|
|
color: #ffffff
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
height: 35px;
|
|
|
|
.uniui-checkbox:before{
|
|
|
|
line-height: 35px;
|
|
|
|
color: #ffffff
|
|
|
|
margin-left: 10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.u-button {
|
|
|
|
.uni-group-title{
|
|
|
|
height: 35px;
|
|
|
|
padding-top: 5px;
|
|
|
|
width: auto;
|
|
|
|
background-color: #f4c7c7;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.uni-group-title{
|
|
|
|
|
|
|
|
height: 55px;
|
|
|
|
|
|
|
|
padding: 10px;
|
|
|
|
|
|
|
|
background: linear-gradient(180deg, #d4e9ff 0%, #f3f9ff 100%);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.uni-group--card {
|
|
|
|
|
|
|
|
margin :0
|
|
|
|
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|