-
{{ process.processName || '-' }}
+
+
+ {{ process.operNumber }}
+ {{ process.processName || '-' }}
+
+ {{ materialCode }}
+
{{ statusTag.label }}
@@ -39,22 +45,28 @@
+
+ 转入
+ {{ process.transferInQty ?? 0 }}
+
剩余物料
{{ remainQty }}
+
- 转下道
+ 转出
{{ process.transferOutQty ?? 0 }}
@@ -110,6 +122,16 @@ import { PROCESS_STATUS_MAP, type ProcessPlanItemVO } from '@/api/orderProcessPl
const props = defineProps<{
process: ProcessPlanItemVO
+ /** 物料编码(订单头) */
+ materialCode?: string
+ /** 生产订单编号(订单头 orderCode) */
+ orderCode?: string
+ /** 订单计划开始(订单头 beginTime,工序无计划时间时回退) */
+ orderBeginTime?: string
+ /** 订单计划结束(订单头 endTime) */
+ orderEndTime?: string
+ /** 生产车间(订单头 proWorkshop) */
+ proWorkshop?: string
isLast?: boolean
canEdit?: boolean
canAssign?: boolean
@@ -171,15 +193,39 @@ const railColor = computed(() => {
const personnel = computed(() => {
if (props.process.assignByName) return props.process.assignByName
const list = props.process.assignWorkList
- if (list?.length) return `${list.length} 人派工`
+ if (list?.length) {
+ const names = list
+ .map((a: any) => a.userName || a.userId)
+ .filter(Boolean)
+ if (names.length) return names.join('、')
+ return `${list.length} 人派工`
+ }
return '-'
})
+const workshopText = computed(() => {
+ return props.process.departmentName || props.proWorkshop || '-'
+})
+
+const deviceText = computed(() => {
+ const list = props.process.assignWorkList as any[] | undefined
+ if (!list?.length) return '-'
+ const devices = list
+ .map((a) => a.deviceName || a.deviceId)
+ .filter(Boolean)
+ return devices.length ? [...new Set(devices)].join('、') : '-'
+})
+
const planTimeText = computed(() => {
- const start = props.process.planStartTime
- const end = props.process.planFinishTime
+ // 工序计划时间优先;没有则回退订单头 beginTime/endTime
+ const start = props.process.planStartTime || props.process.beginTime || props.orderBeginTime
+ const end = props.process.planFinishTime || props.process.endTime || props.orderEndTime
if (!start && !end) return '-'
- if (start && end) return `${start.slice(0, 16)} ~ ${end.slice(11, 16)}`
+ if (start && end) {
+ const startText = start.length >= 16 ? start.slice(0, 16) : start
+ const endText = end.length >= 16 ? end.slice(11, 16) : end
+ return `${startText} ~ ${endText}`
+ }
return start || end || '-'
})
@@ -252,6 +298,29 @@ const planTimeText = computed(() => {
white-space: nowrap;
}
+.card-oper {
+ font-style: normal;
+ font-weight: 700;
+ margin-right: 4px;
+ opacity: 0.95;
+}
+
+.card-title-block {
+ min-width: 0;
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+}
+
+.card-material {
+ font-size: 11px;
+ font-weight: 500;
+ opacity: 0.85;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
.card-progress {
display: flex;
justify-content: center;
diff --git a/src/views/biz/orderProcessPlan/index.vue b/src/views/biz/orderProcessPlan/index.vue
index efdb07a..9f03e54 100644
--- a/src/views/biz/orderProcessPlan/index.vue
+++ b/src/views/biz/orderProcessPlan/index.vue
@@ -233,6 +233,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -816,6 +826,8 @@ let dispatchform = reactive({
endTime:'',
userid:'',
quantity:'',
+ completedQty: 0,
+ remainQty: 0,
list:[{
userId:'',
quantity:''
@@ -866,17 +878,22 @@ function deletenum(index:any) {
function disphand(process: ProcessPlanItemVO, order?: OrderProcessPlanVO) {
const entity = processItemToEntity(process, order?.orderItemId)
+ const planQty = Number(entity.quantity) || 0
+ const completedQty = Number(process.completedQty) || 0
+ const remainQty = Math.max(0, planQty - completedQty)
dispatchmodal.value = true
dispatchformRef.value?.restoreValidation()
dispatchform.id = entity.id
dispatchform.name = entity.name
- dispatchform.beginTime = entity.beginTime
- dispatchform.endTime = entity.endTime
+ dispatchform.beginTime = entity.beginTime || order?.beginTime || ''
+ dispatchform.endTime = entity.endTime || order?.endTime || ''
dispatchform.quantity = entity.quantity
+ dispatchform.completedQty = completedQty
+ dispatchform.remainQty = remainQty
dispatchform.userid = ''
dispatchform.list = [{
userId: '',
- quantity: '',
+ quantity: remainQty || '',
}]
}
@@ -885,10 +902,15 @@ function dispatchSubmit() {
dispatchform.list.forEach((n:any) => {
total = n.quantity*1+total
})
+ const remainQty = Number(dispatchform.remainQty)
+ if (remainQty <= 0) {
+ message.warning('当前工序已全部完成,无需再派工')
+ return
+ }
dispatchformRef.value?.validate((v:any) => {
if(!v){
- if(total != dispatchform.quantity){
- message.error('派工总数量需等于生产总数',{
+ if(total != remainQty){
+ message.error(`派工总数量需等于待派数量 ${remainQty}(计划 ${dispatchform.quantity},已完成 ${dispatchform.completedQty ?? 0})`,{
duration:4000
})
}else{