按新要求修改

This commit is contained in:
Ledo 2025-06-04 23:18:42 +08:00
parent f32b2aaed0
commit 662bed71ee
13 changed files with 1086 additions and 750 deletions

View File

@ -20,7 +20,9 @@ export const getProcessDesignPage = async (params) => {
export const getProcessDesign = async (id: number) => {
return await request.get({ url: `/heli/process-design/get?id=` + id })
}
export const over = async (id: number) => {
return await request.get({ url: `/heli/process-design/over?id=` + id })
}
// 新增工艺设计
export const createProcessDesign = async (data: ProcessDesignVO) => {
return await request.post({ url: `/heli/process-design/create`, data })

View File

@ -123,7 +123,7 @@
</el-table-column>
<el-table-column fixed="right" label="最新进度" align="center" prop="progress" min-width="120">
<template #default="scope">
{{scope.row.isOver ? '已完成':'实施中'}}
{{scope.row.isOverProcess == 1 ? '已完成':'实施中'}}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" min-width="160">
@ -235,53 +235,29 @@ const openDetail = (type: string, id?: number) => {
})
}
const getDetailMsg = (row) =>{
if(row.isDelay == true){
//
if(row.threeDimDate != null ){
//
if(row.lastDate != null){
if(row.isOverProcess){
//
if(row.threeDimDate != null && row.lastDate != null ){
const start = new Date(row.threeDimDate).getTime();
const end = new Date(row.lastDate).getTime();
const diffTime = Math.abs(end - start);
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
if(row.lastDate > row.threeDimDate){
const start = new Date(row.threeDimDate).getTime();
const end = new Date(row.lastDate).getTime();
const diffTime = Math.abs(end - start);
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
return '延期' + day +'天';
return '延后' + day +'天';
}else if (row.lastDate < row.threeDimDate){
return '提前' + day +'天';
}else{
return '延期'
return '按时完成'
}
}else{
return '实施中';
}
}else{
return '延期';
}
}else{
return '已延期';
}
}else{
if(row.threeDimDate != null){
if(row.lastDate != null){
const start = new Date(row.threeDimDate).getTime();
const end = new Date(row.lastDate).getTime();
if(row.threeDimDate > row.lastDate){
const diffTime = Math.abs(start - end);
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
return '提前'+day +'天完成';
} else if ( Math.floor((start) / (1000 * 60 * 60 * 24)) == Math.floor(end / (1000 * 60 * 60 * 24))){
return '按计划时间完成'
}else{
const diffTime = Math.abs(end - start);
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
return '滞后'+day +'完成';
}
}else{
return '按计划实施中';
}
}else{
return '按计划实施中';
}
}
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {

View File

@ -435,7 +435,7 @@ const subFormRef = ref()
//20250601
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open(formData.value.bomCode)
importFormRef.value.open(formData.value.id)
}
//
@ -790,7 +790,9 @@ const fetchStorageOkQty = async (row)=>{
console.error('获取库存出错:', error);
}
}
const getList = () => {
queryData(currentId.value)
}
onMounted(() => {
dialogTitle.value = t('action.' + active.value)
if ('detail' == active.value) {

View File

@ -43,6 +43,7 @@ const importUrl =
const uploadHeaders = ref() // Header
const fileList = ref([]) //
const bomCode = ref('')
/** 打开弹窗 */
const open = (bomcode :string) => {
bomCode.value = bomcode;

View File

@ -199,8 +199,8 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
</el-form-item>
</el-col>
<el-col :span="6" >
<el-button style="margin-left: 10%;" type="danger" @click="openDelay">延期</el-button>
<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-form-item label="延期原因" prop="delayReason">
@ -245,8 +245,8 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
</template>
<el-row>
<el-col v-if="active != 'detail'">
<el-button class="hl-addbutton" type="primary" size="large" @click="onAddItem">开始</el-button>
<el-button style="margin-left: 30px;" type="warning" size="large" @click="sendItem()">推送</el-button>
<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 class="hl-addbutton" type="primary" size="large" @click="onAddItem">新增</el-button> -->
</el-col>
@ -261,7 +261,7 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_PROJECT_PLAN_STATUS)" :key="dict
<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)" :disabled="row.hasNext" :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 || formData.isOverProcess == 1" :formatter="dateFormatter" v-model="row.endTime" type="datetime" placeholder="选择结束日期"/>
</el-form-item>
</template>
</el-table-column>
@ -269,7 +269,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.hasNext" v-model="row.workTime" placeholder="请输入已做时间"/>
<el-input-number :max="row.maxTime" :precision="2" class="!w-240px" :disabled="row.isOver || formData.isOverProcess == 1" v-model="row.workTime" placeholder="请输入已做时间"/>
</el-form-item>
</template>
</el-table-column>
@ -296,7 +296,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" v-model="row.remark" placeholder="请输入备注" />
<el-input :disabled="row.hasNext || row.isOver || formData.isOverProcess == 1" v-model="row.remark" placeholder="请输入备注" />
</el-form-item>
</template>
</el-table-column>
@ -335,7 +335,7 @@ import { inject } from 'vue'
import {useUserStore} from "@/store/modules/user";
import {useCommonStore} from "@/store/modules/common";
import {verify} from "node:crypto";
import { delay, now } from 'lodash-es';
import { delay, fromPairs, now } from 'lodash-es';
import { FolderOpened } from '@element-plus/icons-vue/dist/types';
defineOptions({ name: 'ProcessDesignDetail' })
@ -369,7 +369,7 @@ const formData = ref({
const formRef = ref() // Ref
const processDesignProgressFormRef = ref()
const overbuttonName = ref('')
/** 重置表单 */
const resetForm = () => {
formData.value = {
@ -419,6 +419,20 @@ const getWorkTime = (type) =>{
}else{return ''
}
}
const endTimeChange = (e , row) =>{
if(e == null ){
row.workTime = null
row.maxTime = row.workTime;
}else{
var endTime = new Date(e);
var timeDiff = endTime.getTime() -row.beginTime;
//
row.workTime = timeDiff / (1000 * 60 * 60);
row.maxTime = row.workTime;
}
}
const delaySubmit = async() =>{
if(formData.value.delayReason == null || formData.value.delayReason.replaceAll(' ','') == ''){
message.error("延期原因不得为空,请确认!")
@ -481,7 +495,7 @@ const openDelay = () =>{
}
const overRow = async( row :any) =>{
if(row.endTime == null || row.endTime == ''){
if(row.endTime == null ){
row.endTime = new Date().getTime()
var timeDiff = row.endTime -row.beginTime;
@ -490,11 +504,11 @@ const overRow = async( row :any) =>{
row.maxTime = row.workTime;
// row.workTime = row.endTime - row.
}
if(row.endTime == null || row.endTime == ''){
if(row.endTime == null ){
message.error("结束时间不能为空!请确认!")
return
}
if(row.workTime == null || row.workTime == ''
if(row.workTime == null
){
message.error("已做时间不能为空!请确认")
return
@ -503,6 +517,37 @@ const overRow = async( row :any) =>{
await submitForm('SAVE');
//
}
const overProcess = () =>{
if(formData.value.processDesignProgressList != null && formData.value.processDesignProgressList.length > 0){
for (let index = 0; index < formData.value.processDesignProgressList.length; index++) {
var item = formData.value.processDesignProgressList[index];
if(!item.hasNext){
if(item.endTime == null ){
message.error("结束时间不能为空!请确认!")
return
}
if(item.workTime == null){
message.error("已做时间不能为空!请确认")
return
}
}
item.isOver = 1;
}
}else{
message.error("至少进行一次进度汇报!")
return
}
ElMessageBox.confirm('是否结束该项目?')
.then( async () => {
await submitForm('SAVE');
await ProcessDesignApi.over(formData.value.id)
await queryData(formData.value.id)
message.success("修改成功!")
})
.catch(() => {
})
}
const sendItem = async() =>{
//,
if(formData.value.processDesignProgressList != null && formData.value.processDesignProgressList.length > 0){
@ -518,11 +563,11 @@ const sendItem = async() =>{
var item = formData.value.processDesignProgressList[index];
if(!item.hasNext){
senIndex = index;
if(item.endTime == null || item.endTime == ''){
if(item.endTime == null){
message.error("结束时间不能为空!请确认!")
return
}
if(item.workTime == null || item.workTime == ''){
if(item.workTime == null){
message.error("已做时间不能为空!请确认")
return
}
@ -531,6 +576,7 @@ const sendItem = async() =>{
return
}
}
item.isOver = 1
}
//
await submitForm('SAVE');
@ -626,6 +672,7 @@ const submitForm = async (operate) => {
/** 新增按钮操作 */
const onAddItem = async() => {
//
var date = new Date();
if(processDesignType.value == 'BLUEPRINT_WORKBLANK'){
if(formData.value.blankDate != null ){
@ -636,8 +683,8 @@ const onAddItem = async() => {
}
}
}else{
message.error("毛坯结束时间为空!请确认!")
return
// message.error("!!")
// return
}
}
if(processDesignType.value == 'BLUEPRINT_2D'){
@ -650,8 +697,8 @@ const onAddItem = async() => {
}
}else{
message.error("2D结束时间为空!请确认!")
return
// message.error("2D!!")
// return
}
}
if(processDesignType.value == 'BLUEPRINT_3D'){
@ -663,8 +710,8 @@ const onAddItem = async() => {
}
}
}else{
message.error("3D结束时间为空!请确认!")
return
// message.error("3D!!")
// return
}
}
if(processDesignType.value == 'BLUEPRINT_FOUNDRY_TECHNOLOGY'){
@ -679,24 +726,28 @@ const onAddItem = async() => {
}
}
}else{
message.error("工艺结束时间为空!请确认!")
return
// message.error("!!")
// return
}
}
if (formData.value.processDesignProgressList.length>0){
if (formData.value.processDesignProgressList != null && formData.value.processDesignProgressList.length>0){
for ( var i = 0 ; i < formData.value.processDesignProgressList.length ; i++){
var item = formData.value.processDesignProgressList[i];
if(item.endTime == null || item.endTime == ''){
message.error("结束时间不能为空!请确认!")
return
}
if(item.workTime == null || item.workTime == ''
){
message.error("已做时间不能为空!请确认")
return
if(item.isOver == 0){
message.error("上一项进度未结束汇报!请确认!")
return;
}
// if(item.endTime == null ){
// message.error("!!")
// return
// }
// if(item.workTime == null
// ){
// message.error("!")
// return
// }
}
}
@ -710,7 +761,7 @@ const onAddItem = async() => {
remark: '',
createTime: date.getTime(),
beginTime:date.getTime(),
endTime:'',
endTime:undefined,
isOver:0,
workTime:undefined,
creatorName: userStore.getUser.nickname,
@ -732,6 +783,18 @@ onMounted(() => {
}
queryData(currentId.value)
if(processDesignType.value == 'BLUEPRINT_WORKBLANK'){
overbuttonName.value = '毛坯项目完结'
}
if(processDesignType.value == 'BLUEPRINT_2D'){
overbuttonName.value = '2D项目完结'
}
if(processDesignType.value == 'BLUEPRINT_3D'){
overbuttonName.value = '3D项目完结'
}
if(processDesignType.value == 'BLUEPRINT_FOUNDRY_TECHNOLOGY'){
overbuttonName.value='铸造项目完结'
}
})
</script>
<style scoped lang="less"></style>

View File

@ -117,7 +117,7 @@
</el-table-column>
<el-table-column fixed="right" label="最新进度" align="center" prop="progress" min-width="120">
<template #default="scope">
{{scope.row.isOver ? '已完成':'实施中'}}
{{scope.row.isOverProcess == 1 ? '已完成':'实施中'}}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" min-width="160">
@ -203,54 +203,29 @@ const handleQuery = () => {
getList()
}
const getDetailMsg = (row) =>{
if(row.isDelay == true){
//
if(row.craftEndDate != null ){
//
if(row.lastDate != null){
if(row.isOverProcess){
//
if(row.craftEndDate != null && row.lastDate != null ){
const start = new Date(row.craftEndDate).getTime();
const end = new Date(row.lastDate).getTime();
const diffTime = Math.abs(end - start);
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
if(row.lastDate > row.craftEndDate){
const start = new Date(row.craftEndDate).getTime();
const end = new Date(row.lastDate).getTime();
const diffTime = Math.abs(end - start);
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
return '延期' + day +'天';
return '延后' + day +'天';
}else if (row.lastDate < row.craftEndDate){
return '提前' + day +'天';
}else{
return '延期'
return '按时完成'
}
}else{
// return '';
}
}else{
console.log('ss')
return '延期';
}
}else{
return '已延期';
}
}else{
if(row.craftEndDate != null){
if(row.lastDate != null){
const start = new Date(row.craftEndDate).getTime();
const end = new Date(row.lastDate).getTime();
if(row.craftEndDate > row.lastDate){
const diffTime = Math.abs(start - end);
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
return '提前'+day +'天完成';
} else if ( Math.floor((start) / (1000 * 60 * 60 * 24)) == Math.floor(end / (1000 * 60 * 60 * 24))){
return '按计划时间完成'
}else{
const diffTime = Math.abs(end - start);
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
return '滞后'+day +'完成';
}
}else{
return '按计划实施中';
}
}else{
return '按计划实施中';
}
}
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()

View File

@ -85,7 +85,7 @@
</el-table-column>
<el-table-column fixed="right" label="最新进度" align="center" prop="progress" min-width="120">
<template #default="scope">
{{scope.row.isOver ? '已完成':'实施中'}}
{{scope.row.isOverProcess == 1 ? '已完成':'实施中'}}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" min-width="160">
@ -184,53 +184,27 @@ const openDetail = (type: string, id?: number) => {
})
}
const getDetailMsg = (row) =>{
if(row.isDelay == true){
//
if(row.blankDate != null ){
//
if(row.lastDate != null){
if(row.isOverProcess){
//
if(row.blankDate != null && row.lastDate != null ){
const start = new Date(row.blankDate).getTime();
const end = new Date(row.lastDate).getTime();
const diffTime = Math.abs(end - start);
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
if(row.lastDate > row.blankDate){
const start = new Date(row.blankDate).getTime();
const end = new Date(row.lastDate).getTime();
const diffTime = Math.abs(end - start);
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
return '延期' + day +'天';
return '延后' + day +'天';
}else if (row.lastDate < row.blankDate){
return '提前' + day +'天';
}else{
return '延期'
return '按时完成'
}
}else{
return '实施中';
}
}
}else{
return '延期';
}
}else{
return '已延期';
}
}else{
if(row.blankDate != null){
if(row.lastDate != null){
const start = new Date(row.blankDate).getTime();
const end = new Date(row.lastDate).getTime();
if(row.blankDate > row.lastDate){
const diffTime = Math.abs(start - end);
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
return '提前'+day +'天完成';
} else if ( Math.floor((start) / (1000 * 60 * 60 * 24)) == Math.floor(end / (1000 * 60 * 60 * 24))){
return '按计划时间完成'
}else{
const diffTime = Math.abs(end - start);
var day = Math.floor(diffTime / (1000 * 60 * 60 * 24));
return '滞后'+day +'完成';
}
}else{
return '按计划实施中';
}
}else{
return '按计划实施中';
}
}
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {

View File

@ -181,6 +181,7 @@ class="!w-260px" v-model="formData.createTime" type="date" value-format="x"
<el-checkbox-group v-if="active != 'detail' && formData.dispatchStatus == 1 " v-model="checkList" @change="onAddItem()">
<el-checkbox label="下料" size="large" border />
<el-checkbox label="电焊" size="large" border />
<el-checkbox label="编程" size="large" border />
<el-checkbox label="开粗" size="large" border />
<el-checkbox label="铣床" size="large" border />
<el-checkbox label="车床" size="large" border />
@ -778,8 +779,13 @@ const dispatchTypeHasChange = (row) =>{
row.postId =''
} else{
row.owner = ''
if(row.isOutsourcing == true){
row.postId = '2'
}else{
row.postId = ownerList2.value[0].id;
}
}
}
watch(
() => formData.value.taskDispatchDetails,
@ -1247,7 +1253,11 @@ const queryData = async (id?: number) => {
postList.value = await TaskDispatchApi.getOwnerList(formData.value.ownerId,2);
ownerList1.value = await getOwnerListThis ();
//20250601 2 ownerList2.value = await getOwnerPostListThis ();
ownerList2 .value.push({index:1,id:'2',label:'2'})
ownerList2.value = await getOwnerPostListThis ();
const exists = ownerList2.value.some(item => item.id === '2');
if (!exists) {
ownerList2.value.push({ index: 1, id: '2', label: '2' });
}
}
formData.value.bomCode = 'BOM-' + formData.value.projectSubCode

View File

@ -232,22 +232,22 @@
const processDesignType = ref('')
const updateItem = ref()
const handleDetail = async (item) => {
updateItem.value = item;
processDesignType.value = item.processDesignType;
if (props.orderState == 0) {
progress.value = 0;
imageLink.value = item.blueprintLink;
remark.value = item.remark;
await queryData(updateItem.value.id)
await nextTick(); // DOM
// showPopup.value = true;
// updateItem.value = item;
// processDesignType.value = item.processDesignType;
// if (props.orderState == 0) {
// progress.value = 0;
// imageLink.value = item.blueprintLink;
// remark.value = item.remark;
// await queryData(updateItem.value.id)
// await nextTick(); // DOM
// // showPopup.value = true;
popup.value?.open()
selectedId.value = item.id;
} else {
// popup.value?.open()
// selectedId.value = item.id;
// } else {
const url = `/pages/moJuSheJiReport/moJuSheJiReport-detail?id=${item.id}&jd=${item.progress}`
uni.navigateTo({ url })
}
// }
// selectedId
/* */
}
@ -352,7 +352,7 @@
}
if (dataListAdd.value.length > 0) {
if (dataListAdd.value != null && dataList.value.length > 0) {
var indexs = -1;
for (var i = 0; i < dataListAdd.value.length; i++) {
@ -403,7 +403,7 @@
}
const overRow = async () => {
var indexs = -1;
if (dataListAdd.value.length > 0) {
if (dataListAdd.value != null && dataListAdd.value.length > 0) {
for (var i = 0; i < dataListAdd.value.length; i++) {
var item = dataListAdd.value[i];
if (item.isOver == 0) {

View File

@ -3,7 +3,8 @@ import { toRaw, ref, computed } from 'vue'
import { formatDate } from '@/utils/index'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { useLoginStore } from '@/stores/modules/login'
import { getTaskRepotPageAPI, getTaskDetailAPI, postOperateAPI,postOperateAPIEnd } 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 || []
@ -53,20 +54,18 @@ const getData = async () => {
integerpageSize: 5,
processDesignId: detailInfo.value.id,
}
detailInfo.value.active = 'START'
const data = await getTaskRepotPageAPI(params)
data.list.forEach((e) => {
e.createTime = e.createTime && formatDate(e.createTime, 'YYYY-MM-DD HH:mm')
/* e.endTimeStr = e.endTime && formatDate(e.endTime, 'YYYY-MM-DD HH:mm')
e.bgTime = e.bgTime && formatDate(e.bgTime, 'YYYY-MM-DD HH:mm')
e.entTime = e.entTime && formatDate(e.entTime, 'YYYY-MM-DD HH:mm') */
})
if (data.list[0]) {
formObj.value = data.list[0]
const time = formObj.value.endTime - formObj.value.startTime //
const leave1 = time % (24 * 3600 * 1000) //
workTime.value = Math.floor(leave1 / (3600 * 1000))
}
historyList.value = data.list
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'
}
}
}
isLoading.value = false
}
//
@ -96,9 +95,9 @@ onLoad(async (options: any) => {
await getData()
const obj = historyList.value[0]
//
if (obj && obj?.workTime == null && obj.endTime) {
popup.value?.open()
}
// if (obj && obj?.workTime == null && obj.endTime) {
// popup.value?.open()
// }
})
//
@ -114,6 +113,256 @@ const handleComplate = async () => {
url,
}) */
}
const processDesignType = ref('')
const formData = ref({
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()
}
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 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 handleOk = async (active) => {
const params = {
@ -155,7 +404,7 @@ const handleStart = async () => {
}
//
const handleStop = async () => {
popup.value.open();
popup.value?.open();
/* const params = {
id: detailInfo.value?.id,
active: 'END',
@ -167,7 +416,52 @@ const handleStop = async () => {
})
popup.value?.open() */
}
const getWorkTime = (beginTime, endTime) => {
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)
const formatDate = (datet) => {
if (datet == null) return ''
const date = new Date(datet)
const year = String(date.getFullYear())
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
const openPops = (item) =>{
if(item.isOver == 0){
popup.value?.open()
formObj.value = item
}
}
const oninput = (val, limit) => {
val = val.replace(/[^\d.]/g, ""); //
val = val.replace(/^00/, "0."); //0
val = val.replace(/^\./g, "0."); //0.
val = val.replace(/\.{2,}/g, "."); //
val = val.replace(".", "$#$").replace(/\./g, "").replace("$#$", "."); //
/^0\d+/.test(val) ? val = val.slice(1) : ''; //0
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$'
const reg = new RegExp(str)
if (limit === 0) {
//
val = val.replace(reg, '$1')
} else {
//
val = val.replace(reg, '$1.$2')
}
return val
}
const changeDate1 = (e,item) => {
item.endTime = e
item.workTime = getWorkTime(item.beginTime,item.endTime)
console.log(item.workTime)
}
</script>
<template>
<view class="data-detail">
@ -180,18 +474,32 @@ const handleStop = async () => {
<view class="statusTexthd" v-else-if="detailInfo.processDesignType == 'BLUEPRINT_FOUNDRY_TECHNOLOGY'"> 铸造设计 </view> -->
<view class="md">
<view class="product-item">项目{{detailInfo.projectName}}</view>
<image src="/static/images/productionReport-page.png" class="product-img" mode="scaleToFill"></image>
<view :class="[detailInfo.pgType == 1 ? 'had' : 'had', 'product-status']">{{
detailInfo.pgType == 1 ? '已完成' : '已完成' }}</view>
<view class="product-item">子项目{{ detailInfo.projectSubCode || '' }} {{' ' + detailInfo.projectSubName }}
<image src="/static/images/productionReport-page.png" class="product-img" mode="scaleToFill">
</image>
<view :class="[detailInfo.isOverProcess == 1 ? 'had' : 'unhad', 'product-status']">{{
detailInfo.isOverProcess == 1 ? '已完成' : '实施中' }}</view>
<view class="product-item">子项目{{ detailInfo.projectSubCode || '' }}
{{' ' + detailInfo.projectSubName }}
</view>
<view class="product-item" v-if="detailInfo.processDesignType == 'BLUEPRINT_2D'"> 设计类型2D设计
</view><!-- -->
<view class="product-item" v-else-if="detailInfo.processDesignType == 'BLUEPRINT_3D'"> 设计类型3D设计
</view>
<view class="product-item" v-else-if="detailInfo.processDesignType == 'BLUEPRINT_WORKBLANK'">
设计类型毛坯设计 </view>
<view class="product-item"
v-else-if="detailInfo.processDesignType == 'BLUEPRINT_FOUNDRY_TECHNOLOGY'"> 设计类型铸造设计
</view>
<view class="product-item" v-if="detailInfo.processDesignType == 'BLUEPRINT_2D'" > 设计类型2D设计 </view><!-- -->
<view class="product-item" v-else-if ="detailInfo.processDesignType == 'BLUEPRINT_3D'"> 设计类型3D设计 </view>
<view class="product-item" v-else-if="detailInfo.processDesignType == 'BLUEPRINT_WORKBLANK'"> 设计类型毛坯设计 </view>
<view class="product-item" v-else-if="detailInfo.processDesignType == 'BLUEPRINT_FOUNDRY_TECHNOLOGY'"> 设计类型铸造设计 </view>
<view class="product-item">客户名称{{detailInfo.customerName}}</view>
<view class="product-item">工艺起止日期{{detailInfo.twoDimDate}} {{detailInfo.threeDimDate}} </view>
<view class="product-item">最新进度{{detailInfo.progress}}%</view>
<view class="product-item" v-if="detailInfo.processDesignType== 'BLUEPRINT_2D'">
工艺起止日期{{formatDate(detailInfo.startTwoDimDate)}} {{formatDate(detailInfo.twoDimDate)}}
</view>
<view class="product-item" v-else-if="detailInfo.processDesignType== 'BLUEPRINT_3D'">
工艺起止日期{{formatDate(detailInfo.startThreeDimDate)}}
{{formatDate(detailInfo.threeDimDate)}} </view>
<view class="product-item" v-else-if="detailInfo.processDesignType== 'BLUEPRINT_WORKBLANK'">
工艺起止日期{{formatDate(detailInfo.startBlankDate)}} {{formatDate(detailInfo.blankDate)}}
</view>
</view>
</view>
</view>
@ -202,16 +510,16 @@ const handleStop = async () => {
无数据...
</view>
<template v-else>
<view class="item" v-for="(item, index) in historyList" :key="item.id">
<view class="item" v-for="(item, index) in historyList" :key="item.id" @click="openPops(item)">
<!-- <view class="product-row">
<view class="row-item">
<view class="label">报工人</view>
<view class="val high-color">{{ item.userName }}</view>
</view>
</view> -->
<view class="product-item">上报时间{{ item.createTime }}</view>
<view class="product-item">开始时间{{ formatDate(item.beginTime) }}</view>
<!-- <view class="product-item">生产结束时间{{ item.endTimeStr }}</view> -->
<view class="product-item">报工进度{{ item.progress+'%' }}</view>
<view class="product-item">结束时间{{formatDate(item.endTime) }}</view>
<!-- <view class="product-row">
<view class="row-item">
<view class="label">设计进度</view>
@ -222,10 +530,13 @@ const handleStop = async () => {
<view class="val high-color">{{ item.blueprintLink }}</view>
</view>
</view> -->
<view class="product-item">图纸链接{{item.blueprintLink }}</view>
<view class="product-item">
已做时间小时{{ getWorkTime(item.beginTime,item.endTime) }}
</view>
<view class="product-item">备注{{ item.remark }}</view>
<view class="tip-index">
<image src="/static/images/productionReport-detail-index.png" class="icon-status" mode="scaleToFit">
<image src="/static/images/productionReport-detail-index.png" class="icon-status"
mode="scaleToFit">
</image>
<view class="text">{{historyList.length - index}}</view>
</view>
@ -234,38 +545,45 @@ const handleStop = async () => {
</template>
</view>
</view>
<!-- <view class="action" v-if="detailInfo.pgType !== 1">
<view class="action-item start" v-if="detailInfo.active != 'START'" @click="handleStart">开始报工</view>
<view class="action-item stop" v-if="detailInfo.active == 'START'" @click="handleStop">结束报工</view>
</view> -->
<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>
</template>
<view class="loading-text" v-else>加载中..</view>
<uni-popup class="popup" ref="popup" :mask-click="false" 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> -->
</view>
<view class="cont">
<view class="item">
<view class="label">终检开始时间</view>
<view class="val">{{ formObj.startTime }}</view>
<view class="label">开始时间</view>
<view class="val"><uni-datetime-picker disabled type="datetime" style="text-align: center;"
v-model="formObj.beginTime" /></view>
</view>
<view class="item">
<view class="label">终检结束时间</view>
<view class="val">{{ formObj.endTime }}</view>
<view class="label"><span class="star">*</span>结束时间</view>
<view class="val"> <uni-datetime-picker :disabled="formObj.hasNext" 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 class="val" type="digit" v-model="workTime" placeholder="请输入本次报工工时"></uni-easyinput>
<view class="label"><span class="star">*</span>已做时间(小时)</view>
<uni-easyinput :disabled="formObj.hasNext"
@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 -->
<view class="unit">小时</view>
</view>
<view class="item">
<view class="label"><span class="star">*</span>本次报工数量</view>
<uni-easyinput class="val" type="number" v-model="amount" placeholder="请输入本次报工数量"></uni-easyinput>
<view class="unit"> {{ detailInfo.unit }}</view>
<view class="label">备注</view>
<uni-easyinput type="textarea" :disabled="formObj.hasNext" v-model="formObj.remark"
placeholder="请输入备注" />
<!-- <view class="unit"> {{ detailInfo.unit }}</view> -->
</view>
</view>
<view class="ok" @click="handleOk">确定</view>
<view class="ok" @click="overRow(formObj)">确定</view>
</uni-popup>
</view>
</template>
@ -302,20 +620,24 @@ const handleStop = async () => {
align-items: center;
color: #737D88
}
.product-row {
margin: 20rpx 0;
display: flex;
flex-direction: row;
justify-content: space-between;
color: #737D88;
.row-item {
flex: 1;
.label {
margin-bottom: 10rpx;
}
.val {
color: #1D2129;
&.high-color {
color: #00B42A
}
@ -324,6 +646,7 @@ const handleStop = async () => {
}
}
.statusTexthd {
position: absolute;
right: 75rpx;
@ -336,6 +659,7 @@ const handleStop = async () => {
background: #2d9ce6;
color: #fff;
}
.product-img {
position: absolute;
right: 0rpx;
@ -350,10 +674,12 @@ const handleStop = async () => {
border-raduis: 10rpx;
text-align: center;
padding: 8rpx 12rpx;
&.had {
background: #E8FFEA;
color: #00B42A;
}
&.unhad {
background: #FFF7E8;
color: #FF7D00;
@ -391,6 +717,7 @@ const handleStop = async () => {
}
}
.finish {
position: absolute;
right: 40rpx;
@ -404,6 +731,7 @@ const handleStop = async () => {
display: flex;
align-items: center;
justify-content: center;
.complate-img {
width: 30rpx;
height: 30rpx;
@ -445,10 +773,12 @@ const handleStop = async () => {
.product-item {
margin: 10rpx 0;
.hight-color {
color: #00B42A;
}
}
.product-row {
margin: 20rpx 0;
display: flex;
@ -460,8 +790,10 @@ const handleStop = async () => {
flex: 1;
display: flex;
flex-direction: row;
.label {
margin-bottom: 10rpx;
&.high-color {
color: #00B42A
}
@ -477,15 +809,18 @@ const handleStop = async () => {
}
}
.tip-index {
position: absolute;
top: 0rpx;
right: 0rpx;
.icon-status {
width: 100rpx;
height: 72rpx;
z-index: 1;
}
.text {
color: #fff;
position: absolute;
@ -594,6 +929,7 @@ const handleStop = async () => {
.label {
font-size: 32rpx;
width: 260rpx;
.star {
color: red
}
@ -603,6 +939,7 @@ const handleStop = async () => {
flex: 1;
font-size: 32rpx;
}
.unit {
width: 100rpx;
margin-left: 4rpx;

View File

@ -146,15 +146,15 @@ const onRefresherrefresh = async () => {
<view class="product-item">项目名称{{ item.projectName }}</view>
<view class="product-item">子项目{{ item.projectSubCode || '' }} {{' ' + item.projectSubName }}</view>
<view class="product-item">零件名称{{ item.materialName }}</view>
<view class="product-item">图号{{ item.blueprintNo }}</view>
<!-- <view class="product-row">
<!-- <view class="product-item">图号{{ item.blueprintNo }}</view> -->
<view class="product-row">
<view class="row-item">
<view class="label">模型名称: {{ item.mouldName }}</view>
<view class="label">图号{{ item.blueprintNo }}</view>
</view>
<view class="row-item">
<view class="label">派工工序: {{ item.procedureName }}</view>
</view>
</view> -->
</view>
<view class="product-row">
<view class="row-item">
<view class="label">派工数量</view>

View File

@ -18,6 +18,7 @@
}>()
const noticeMsg = ref('')
const isOverBeforeProcedure = async (id : number) => {
//console.log(props.orderState)
const params = {
id,
}
@ -27,9 +28,6 @@
//
noticeMsg.value = '上一道工序尚未完成报工!';
return true;
}else if(data.testYn != 'Y'){
noticeMsg.value = '上道工序过程检没有完成,请确认!';
return true;
}else {
return false;
}
@ -185,7 +183,7 @@
<view class="val high-color">{{ item.totalWorkTime }}</view>
</view>
</view>
<view class="product-item" :style=" item.endTime < todayStr ? 'color:red':null">预计生产日期{{ item.startTime }} {{ item.endTime }}</view>
<view class="product-item" :style=" (item.endTime < todayStr)&&props.orderState != '2' ? 'color:red':null">预计生产日期{{ item.startTime }} {{ item.endTime }}</view>
</view>
<view class="statusText">{{ statusText }}</view>
</view>

View File

@ -96,8 +96,6 @@
} else {
isShowEnd.value = false
}
console.log(isShowEnd.value);
console.log(isShowStart.value)
if (historyList.value != null && historyList.value.length > 0) {
var totalAmount = detailInfo.value.amount;
var beforeAmount = detailInfo.value.totalReportAmount