按新要求修改
This commit is contained in:
parent
662bed71ee
commit
48adb5b70a
@ -98,6 +98,7 @@ public class PgMasterLineDO extends BaseDO {
|
||||
* 检验人
|
||||
*/
|
||||
private Long detilUser;
|
||||
private Long dispatchDetailId;
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
|
@ -87,6 +87,8 @@ public class TaskDispatchDetailDO extends BaseDO {
|
||||
private Long detailOwnerId;
|
||||
//是否过程检, 否-Y 是 -N
|
||||
private String testYn;
|
||||
//是否过程检, 否-Y 是 -N
|
||||
private Integer checkYn;
|
||||
/**
|
||||
* 预计结束日期
|
||||
*/
|
||||
|
@ -79,7 +79,7 @@ public interface PgMasterService {
|
||||
*/
|
||||
List<PgMasterLineDO> getPgMasterLineListByZlPgId(Integer zlPgId);
|
||||
|
||||
Boolean insertPgList(Long task_id,Long project_id,Long bomMxId,Long procedureId);
|
||||
Boolean insertPgList(Long task_id,Long project_id,Long bomMxId,TaskDispatchDetailDO taskDispatchDetailDOk);
|
||||
|
||||
List<PgMasterLineDO> searchBomMx(Long task_id,Long project_id);
|
||||
|
||||
|
@ -59,7 +59,7 @@ public class PgMasterServiceImpl implements PgMasterService {
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean insertPgList(Long task_id,Long project_id,Long bomMxId,Long procedureId){
|
||||
public Boolean insertPgList(Long task_id,Long project_id,Long bomMxId,TaskDispatchDetailDO taskDispatchDetailDO){
|
||||
//213 605
|
||||
//查询BOM明细
|
||||
List<ProcessBomDO> processBomDOList = processBomMapper.selectBomMx(task_id,project_id,bomMxId);
|
||||
@ -69,7 +69,8 @@ public class PgMasterServiceImpl implements PgMasterService {
|
||||
//bomID
|
||||
pgMasterLineDO.setBomId(o.getBomId());
|
||||
//工序id
|
||||
pgMasterLineDO.setProcedureId(procedureId);
|
||||
pgMasterLineDO.setProcedureId(taskDispatchDetailDO.getProcedureId());
|
||||
pgMasterLineDO.setDispatchDetailId(taskDispatchDetailDO.getId());
|
||||
//bom名称
|
||||
pgMasterLineDO.setBomName("BOM-"+o.getProjectSubShortName());
|
||||
//bom编号
|
||||
|
@ -510,8 +510,8 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
||||
if (CollUtil.isNotEmpty(taskDispatchDetailDO2)){
|
||||
//
|
||||
for (TaskDispatchDetailDO dispatchDetailDO : taskDispatchDetailDO2) {
|
||||
if (!dispatchDetailDO.getTestYn().equals("Y")){
|
||||
throw exception(new ErrorCode(102223_666,"上一道工序:"+dispatchDetailDO.getProcedureName() + "没有完成,请确认!"));
|
||||
if (dispatchDetailDO.getTestYn() == null || !dispatchDetailDO.getTestYn().equals("Y") ){
|
||||
throw exception(new ErrorCode(102223_666,dispatchDetailDO.getProcedureName() + "工序过程检没有完成,请确认!"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -764,8 +764,8 @@ public class TaskDispatchServiceImpl implements TaskDispatchService {
|
||||
bdgzsomthingMapper.updateById(bdgzsomthingDO);
|
||||
}
|
||||
}
|
||||
if (taskDispatchDO.getDispatchType().equals("PRODUCTION")){
|
||||
pgMasterService.insertPgList(planDO.getId(),planDO.getProjectId(),taskDispatchDO.getBomDetailId(),taskDispatchDetailDO.getProcedureId());
|
||||
if (taskDispatchDO.getDispatchType().equals("PRODUCTION") && taskDispatchDetailDO.getTestYn().equals("N")){
|
||||
pgMasterService.insertPgList(planDO.getId(),planDO.getProjectId(),taskDispatchDO.getBomDetailId(),taskDispatchDetailDO);
|
||||
}
|
||||
// if (taskDispatchDO.getDispatchType().equals("PRODUCTION") && isBomDetailProductionOver){
|
||||
//
|
||||
|
@ -190,24 +190,24 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
|
||||
</el-col> -->
|
||||
<el-col :span="6" >
|
||||
<el-form-item label="设计工时" prop="delayReason">
|
||||
{{ getWorkTime(1)}}
|
||||
<el-input class="!w-260px" :placeholder="getWorkTime(1)" :disabled="true"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="设计工期" prop="delayReason">
|
||||
{{ getWorkTime(2) }}
|
||||
<el-input class="!w-260px" :placeholder="getWorkTime(2)" :disabled="true"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" >
|
||||
<el-button v-if="formData.isOverProcess == null || formData.isOverProcess == 0" style="margin-left: 10%;" type="warning" @click="openDelay">延期</el-button>
|
||||
<el-button v-if="formData.isOverProcess == null || formData.isOverProcess == 0" style="margin-left: 10%;" type="danger" @click="overProcess">{{ overbuttonName }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="formData.isDelay == 1">
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="delayDialog || formData.isDelay">
|
||||
<el-form-item label="延期原因" prop="delayReason">
|
||||
<el-input
|
||||
v-model="formData.delayReason"
|
||||
:rows="2"
|
||||
disabled
|
||||
:disabled="!delayDialog"
|
||||
@blur="(e) => delaySubmit(e)"
|
||||
type="textarea"
|
||||
placeholder="延期原因"
|
||||
/>
|
||||
@ -216,7 +216,7 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
|
||||
</el-row>
|
||||
</el-card>
|
||||
<!--延期弹框-->
|
||||
<el-dialog
|
||||
<!-- <el-dialog
|
||||
v-model="delayDialog"
|
||||
title="延期信息填写"
|
||||
:before-close="handleClose"
|
||||
@ -237,7 +237,7 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-dialog> -->
|
||||
<!-- 表格类信息 -->
|
||||
<el-card class="hl-card-info">
|
||||
<template #header>
|
||||
@ -247,6 +247,7 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
|
||||
<el-col v-if="active != 'detail'">
|
||||
<el-button v-if="formData.isOverProcess == null || formData.isOverProcess == 0" class="hl-addbutton" type="primary" size="large" @click="onAddItem">开始</el-button>
|
||||
<el-button v-if="formData.isOverProcess == null || formData.isOverProcess == 0" style="margin-left: 30px;" type="warning" size="large" @click="sendItem()">推送</el-button>
|
||||
<el-button v-if="formData.isOverProcess == null || formData.isOverProcess == 0" style="margin-left: 30px;" type="danger" size="large" @click="overProcess">{{ overbuttonName }}</el-button>
|
||||
|
||||
<!-- <el-button class="hl-addbutton" type="primary" size="large" @click="onAddItem">新增</el-button> -->
|
||||
</el-col>
|
||||
@ -255,13 +256,21 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
|
||||
<el-form ref="processDesignProgressFormRef" :model="formData.processDesignProgressList" :rules="subFormRules" v-loading="subFormLoading" label-width="0">
|
||||
<el-table :data="formData.processDesignProgressList" class="hl-table">
|
||||
<el-table-column label="序号" align="center" type="index" width="80" fixed />
|
||||
<el-table-column label="开始时间" align="center" prop="beginTime" :formatter="dateFormatter" min-width="200"/>
|
||||
<el-table-column label="开始时间" align="center" prop="beginTime" :formatter="dateFormatter" min-width="200">
|
||||
<template #header>开始时间</template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.beginTime`" class="mb-0px!">
|
||||
<!-- <el-input-number min="0" max="100" class="!w-240px" :disabled="detailDisabled || row.id" v-model="row.progress" placeholder="请输入进度百分比" @change="verify1($index)"/>-->
|
||||
<el-date-picker :disabled-date="(date) => disabledDate1(date, row)" @change="(e) => beginTimeChange(e,row)" :disabled=" row.isOver == 1 || formData.isOverProcess == 1" :formatter="dateFormatter" v-model="row.beginTime" type="datetime" placeholder="选择开始日期"/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" align="center" prop="endTime" :formatter="dateFormatter" min-width="200">
|
||||
<template #header>结束时间</template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.endTime`" class="mb-0px!">
|
||||
<!-- <el-input-number min="0" max="100" class="!w-240px" :disabled="detailDisabled || row.id" v-model="row.progress" placeholder="请输入进度百分比" @change="verify1($index)"/>-->
|
||||
<el-date-picker :disabled-date="(date) => disabledDate(date, row)" @change="(e) => endTimeChange(e,row)" :disabled="row.isOver || formData.isOverProcess == 1" :formatter="dateFormatter" v-model="row.endTime" type="datetime" placeholder="选择结束日期"/>
|
||||
<el-date-picker :disabled-date="(date) => disabledDate(date, row)" @change="(e) => endTimeChange(e,row)" :disabled=" row.isOver == 1 || formData.isOverProcess == 1" :formatter="dateFormatter" v-model="row.endTime" type="datetime" placeholder="选择结束日期"/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -269,7 +278,7 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
|
||||
<template #header>已做时间(小时)</template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.workTime`" class="mb-0px!">
|
||||
<el-input-number :max="row.maxTime" :precision="2" class="!w-240px" :disabled="row.isOver || formData.isOverProcess == 1" v-model="row.workTime" placeholder="请输入已做时间"/>
|
||||
<el-input-number :max="row.maxTime" :precision="2" class="!w-240px" :disabled=" row.isOver == 1 || formData.isOverProcess == 1" v-model="row.workTime" placeholder="请输入已做时间"/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -296,7 +305,7 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
|
||||
<el-table-column label="备注" prop="remark" min-width="280">
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.remark`" class="mb-0px!">
|
||||
<el-input :disabled="row.hasNext || row.isOver || formData.isOverProcess == 1" v-model="row.remark" placeholder="请输入备注" />
|
||||
<el-input :disabled="row.hasNext || row.isOver == 1 || formData.isOverProcess == 1" v-model="row.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -392,9 +401,19 @@ const disabledDate = (time: Date,row : any) => {
|
||||
const tomorrow = new Date(today);
|
||||
tomorrow.setDate(tomorrow.getDate() + 1); // 设置为明天
|
||||
tomorrow.setHours(23, 59, 59, 999);
|
||||
if(row.beginTime != null){
|
||||
const beginDate = new Date(row.beginTime);
|
||||
|
||||
const beginDate = new Date(row.beginTime);
|
||||
return time.getTime() < beginDate.getTime() || time.getTime() > tomorrow.getTime();
|
||||
}else{
|
||||
return time.getTime() > tomorrow.getTime();
|
||||
}
|
||||
}
|
||||
const disabledDate1 = (time: Date,row : any) => {
|
||||
const today = new Date();
|
||||
today.setHours(23, 59, 59, 999);
|
||||
return time.getTime() > today.getTime();
|
||||
|
||||
}
|
||||
const handleClose = (done: () => void) => {
|
||||
ElMessageBox.confirm('是否退出?')
|
||||
@ -405,9 +424,40 @@ const handleClose = (done: () => void) => {
|
||||
})
|
||||
}
|
||||
const getWorkTime = (type) =>{
|
||||
if(formData.value.craftStartDate != null && formData.value.craftEndDate != null){
|
||||
const start = new Date(formData.value.craftStartDate ).getTime();
|
||||
const end = new Date( formData.value.craftEndDate).getTime();
|
||||
var beginTime = null ;
|
||||
var endTime = null
|
||||
if(processDesignType.value == 'BLUEPRINT_WORKBLANK'){
|
||||
if(formData.value.blankDate != null && formData.value.startBlankDate ){
|
||||
beginTime = formData.value.startBlankDate;
|
||||
endTime = formData.value.blankDate
|
||||
}
|
||||
|
||||
}
|
||||
if(processDesignType.value == 'BLUEPRINT_2D'){
|
||||
if(formData.value.twoDimDate != null && formData.value.startTwoDimDate ){
|
||||
beginTime = formData.value.startTwoDimDate;
|
||||
endTime = formData.value.twoDimDate
|
||||
}
|
||||
}
|
||||
if(processDesignType.value == 'BLUEPRINT_3D'){
|
||||
if(formData.value.threeDimDate != null && formData.value.startThreeDimDate != null){
|
||||
beginTime = formData.value.startThreeDimDate;
|
||||
endTime = formData.value.threeDimDate;
|
||||
|
||||
}
|
||||
}
|
||||
if(processDesignType.value == 'BLUEPRINT_FOUNDRY_TECHNOLOGY'){
|
||||
if(formData.value.craftStartDate != null && formData.value.craftEndDate != null ){
|
||||
beginTime = formData.value.craftStartDate;
|
||||
endTime = formData.value.craftEndDate
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(beginTime != null && endTime != null){
|
||||
const start = new Date(beginTime ).getTime();
|
||||
const end = new Date(endTime).getTime();
|
||||
const diffTime = Math.abs(end - start);
|
||||
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
||||
if(type == 1){
|
||||
@ -425,15 +475,44 @@ const endTimeChange = (e , row) =>{
|
||||
row.maxTime = row.workTime;
|
||||
}else{
|
||||
var endTime = new Date(e);
|
||||
var timeDiff = endTime.getTime() -row.beginTime;
|
||||
if(row.beginTime != null){
|
||||
if(new Date(row.beginTime).getTime() > endTime.getTime()){
|
||||
row.workTime = null
|
||||
message.error("开始时间不能大于结束时间,请确认!")
|
||||
}else{
|
||||
var timeDiff = endTime.getTime() -row.beginTime;
|
||||
row.workTime = timeDiff / (1000 * 60 * 60);
|
||||
row.maxTime = row.workTime;
|
||||
}
|
||||
|
||||
// 将毫秒转换为小时
|
||||
row.workTime = timeDiff / (1000 * 60 * 60);
|
||||
row.maxTime = row.workTime;
|
||||
}else{
|
||||
row.workTime = null
|
||||
row.maxTime = row.workTime;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
const delaySubmit = async() =>{
|
||||
const beginTimeChange = (e , row) =>{
|
||||
if(e == null ){
|
||||
row.workTime = null
|
||||
row.maxTime = row.workTime;
|
||||
}else{
|
||||
var beginTime = new Date(e);
|
||||
if(row.endTime != null){
|
||||
if(new Date(row.endTime).getTime() < beginTime.getTime()){
|
||||
row.workTime = null
|
||||
message.error("开始时间不能大于结束时间,请确认!")
|
||||
}else{
|
||||
var timeDiff = new Date(row.endTime).getTime() -beginTime.getTime();
|
||||
row.workTime = timeDiff / (1000 * 60 * 60);
|
||||
row.maxTime = row.workTime;
|
||||
}
|
||||
}else{
|
||||
row.workTime = null
|
||||
row.maxTime = row.workTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
const delaySubmit = async(event) =>{
|
||||
if(formData.value.delayReason == null || formData.value.delayReason.replaceAll(' ','') == ''){
|
||||
message.error("延期原因不得为空,请确认!")
|
||||
return;
|
||||
@ -478,10 +557,8 @@ const openDelay = () =>{
|
||||
}
|
||||
}
|
||||
if(processDesignType.value == 'BLUEPRINT_FOUNDRY_TECHNOLOGY'){
|
||||
console.log(formData.value.craftEndDate)
|
||||
|
||||
if(formData.value.craftEndDate != null ){
|
||||
console.log(date.getTime())
|
||||
console.log(formData.value.craftEndDate)
|
||||
if(formData.value.craftEndDate > date.getTime()){
|
||||
message.error("当前日期为正常生产周期,未达到延期条件,请确认!")
|
||||
return
|
||||
@ -495,6 +572,10 @@ const openDelay = () =>{
|
||||
|
||||
}
|
||||
const overRow = async( row :any) =>{
|
||||
if(row.beginTime == null ){
|
||||
message.error("开始时间不能为空!请确认!")
|
||||
return
|
||||
}
|
||||
if(row.endTime == null ){
|
||||
row.endTime = new Date().getTime()
|
||||
var timeDiff = row.endTime -row.beginTime;
|
||||
@ -504,8 +585,8 @@ const overRow = async( row :any) =>{
|
||||
row.maxTime = row.workTime;
|
||||
// row.workTime = row.endTime - row.
|
||||
}
|
||||
if(row.endTime == null ){
|
||||
message.error("结束时间不能为空!请确认!")
|
||||
if(new Date(row.beginTime) > new Date(row.endTime)){
|
||||
message.error("开始时间不能大于结束时间!请确认!")
|
||||
return
|
||||
}
|
||||
if(row.workTime == null
|
||||
@ -563,6 +644,10 @@ const sendItem = async() =>{
|
||||
var item = formData.value.processDesignProgressList[index];
|
||||
if(!item.hasNext){
|
||||
senIndex = index;
|
||||
if(item.beginTime == null){
|
||||
message.error("开始时间不能为空!请确认!")
|
||||
return
|
||||
}
|
||||
if(item.endTime == null){
|
||||
message.error("结束时间不能为空!请确认!")
|
||||
return
|
||||
|
@ -264,11 +264,13 @@ class="!w-260px" v-model="formData.createTime" type="date" value-format="x"
|
||||
</el-table-column>
|
||||
<el-table-column fixed label="过程检" align="center" prop="testYn" width="120px" >
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.testYn`" class="mb-0px!">
|
||||
<el-radio-group size="small" :disabled="detailDisabled||row.beginProduce != 0 || row.procedureStatus != 0" v-model="row.testYn" >
|
||||
<el-form-item :prop="`${$index}.testYns`" class="mb-0px!">
|
||||
<el-checkbox v-model="row.checkYns" @change="changeChange(row)" :disabled="detailDisabled||row.beginProduce != 0 || row.procedureStatus != 0" />
|
||||
|
||||
<!-- <el-radio-group size="small" :disabled="detailDisabled||row.beginProduce != 0 || row.procedureStatus != 0" v-model="row.testYn" >
|
||||
<el-radio-button label="N">是</el-radio-button>
|
||||
<el-radio-button label="Y">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-radio-group> -->
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -588,12 +590,24 @@ const totalTital = ref('')
|
||||
const formLoading = ref(false)
|
||||
const dialogTitle = ref('')
|
||||
const detailDisabled = ref(false)
|
||||
const changeChange = ( row) =>{
|
||||
if(row.testYn == 'N'){
|
||||
row.testYn = 'Y'
|
||||
row.checkYn = 1
|
||||
row.checkYns = false
|
||||
}else{
|
||||
row.testYn = 'N'
|
||||
row.checkYn = 0
|
||||
row.checkYns = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const changePrepTime = (type,index,row)=>{
|
||||
if(index == 0){
|
||||
formData.value.taskDispatchDetails.forEach((item)=>{
|
||||
if(item.id == null){
|
||||
console.log('sss')
|
||||
if(type == 'END'){
|
||||
item.endTime = row.endTime;
|
||||
}else{
|
||||
@ -1234,6 +1248,11 @@ const queryData = async (id?: number) => {
|
||||
checkList.value = [];
|
||||
if(formData.value.taskDispatchDetails!=null){
|
||||
formData.value.taskDispatchDetails.forEach(item=> {
|
||||
if(item.checkYn == 1){
|
||||
item.checkYns = false
|
||||
}else{
|
||||
item.checkYns = true
|
||||
}
|
||||
if ("Y" == item.isOutsourcing) {
|
||||
item.isOutsourcing = true
|
||||
} else {
|
||||
@ -1457,6 +1476,8 @@ const onAddItem = () => {
|
||||
dispatchId: undefined,
|
||||
procedureCode:'' ,
|
||||
isReport:0 ,
|
||||
checkYn : 0,
|
||||
checkYns: true,
|
||||
}
|
||||
// 遍历对象的键
|
||||
// Object.keys(procedureList.value).forEach((key) => {
|
||||
@ -1486,15 +1507,36 @@ const onAddItem = () => {
|
||||
if(add){
|
||||
|
||||
|
||||
if(procedureArrary.includes(element)){
|
||||
if(procedureArrary.includes(element) && getStartTime(element) != ''){
|
||||
row.startTime = getStartTime(element);
|
||||
}else{
|
||||
if(formData.value.taskDispatchDetails != null && formData.value.taskDispatchDetails.length > 0){
|
||||
var it = formData.value.taskDispatchDetails [0]
|
||||
console.log(it)
|
||||
if(it.startTime != null){
|
||||
row.startTime = it.startTime
|
||||
}
|
||||
}
|
||||
}
|
||||
row.isOutsourcing = true;
|
||||
row.dispatchType = 2
|
||||
row.postId = '2'
|
||||
if(procedureArrary.includes(element) && getEndTime(element) != ''){
|
||||
row.endTime = getEndTime(element)
|
||||
}else{
|
||||
if(formData.value.taskDispatchDetails != null && formData.value.taskDispatchDetails.length > 0){
|
||||
var it = formData.value.taskDispatchDetails [0]
|
||||
if(it.endTime != null){
|
||||
row.endTime = it.endTime
|
||||
}
|
||||
}else{
|
||||
row.endTime = formData.value.requiredCompletedDate
|
||||
}
|
||||
|
||||
}
|
||||
row.testYn = 'N'
|
||||
// row.isOutsourcing = true;
|
||||
// row.dispatchType = 2
|
||||
// row.postId = '2'
|
||||
row.amount = formData.value.amount
|
||||
row.dispatchId = formData.value.id
|
||||
row.endTime = formData.value.requiredCompletedDate
|
||||
list.push(row)
|
||||
row.sort = i;
|
||||
i++;
|
||||
@ -1536,6 +1578,35 @@ const getStartTime = ( element : string) =>{
|
||||
return ''
|
||||
}
|
||||
}
|
||||
const getEndTime = ( element : string) =>{
|
||||
//20250601新增开始时间判断逻辑:
|
||||
// 下料\电焊 开始日期 = 生产计划中的母模/毛坯时间
|
||||
// 编程,开粗,铣床,车床,磨床,数控开始时间=粗/精加工开始日期
|
||||
// 热处理开始=计划中的热处理
|
||||
// 火花=计划中的火花
|
||||
// 刻字,网格,深孔钻,钻孔= 粗,精加工开始日期。
|
||||
// 要求:默认的时间是可以更改的。
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
if(element == '下料' || element == '电焊'){
|
||||
return craftInfos.value[0].endDate;
|
||||
}else if(element == '编程' || element == '开粗' || element == '铣床' || element == '车床' || element == '磨床' || element == '数控1' || element == '数控2' ||element == '刻字' ||
|
||||
element == '网格' || element == '深钻孔' || element == '钻孔'
|
||||
){
|
||||
return craftInfos.value[1].endDate
|
||||
}else if(element == '热处理'){
|
||||
return craftInfos.value[2].endDate
|
||||
}else if(element == '火花'){
|
||||
return craftInfos.value[3].endDate
|
||||
}else{
|
||||
return ''
|
||||
}
|
||||
}
|
||||
type OwnerListType = {
|
||||
index: number;
|
||||
id: number;
|
||||
@ -1604,7 +1675,7 @@ const onDeleteItem = async (row,index) => {
|
||||
message.success(t('common.delSuccess'))
|
||||
}
|
||||
const handleOutsourcingChange= async (row: any) => {
|
||||
if(row.isOutsourcing == true){
|
||||
if(row.isOutsourcing == false){
|
||||
row.dispatchType = 1
|
||||
row.postId = ''
|
||||
}else{
|
||||
|
@ -3,8 +3,8 @@
|
||||
import { formatDate } from '@/utils/index'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { useLoginStore } from '@/stores/modules/login'
|
||||
|
||||
import { getTaskRepotPageAPI, getTaskDetailAPI, postOperateAPI, postOperateAPIEnd ,type ProcessDesignVO ,createProcessDesign,updateProcessDesign,getProcessDesignProgressListByProcessDesignId} from '@/services/moJuSheJiReport'
|
||||
|
||||
import { getTaskRepotPageAPI, getTaskDetailAPI, postOperateAPI, postOperateAPIEnd, type ProcessDesignVO, createProcessDesign, updateProcessDesign, getProcessDesignProgressListByProcessDesignId } from '@/services/moJuSheJiReport'
|
||||
const popup = ref<UniHelper.UniPopupInstance>()
|
||||
const userStore = useLoginStore()
|
||||
const dictInfo = userStore?.dictInfo || []
|
||||
@ -55,12 +55,12 @@
|
||||
processDesignId: detailInfo.value.id,
|
||||
}
|
||||
detailInfo.value.active = 'START'
|
||||
const data = await getTaskRepotPageAPI(params)
|
||||
const data = await getTaskRepotPageAPI(params)
|
||||
historyList.value = data.list
|
||||
if(historyList.value != null && historyList.value.length > 0){
|
||||
for (var i = 0; i < historyList.value .length; i++) {
|
||||
if (historyList.value != null && historyList.value.length > 0) {
|
||||
for (var i = 0; i < historyList.value.length; i++) {
|
||||
var item = historyList.value[i];
|
||||
if(item.isOver == 0){
|
||||
if (item.isOver == 0) {
|
||||
formObj.value = item;
|
||||
detailInfo.value.active = 'STOP'
|
||||
}
|
||||
@ -113,254 +113,260 @@
|
||||
url,
|
||||
}) */
|
||||
}
|
||||
|
||||
|
||||
const processDesignType = ref('')
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
planId: undefined,
|
||||
processDesignType: undefined,
|
||||
remark: undefined,
|
||||
status: 1,
|
||||
projectId: undefined,
|
||||
projectSubId: undefined,
|
||||
processDesignProgressList: [],
|
||||
id: undefined,
|
||||
planId: undefined,
|
||||
processDesignType: undefined,
|
||||
remark: undefined,
|
||||
status: 1,
|
||||
projectId: undefined,
|
||||
projectSubId: undefined,
|
||||
processDesignProgressList: [],
|
||||
})
|
||||
|
||||
|
||||
const formRef = ref() // 表单 Ref
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
planId: undefined,
|
||||
processDesignType: undefined,
|
||||
remark: undefined,
|
||||
status: 1,
|
||||
projectId: undefined,
|
||||
projectSubId: undefined,
|
||||
processDesignProgressList: [],
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
planId: undefined,
|
||||
processDesignType: undefined,
|
||||
remark: undefined,
|
||||
status: 1,
|
||||
projectId: undefined,
|
||||
projectSubId: undefined,
|
||||
processDesignProgressList: [],
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
const submitForm = async (operate,type) => {
|
||||
isLoading.value = true;
|
||||
try {
|
||||
formData.value.id = detailInfo.value.id
|
||||
formData.value.planId = detailInfo.value.planId
|
||||
formData.value.projectId = detailInfo.value.projectId
|
||||
formData.value.processDesignType = detailInfo.value.processDesignType
|
||||
formData.value.processDesignProgressList = historyList.value;
|
||||
const data = formData.value as unknown as ProcessDesignVO
|
||||
let processDesignId;
|
||||
if (!formData.value.id) {
|
||||
processDesignId = await createProcessDesign(data)
|
||||
} else {
|
||||
processDesignId = await updateProcessDesign(data)
|
||||
}
|
||||
await queryData(detailInfo.value.id,type)
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
}
|
||||
}
|
||||
const queryData = async (id?: number,type:string) => {
|
||||
isLoading.value = true
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
|
||||
try {
|
||||
formData.value = await getTaskDetailAPI(id)
|
||||
formData.value.processDesignProgressList = await getProcessDesignProgressListByProcessDesignId(id)
|
||||
historyList.value = formData.value.processDesignProgressList;
|
||||
detailInfo.value.active = 'START'
|
||||
if(historyList.value != null && historyList.value.length > 0){
|
||||
for (var i = 0; i < historyList.value.length; i++) {
|
||||
var item = historyList.value[i]
|
||||
if(item.isOver == 0){
|
||||
formObj.value = item;
|
||||
detailInfo.value.active = 'STOP'
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
isLoading.value = false
|
||||
if(type == 'ADD'){
|
||||
popup.value?.open();
|
||||
}
|
||||
// if( formData.value.processDesignProgressList != null && formData.value.processDesignProgressList.length > 0){
|
||||
// var maxTime = null;
|
||||
// if(formData.value.processDesignProgressList.length == 1){
|
||||
// formData.value.processDesignProgressList[0].hasNext = false;
|
||||
// if(formData.value.processDesignProgressList[0].endTime != null && formData.value.processDesignProgressList[0].endTime != ''){
|
||||
// formData.value.processDesignProgressList[0].maxTime = parseFloat((formData.value.processDesignProgressList[0].endTime - formData.value.processDesignProgressList[0].beginTime)/ (1000 * 60 * 60)).toFixed(2);
|
||||
// }
|
||||
// } else{
|
||||
// var maxIndex = 0;
|
||||
// for (let index = 0; index < formData.value.processDesignProgressList.length; index++) {
|
||||
// var item = formData.value.processDesignProgressList[index];
|
||||
// if(item.endTime != null && item.endTime != ''){
|
||||
// item.maxTime = parseFloat((item.endTime - item.beginTime)/ (1000 * 60 * 60)).toFixed(2);;
|
||||
// }
|
||||
// if(maxTime == null){
|
||||
// maxIndex = index;
|
||||
// maxTime = item.createTime;
|
||||
// item.hasNext = false;
|
||||
// }else{
|
||||
// if(item.createTime > maxTime){
|
||||
// formData.value.processDesignProgressList[maxIndex].hasNext = true;
|
||||
// maxIndex = index;
|
||||
// item.hasNext = false;
|
||||
// }else{
|
||||
// item.hasNext = true;
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
isLoading.value = false
|
||||
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const overRow = async( row :any) =>{
|
||||
if(row.endTime == null ){
|
||||
row.endTime = new Date().getTime()
|
||||
var timeDiff = row.endTime -row.beginTime;
|
||||
|
||||
// 将毫秒转换为小时
|
||||
row.workTime = timeDiff / (1000 * 60 * 60);
|
||||
row.maxTime = row.workTime;
|
||||
// row.workTime = row.endTime - row.
|
||||
}
|
||||
if(row.endTime == null ){
|
||||
uni.showToast({ icon: 'none', title:'结束时间不能为空!请确认!'})
|
||||
return
|
||||
}
|
||||
if(row.workTime == null
|
||||
){
|
||||
uni.showToast({ icon: 'none', title:'已做时间不能为空!请确认!'})
|
||||
|
||||
return
|
||||
}
|
||||
formData.value.processDesignProgressList.forEach((item) =>{
|
||||
if(item.isOver == 0){
|
||||
item.workTime = row.workTime;
|
||||
item.endTime = new Date(row.endTime).getTime();
|
||||
item.remark = (row.remark == null || row.remark == '')? '':row.remark
|
||||
}
|
||||
})
|
||||
|
||||
row.isOver = 1;
|
||||
await submitForm('SAVE','OVER');
|
||||
//更新一下这条数据的状态
|
||||
const submitForm = async (operate, type) => {
|
||||
isLoading.value = true;
|
||||
try {
|
||||
formData.value.id = detailInfo.value.id
|
||||
formData.value.planId = detailInfo.value.planId
|
||||
formData.value.projectId = detailInfo.value.projectId
|
||||
formData.value.processDesignType = detailInfo.value.processDesignType
|
||||
formData.value.processDesignProgressList = historyList.value;
|
||||
const data = formData.value as unknown as ProcessDesignVO
|
||||
let processDesignId;
|
||||
if (!formData.value.id) {
|
||||
processDesignId = await createProcessDesign(data)
|
||||
} else {
|
||||
processDesignId = await updateProcessDesign(data)
|
||||
}
|
||||
await queryData(detailInfo.value.id, type)
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
}
|
||||
}
|
||||
const handOver = () =>{
|
||||
|
||||
const queryData = async (id ?: number, type : string) => {
|
||||
isLoading.value = true
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
|
||||
try {
|
||||
formData.value = await getTaskDetailAPI(id)
|
||||
formData.value.processDesignProgressList = await getProcessDesignProgressListByProcessDesignId(id)
|
||||
historyList.value = formData.value.processDesignProgressList;
|
||||
detailInfo.value.active = 'START'
|
||||
if (historyList.value != null && historyList.value.length > 0) {
|
||||
for (var i = 0; i < historyList.value.length; i++) {
|
||||
var item = historyList.value[i]
|
||||
if (item.isOver == 0) {
|
||||
formObj.value = item;
|
||||
detailInfo.value.active = 'STOP'
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
isLoading.value = false
|
||||
if (type == 'ADD') {
|
||||
popup.value?.open();
|
||||
}
|
||||
// if( formData.value.processDesignProgressList != null && formData.value.processDesignProgressList.length > 0){
|
||||
// var maxTime = null;
|
||||
// if(formData.value.processDesignProgressList.length == 1){
|
||||
// formData.value.processDesignProgressList[0].hasNext = false;
|
||||
// if(formData.value.processDesignProgressList[0].endTime != null && formData.value.processDesignProgressList[0].endTime != ''){
|
||||
// formData.value.processDesignProgressList[0].maxTime = parseFloat((formData.value.processDesignProgressList[0].endTime - formData.value.processDesignProgressList[0].beginTime)/ (1000 * 60 * 60)).toFixed(2);
|
||||
// }
|
||||
// } else{
|
||||
// var maxIndex = 0;
|
||||
// for (let index = 0; index < formData.value.processDesignProgressList.length; index++) {
|
||||
// var item = formData.value.processDesignProgressList[index];
|
||||
// if(item.endTime != null && item.endTime != ''){
|
||||
// item.maxTime = parseFloat((item.endTime - item.beginTime)/ (1000 * 60 * 60)).toFixed(2);;
|
||||
// }
|
||||
// if(maxTime == null){
|
||||
// maxIndex = index;
|
||||
// maxTime = item.createTime;
|
||||
// item.hasNext = false;
|
||||
// }else{
|
||||
// if(item.createTime > maxTime){
|
||||
// formData.value.processDesignProgressList[maxIndex].hasNext = true;
|
||||
// maxIndex = index;
|
||||
// item.hasNext = false;
|
||||
// }else{
|
||||
// item.hasNext = true;
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
isLoading.value = false
|
||||
|
||||
} finally {
|
||||
isLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const overRow = async (row : any) => {
|
||||
if (row.endTime == null) {
|
||||
row.endTime = new Date().getTime()
|
||||
var timeDiff = row.endTime - row.beginTime;
|
||||
|
||||
// 将毫秒转换为小时
|
||||
row.workTime = timeDiff / (1000 * 60 * 60);
|
||||
row.maxTime = row.workTime;
|
||||
// row.workTime = row.endTime - row.
|
||||
}
|
||||
if (row.beginTime == null) {
|
||||
uni.showToast({ icon: 'none', title: '开始时间不能为空!请确认!' })
|
||||
return
|
||||
}
|
||||
|
||||
if (new Date(row.beginTime).getTime() > new Date(row.endTime).getTime()) {
|
||||
uni.showToast({ icon: 'none', title: '开始时间不能大于结束时间!请确认!' })
|
||||
return
|
||||
}
|
||||
if (row.workTime == null
|
||||
) {
|
||||
uni.showToast({ icon: 'none', title: '已做时间不能为空!请确认!' })
|
||||
|
||||
return
|
||||
}
|
||||
formData.value.processDesignProgressList.forEach((item) => {
|
||||
if (item.isOver == 0) {
|
||||
item.workTime = row.workTime;
|
||||
item.endTime = new Date(row.endTime).getTime();
|
||||
item.remark = (row.remark == null || row.remark == '') ? '' : row.remark
|
||||
}
|
||||
})
|
||||
|
||||
row.isOver = 1;
|
||||
await submitForm('SAVE', 'OVER');
|
||||
//更新一下这条数据的状态
|
||||
}
|
||||
const handOver = () => {
|
||||
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
const onAddItem = async() => {
|
||||
//条件修改:没有时间就不填
|
||||
var date = new Date();
|
||||
if(processDesignType.value == 'BLUEPRINT_WORKBLANK'){
|
||||
if(detailInfo.value.blankDate != null ){
|
||||
if(detailInfo.value.blankDate < date.getTime()){
|
||||
if(detailInfo.value.isDelay == null || detailInfo.value.isDelay == 0){
|
||||
uni.showToast({ icon: 'none', title: '当前任务已超期,请延期后重试!' })
|
||||
return
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// message.error("毛坯结束时间为空!请确认!")
|
||||
// return
|
||||
}
|
||||
}
|
||||
if(processDesignType.value == 'BLUEPRINT_2D'){
|
||||
if(detailInfo.value.twoDimDate != null ){
|
||||
if(detailInfo.value.twoDimDate < date.getTime()){
|
||||
if(detailInfo.value.isDelay == null || detailInfo.value.isDelay == 0){
|
||||
uni.showToast({ icon: 'none', title: '当前任务已超期,请延期后重试!' })
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
// message.error("2D结束时间为空!请确认!")
|
||||
// return
|
||||
}
|
||||
}
|
||||
if(processDesignType.value == 'BLUEPRINT_3D'){
|
||||
if(detailInfo.value.threeDimDate != null ){
|
||||
if(detailInfo.value.threeDimDate < date.getTime()){
|
||||
if(detailInfo.value.isDelay == null || detailInfo.value.isDelay == 0){
|
||||
uni.showToast({ icon: 'none', title: '当前任务已超期,请延期后重试!' })
|
||||
return
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// message.error("3D结束时间为空!请确认!")
|
||||
// return
|
||||
}
|
||||
}
|
||||
if(processDesignType.value == 'BLUEPRINT_FOUNDRY_TECHNOLOGY'){
|
||||
console.log(detailInfo.value.craftEndDate)
|
||||
if(detailInfo.value.craftEndDate != null ){
|
||||
console.log(date.getTime())
|
||||
console.log(detailInfo.value.craftEndDate)
|
||||
if(detailInfo.value.craftEndDate < date.getTime()){
|
||||
if(detailInfo.value.isDelay == null || detailInfo.value.isDelay == 0){
|
||||
uni.showToast({ icon: 'none', title: '当前任务已超期,请延期后重试!' })
|
||||
return
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// message.error("工艺结束时间为空!请确认!")
|
||||
// return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (historyList.value != null && historyList.value.length>0){
|
||||
for ( var i = 0 ; i < historyList.value.length ; i++){
|
||||
var item = historyList.value[i];
|
||||
if(item.isOver == 0){
|
||||
message.error("上一项进度未结束汇报!请确认!")
|
||||
return;
|
||||
}
|
||||
// if(item.endTime == null ){
|
||||
// message.error("结束时间不能为空!请确认!")
|
||||
// return
|
||||
// }
|
||||
// if(item.workTime == null
|
||||
// ){
|
||||
// message.error("已做时间不能为空!请确认")
|
||||
// return
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const row = {
|
||||
id: undefined,
|
||||
processDesignId: undefined,
|
||||
progress: undefined,
|
||||
blueprintLink: undefined,
|
||||
remark: '',
|
||||
createTime: date.getTime(),
|
||||
beginTime:date.getTime(),
|
||||
endTime:undefined,
|
||||
isOver:0,
|
||||
workTime:undefined,
|
||||
creatorName: userStore.userInfo.nickname,
|
||||
status: 1,
|
||||
}
|
||||
row.processDesignId = detailInfo.value.progress
|
||||
historyList.value.unshift(row)
|
||||
await submitForm('SAVE','ADD');
|
||||
const onAddItem = async () => {
|
||||
//条件修改:没有时间就不填
|
||||
var date = new Date();
|
||||
if (processDesignType.value == 'BLUEPRINT_WORKBLANK') {
|
||||
if (detailInfo.value.blankDate != null) {
|
||||
if (detailInfo.value.blankDate < date.getTime()) {
|
||||
if (detailInfo.value.isDelay == null || detailInfo.value.isDelay == 0) {
|
||||
uni.showToast({ icon: 'none', title: '当前任务已超期,请延期后重试!' })
|
||||
return
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// message.error("毛坯结束时间为空!请确认!")
|
||||
// return
|
||||
}
|
||||
}
|
||||
if (processDesignType.value == 'BLUEPRINT_2D') {
|
||||
if (detailInfo.value.twoDimDate != null) {
|
||||
if (detailInfo.value.twoDimDate < date.getTime()) {
|
||||
if (detailInfo.value.isDelay == null || detailInfo.value.isDelay == 0) {
|
||||
uni.showToast({ icon: 'none', title: '当前任务已超期,请延期后重试!' })
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
// message.error("2D结束时间为空!请确认!")
|
||||
// return
|
||||
}
|
||||
}
|
||||
if (processDesignType.value == 'BLUEPRINT_3D') {
|
||||
if (detailInfo.value.threeDimDate != null) {
|
||||
if (detailInfo.value.threeDimDate < date.getTime()) {
|
||||
if (detailInfo.value.isDelay == null || detailInfo.value.isDelay == 0) {
|
||||
uni.showToast({ icon: 'none', title: '当前任务已超期,请延期后重试!' })
|
||||
return
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// message.error("3D结束时间为空!请确认!")
|
||||
// return
|
||||
}
|
||||
}
|
||||
if (processDesignType.value == 'BLUEPRINT_FOUNDRY_TECHNOLOGY') {
|
||||
console.log(detailInfo.value.craftEndDate)
|
||||
if (detailInfo.value.craftEndDate != null) {
|
||||
console.log(date.getTime())
|
||||
console.log(detailInfo.value.craftEndDate)
|
||||
if (detailInfo.value.craftEndDate < date.getTime()) {
|
||||
if (detailInfo.value.isDelay == null || detailInfo.value.isDelay == 0) {
|
||||
uni.showToast({ icon: 'none', title: '当前任务已超期,请延期后重试!' })
|
||||
return
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// message.error("工艺结束时间为空!请确认!")
|
||||
// return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (historyList.value != null && historyList.value.length > 0) {
|
||||
for (var i = 0; i < historyList.value.length; i++) {
|
||||
var item = historyList.value[i];
|
||||
if (item.isOver == 0) {
|
||||
uni.showToast({ icon: 'none', title: '上一项进度未结束汇报,请确认!' })
|
||||
|
||||
return;
|
||||
}
|
||||
// if(item.endTime == null ){
|
||||
// message.error("结束时间不能为空!请确认!")
|
||||
// return
|
||||
// }
|
||||
// if(item.workTime == null
|
||||
// ){
|
||||
// message.error("已做时间不能为空!请确认")
|
||||
// return
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const row = {
|
||||
id: undefined,
|
||||
processDesignId: undefined,
|
||||
progress: undefined,
|
||||
blueprintLink: undefined,
|
||||
remark: '',
|
||||
createTime: date.getTime(),
|
||||
beginTime: date.getTime(),
|
||||
endTime: undefined,
|
||||
isOver: 0,
|
||||
workTime: undefined,
|
||||
creatorName: userStore.userInfo.nickname,
|
||||
status: 1,
|
||||
}
|
||||
row.processDesignId = detailInfo.value.progress
|
||||
historyList.value.unshift(row)
|
||||
await submitForm('SAVE', 'STOP');
|
||||
}
|
||||
|
||||
// 提交报工
|
||||
@ -417,7 +423,7 @@
|
||||
popup.value?.open() */
|
||||
}
|
||||
const getWorkTime = (beginTime, endTime) => {
|
||||
if(beginTime == null || endTime == null) return ''
|
||||
if (beginTime == null || endTime == null) return ''
|
||||
return parseFloat(((new Date(endTime).getTime() - new Date(beginTime).getTime()) / (1000 * 60 * 60)).toFixed(2))
|
||||
}
|
||||
const showPopup = ref(false)
|
||||
@ -433,8 +439,8 @@
|
||||
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
const openPops = (item) =>{
|
||||
if(item.isOver == 0){
|
||||
const openPops = (item) => {
|
||||
if (item.isOver == 0) {
|
||||
popup.value?.open()
|
||||
formObj.value = item
|
||||
}
|
||||
@ -457,10 +463,34 @@
|
||||
}
|
||||
return val
|
||||
}
|
||||
const changeDate1 = (e,item) => {
|
||||
item.endTime = e
|
||||
item.workTime = getWorkTime(item.beginTime,item.endTime)
|
||||
console.log(item.workTime)
|
||||
const changeDate1 = (e, item) => {
|
||||
item.endTime = new Date(e).getTime()
|
||||
if (item.beginTime != null) {
|
||||
if (new Date(item.beginTime).getTime() > new Date(e).getTime()) {
|
||||
formObj.value.workTime = null
|
||||
uni.showToast({ icon: 'none', title: '开始时间不能大于结束时间,请确认!' })
|
||||
} else {
|
||||
formObj.value.workTime = getWorkTime(item.beginTime, item.endTime)
|
||||
}
|
||||
} else {
|
||||
formObj.value.workTime = null
|
||||
}
|
||||
//item.workTime = getWorkTime(item.beginTime, item.endTime)
|
||||
}
|
||||
const changeDate2 = (e, item) => {
|
||||
item.beginTime = new Date(e).getTime()
|
||||
if (item.endTime != null) {
|
||||
if (new Date(item.endTime).getTime() < new Date(e).getTime()) {
|
||||
formObj.value.workTime = null
|
||||
uni.showToast({ icon: 'none', title: '开始时间不能大于结束时间,请确认!' })
|
||||
} else {
|
||||
|
||||
formObj.value.workTime = getWorkTime(item.beginTime, item.endTime)
|
||||
}
|
||||
} else {
|
||||
formObj.value.workTime = null
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
@ -496,7 +526,8 @@
|
||||
</view>
|
||||
<view class="product-item" v-else-if="detailInfo.processDesignType== 'BLUEPRINT_3D'">
|
||||
工艺起止日期:{{formatDate(detailInfo.startThreeDimDate)}} ~
|
||||
{{formatDate(detailInfo.threeDimDate)}} </view>
|
||||
{{formatDate(detailInfo.threeDimDate)}}
|
||||
</view>
|
||||
<view class="product-item" v-else-if="detailInfo.processDesignType== 'BLUEPRINT_WORKBLANK'">
|
||||
工艺起止日期:{{formatDate(detailInfo.startBlankDate)}} ~ {{formatDate(detailInfo.blankDate)}}
|
||||
</view>
|
||||
@ -548,10 +579,13 @@
|
||||
<view class="action" v-if="detailInfo.isOverProcess !== 1">
|
||||
<view class="action-item start" v-if="detailInfo.active == 'START'" @click="onAddItem()">开始</view>
|
||||
<view class="action-item stop" v-if="detailInfo.active != 'START'" @click="handleStop()">结束</view>
|
||||
|
||||
<!-- <view class="action-item start" v-if="detailInfo.active == 'START'" @click="onAddItem()">开始</view>
|
||||
<view class="action-item stop" v-if="detailInfo.active != 'START'" @click="handleStop()">结束</view> -->
|
||||
</view>
|
||||
</template>
|
||||
<view class="loading-text" v-else>加载中..</view>
|
||||
<uni-popup class="popup" ref="popup" :show="showPopup" type="bottom" background-color="#fff">
|
||||
<uni-popup class="popup" ref="popup" :show="showPopup" type="bottom" background-color="#fff">
|
||||
<view class="title">
|
||||
<view class="text">填写信息</view>
|
||||
<!-- <view class="close" @click="handleClose">X</view> -->
|
||||
@ -559,18 +593,17 @@
|
||||
<view class="cont">
|
||||
<view class="item">
|
||||
<view class="label">开始时间</view>
|
||||
<view class="val"><uni-datetime-picker disabled type="datetime" style="text-align: center;"
|
||||
v-model="formObj.beginTime" /></view>
|
||||
<view class="val"><uni-datetime-picker type="datetime" style="text-align: center;"
|
||||
@change="(e) => changeDate2(e,formObj)" v-model="formObj.beginTime" /></view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label"><span class="star">*</span>结束时间</view>
|
||||
<view class="val"> <uni-datetime-picker :disabled="formObj.hasNext" type="datetime"
|
||||
<view class="label">结束时间</view>
|
||||
<view class="val"> <uni-datetime-picker style="text-align: center;" type="datetime"
|
||||
v-model="formObj.endTime" @change="(e) => changeDate1(e,formObj)" /></view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label"><span class="star">*</span>已做时间(小时)</view>
|
||||
<uni-easyinput :disabled="formObj.hasNext"
|
||||
@change="formObj.workTime = oninput(formObj.workTime,2)" class="val" type="number"
|
||||
<view class="label">已做时间</view>
|
||||
<uni-easyinput @change="formObj.workTime = oninput(formObj.workTime,2)" class="val" type="number"
|
||||
v-model="formObj.workTime" placeholder="请输入已做时间"></uni-easyinput>
|
||||
|
||||
<!-- <uni-easyinput class="val" type="digit" v-model="workTime" placeholder="请输入本次报工工时"></uni-easyinput -->
|
||||
@ -578,9 +611,8 @@
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label">备注</view>
|
||||
<uni-easyinput type="textarea" :disabled="formObj.hasNext" v-model="formObj.remark"
|
||||
placeholder="请输入备注" />
|
||||
<!-- <view class="unit"> {{ detailInfo.unit }}</view> -->
|
||||
<uni-easyinput type="textarea" v-model="formObj.remark" placeholder="请输入备注" />
|
||||
<!-- <view class="unit"> {{ detailInfo.unit }}</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="ok" @click="overRow(formObj)">确定</view>
|
||||
@ -762,10 +794,10 @@
|
||||
padding: 0rpx 10rpx;
|
||||
|
||||
.item {
|
||||
margin: 10rpx 0;
|
||||
margin: 5rpx 0;
|
||||
background: #EAEEF4;
|
||||
font-size: 28rpx;
|
||||
padding: 20rpx;
|
||||
padding: 15rpx;
|
||||
width: 100%;
|
||||
border-radius: 10rpx;
|
||||
color: #737D88;
|
||||
@ -928,7 +960,7 @@
|
||||
|
||||
.label {
|
||||
font-size: 32rpx;
|
||||
width: 260rpx;
|
||||
width: 200rpx;
|
||||
|
||||
.star {
|
||||
color: red
|
||||
@ -936,7 +968,7 @@
|
||||
}
|
||||
|
||||
.val {
|
||||
flex: 1;
|
||||
flex: 1.5;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user