|
@@ -1,11 +1,17 @@
|
|
<template>
|
|
<template>
|
|
<div class="distribution">
|
|
<div class="distribution">
|
|
<van-nav-bar title="报工" left-text="返回" @click-left="back" fixed left-arrow />
|
|
<van-nav-bar title="报工" left-text="返回" @click-left="back" fixed left-arrow />
|
|
- <div class="distribution_header">
|
|
|
|
|
|
+ <van-cell title="报工日期" :value="reportDate" @click="reportDateShow = true" is-link>
|
|
|
|
+ </van-cell>
|
|
|
|
+ <van-cell title="产品名称" :value="reportForm.product_name"></van-cell>
|
|
|
|
+ <van-cell :title="reportForm.plan_type == 0?'排产工单号':'任务变更通知号'" :value="reportForm.plan_type == 0 ? reportForm.product_scheduling_num : reportForm.task_change_notice_num"></van-cell>
|
|
|
|
+ <van-cell title="计划工期" :value="reportForm.start_date+'至'+(reportForm.end_date==null?' ':reportForm.end_date)"></van-cell>
|
|
|
|
+ <!-- <div class="distribution_header">
|
|
|
|
+
|
|
<div>{{ reportForm.product_name }}<span style="float:right;color:#20a0ff;">{{reportDate }}</span> </div>
|
|
<div>{{ reportForm.product_name }}<span style="float:right;color:#20a0ff;">{{reportDate }}</span> </div>
|
|
<div>{{ reportForm.plan_type == 0 ? reportForm.product_scheduling_num : reportForm.task_change_notice_num }}</div>
|
|
<div>{{ reportForm.plan_type == 0 ? reportForm.product_scheduling_num : reportForm.task_change_notice_num }}</div>
|
|
<div>{{ reportForm.start_date }}至{{ reportForm.end_date }}</div>
|
|
<div>{{ reportForm.start_date }}至{{ reportForm.end_date }}</div>
|
|
- </div>
|
|
|
|
|
|
+ </div> -->
|
|
<div class="distribution_con">
|
|
<div class="distribution_con">
|
|
<van-form @submit="onSubmit">
|
|
<van-form @submit="onSubmit">
|
|
<van-cell-group inset>
|
|
<van-cell-group inset>
|
|
@@ -48,8 +54,7 @@
|
|
</van-cell>
|
|
</van-cell>
|
|
</van-cell-group>
|
|
</van-cell-group>
|
|
<div style="margin: 16px;">
|
|
<div style="margin: 16px;">
|
|
- <van-button round block type="primary" native-type="submit" :loading="saving"
|
|
|
|
- :disabled="reportForm.finishNum == 0">
|
|
|
|
|
|
+ <van-button round block type="primary" native-type="submit" :loading="saving">
|
|
提交
|
|
提交
|
|
</van-button>
|
|
</van-button>
|
|
<p v-if="reportForm.canBeDeleted" @click="deleteReport" style="margin:16px;text-align:center;color:#666;">删除</p>
|
|
<p v-if="reportForm.canBeDeleted" @click="deleteReport" style="margin:16px;text-align:center;color:#666;">删除</p>
|
|
@@ -68,6 +73,8 @@
|
|
</template>
|
|
</template>
|
|
</van-picker>
|
|
</van-picker>
|
|
</van-popup>
|
|
</van-popup>
|
|
|
|
+ <!-- 日期 -->
|
|
|
|
+ <van-calendar v-model="reportDateShow" :min-date="minDate" @confirm="reportDateOnConfirm" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -78,6 +85,8 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ minDate: new Date(2023, 0, 1),
|
|
|
|
+ reportDateShow: false,
|
|
reportId: null,
|
|
reportId: null,
|
|
reportDate: null,
|
|
reportDate: null,
|
|
checkerOptionList: [],
|
|
checkerOptionList: [],
|
|
@@ -97,10 +106,27 @@ export default {
|
|
created() { },
|
|
created() { },
|
|
mounted() {
|
|
mounted() {
|
|
this.reportDate = this.$route.query.date;
|
|
this.reportDate = this.$route.query.date;
|
|
- this.reportId = this.$route.query.ohterId;
|
|
|
|
|
|
+ if (this.reportDate == null) {
|
|
|
|
+ //初始化为当天
|
|
|
|
+ this.reportDate = this.formatDate(new Date());
|
|
|
|
+ }
|
|
|
|
+ this.reportId = this.$route.query.otherId;
|
|
|
|
+
|
|
this.getMyPlanProcedureList();
|
|
this.getMyPlanProcedureList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ formatDate(date) {
|
|
|
|
+ // 中国标准时间转成 YYYY-MM-DD
|
|
|
|
+ const year = date.getFullYear();
|
|
|
|
+ const month = date.getMonth() + 1;
|
|
|
|
+ const day = date.getDate();
|
|
|
|
+ return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;
|
|
|
|
+ },
|
|
|
|
+ reportDateOnConfirm(date) {
|
|
|
|
+ this.reportDateShow = false;
|
|
|
|
+ this.reportDate = this.formatDate(date);
|
|
|
|
+ this.getMyPlanProcedureList();
|
|
|
|
+ },
|
|
deleteReport() {
|
|
deleteReport() {
|
|
this.$dialog.confirm({
|
|
this.$dialog.confirm({
|
|
title: '删除报工',
|
|
title: '删除报工',
|
|
@@ -160,11 +186,12 @@ export default {
|
|
isTerminated: this.reportForm.isTerminated,
|
|
isTerminated: this.reportForm.isTerminated,
|
|
steelNumArray: JSON.stringify(this.reportForm.checkedSteelNum),
|
|
steelNumArray: JSON.stringify(this.reportForm.checkedSteelNum),
|
|
finishNum: this.reportForm.finishNum,
|
|
finishNum: this.reportForm.finishNum,
|
|
- isFinish: this.reportForm.isFinish
|
|
|
|
|
|
+ isFinish: this.reportForm.isFinish,
|
|
|
|
+ createDate: this.reportDate
|
|
};
|
|
};
|
|
- const { id, reportBoolean, ohterId } = this.$route.query;
|
|
|
|
- if(reportBoolean == 'true') {
|
|
|
|
- postData.id = ohterId;
|
|
|
|
|
|
+ const { id, reportBoolean, otherId } = this.$route.query;
|
|
|
|
+ if(this.reportId) {
|
|
|
|
+ postData.id = this.reportId;
|
|
}
|
|
}
|
|
if (this.reportForm.isFinish) {
|
|
if (this.reportForm.isFinish) {
|
|
if (this.reportForm.check_type != 0) {
|
|
if (this.reportForm.check_type != 0) {
|
|
@@ -197,9 +224,6 @@ export default {
|
|
id: id,
|
|
id: id,
|
|
inputSteelNum:this.inputSteelNum
|
|
inputSteelNum:this.inputSteelNum
|
|
}
|
|
}
|
|
- if(reportBoolean == 'true') {
|
|
|
|
- params.createDate = date
|
|
|
|
- }
|
|
|
|
if (this.reportDate) {
|
|
if (this.reportDate) {
|
|
params.createDate = this.reportDate;
|
|
params.createDate = this.reportDate;
|
|
}
|
|
}
|
|
@@ -208,6 +232,10 @@ export default {
|
|
.then(res => {
|
|
.then(res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
this.reportForm = res.data;
|
|
this.reportForm = res.data;
|
|
|
|
+ if (this.reportForm.oldReport != null) {
|
|
|
|
+ //日报已存在,赋予id
|
|
|
|
+ this.reportId = this.reportForm.oldReport.id;
|
|
|
|
+ }
|
|
this.oldPlanSteelStampNumberList=this.reportForm.planSteelStampNumberList
|
|
this.oldPlanSteelStampNumberList=this.reportForm.planSteelStampNumberList
|
|
//当日选中的钢印号,默认勾选上
|
|
//当日选中的钢印号,默认勾选上
|
|
this.reportForm.checkedSteelNum = this.reportForm.steelNumArray==null?[]:this.reportForm.steelNumArray;
|
|
this.reportForm.checkedSteelNum = this.reportForm.steelNumArray==null?[]:this.reportForm.steelNumArray;
|