This commit is contained in:
andy 2026-06-02 17:05:51 +08:00
parent d60f4fc187
commit 1846e21b78
4 changed files with 141 additions and 14 deletions

View File

@ -117,15 +117,46 @@
</n-form-item> </n-form-item>
</n-gi> --> </n-gi> -->
<n-gi> <n-gi>
<n-form-item label="项目名称" path="projectName"> <n-form-item label="项目名称" path="projectCode">
<n-input v-if="formData.id" v-model:value="formData.projectName" disabled placeholder="请选择项目名称" /> <!-- <n-input v-if="formData.id" v-model:value="formData.projectName" disabled placeholder="请选择项目名称" />
<n-input v-else v-model:value="formData.projectName" @input="gongxu" placeholder="请选择产品名称" /> -->
<n-input v-if="formData.id" v-model:value="formData.projectName" disabled placeholder="请选择项目" />
<!--@search="xmhand"-->
<n-select
v-else
v-model:value="formData.projectCode"
filterable
placeholder="请选择项目"
:options="xmlist"
:loading="xmloading"
clearable
remote
:clear-filter-after-select="false"
@update:value="xmselupdate"
/>
</n-form-item> </n-form-item>
</n-gi> </n-gi>
<n-gi> <n-gi>
<n-form-item label="物料编码" path="code"> <n-form-item label="物料编码" path="code">
<n-input v-if="formData.id" v-model:value="formData.code" disabled placeholder="请选择物料编码" /> <n-input v-if="formData.id" v-model:value="formData.code" disabled placeholder="请选择物料编码" />
<n-input v-else v-model:value="formData.code" placeholder="请选择物料编码" /> <!-- <n-input v-else v-model:value="formData.code" placeholder="请选择物料编码" /> -->
<!-- @search="wlhand"-->
<n-select
v-else
v-model:value="formData.code"
filterable
placeholder="请选择物料编码"
:options="wllist"
:loading="wlloading"
clearable
remote
:clear-filter-after-select="false"
@update:value="gongxu"
/>
</n-form-item> </n-form-item>
</n-gi> </n-gi>
<n-gi> <n-gi>
@ -498,25 +529,25 @@ const columns = [
}, },
{ {
align:'center', align:'center',
minWidth: 150, minWidth: 180,
title: '开始时间', title: '开始时间',
key: 'beginTime' key: 'beginTime'
}, },
{ {
align:'center', align:'center',
minWidth: 150, minWidth: 180,
title: '结束时间', title: '结束时间',
key: 'endTime' key: 'endTime'
}, },
{ {
align:'center', align:'center',
minWidth: 150, minWidth: 180,
title: '实际开始时间', title: '实际开始时间',
key: 'actualStartTime' key: 'actualStartTime'
}, },
{ {
align:'center', align:'center',
minWidth: 150, minWidth: 180,
title: '实际结束时间', title: '实际结束时间',
key: 'actualEndTime' key: 'actualEndTime'
}, },
@ -540,7 +571,7 @@ const columns = [
}, },
{ {
align:'center', align:'center',
minWidth: 150, minWidth: 180,
title: '派工时间', title: '派工时间',
key: 'assingWorkTime' key: 'assingWorkTime'
}, },
@ -662,10 +693,11 @@ function handleCheck(keys: Array<string | number>) {
// //
let planList = ref<any>([]) let planList = ref<any>([])
function gongxu(){ function gongxu(){
if(formData.productionCode){ if(formData.code){
planList.value.splice(0) planList.value.splice(0)
orderItemApi.preCreation({ orderItemApi.preCreation({
//productionCode:formData.productionCode //productionCode:formData.productionCode
code:formData.code,
projectCode:formData.projectCode projectCode:formData.projectCode
}).then((rps:any) => { }).then((rps:any) => {
planList.value = rps.planList?rps.planList:[] planList.value = rps.planList?rps.planList:[]
@ -691,9 +723,75 @@ function handleAdd() {
Object.assign(formData, defaultFormData) Object.assign(formData, defaultFormData)
modalVisible.value = true modalVisible.value = true
xmhand()
planList.value.splice(0) planList.value.splice(0)
} }
//
let xmlist = ref<any>([])
let xmloading = ref(false)
function xmhand() {
xmloading.value = true
orderItemApi.xmoptions({
// page: 1,
// pageSize: 100,
// username: v,
}).then((rps:any) =>{
if(rps && rps.length > 0){
xmlist.value = rps.map((n:any) => {
return {
label:n.label,
value:n.value+''
}
})
}
xmloading.value = false
}).catch(() => {
xmloading.value = false
})
}
let wllist = ref<any>([])
function xmselupdate(v:any,opt:any) {
// console.log(v,'sle')
// console.log(opt,'opt')
planList.value.splice(0)
wllist.value.splice(0)
formData.code = ''
formData.projectName = opt.label
if(v){
wlhand(opt.value)
}
}
//
let wlloading = ref(false)
function wlhand(v:any) {
wlloading.value = true
orderItemApi.wloptions({
projectId:v
// page: 1,
// pageSize: 100,
// username: v
}).then((rps:any) =>{
if(rps && rps.length > 0){
wllist.value = rps.map((n:any) => {
return {
label:n.label,
value:n.value+''
}
})
}
console.log(yglist.value,'12')
wlloading.value = false
}).catch(() => {
wlloading.value = false
})
}
// //
function handleEdit(row: OrderItem) { function handleEdit(row: OrderItem) {
modalTitle.value = '编辑生产订单' modalTitle.value = '编辑生产订单'

View File

@ -463,7 +463,7 @@ const columns = [
// { type: 'selection' }, // { type: 'selection' },
{ {
align:'center', align:'center',
minWidth: 150, minWidth: 240,
title: '工序名称', title: '工序名称',
key: 'name' key: 'name'
}, },

View File

@ -114,6 +114,33 @@ function initGantt() {
{ name: "end_date", label: "计划结束", align: "center", width: 130 }, { name: "end_date", label: "计划结束", align: "center", width: 130 },
] ]
//??
gantt.config.layout = {
css: "gantt_container",
cols: [
{
width: 300,
minWidth: 200,
maxWidth: 600,
rows: [
{ view: "grid", scrollX: "gridScroll", scrollable: true,
scrollY: "scrollVer"
},
{ view: "scrollbar", id: "gridScroll", group: "horizontal" } /*!*/
]
},
{ resizer: true, width: 1 },
{
rows: [
{ view: "timeline", scrollX: "scrollHor", scrollY: "scrollVer" },
{ view: "scrollbar", id: "scrollHor", group: "horizontal" } /*!*/
]
},
{ view: "scrollbar", id: "scrollVer" }
]
}
//??
// //
gantt.config.drag_progress = false // gantt.config.drag_progress = false //
gantt.config.drag_links = false // 线 gantt.config.drag_links = false // 线
@ -166,7 +193,7 @@ function renderGanttData() {
if (maxDate <= minDate) maxDate = new Date(minDate.getTime() + 86400000) if (maxDate <= minDate) maxDate = new Date(minDate.getTime() + 86400000)
tasks.push({ tasks.push({
id: moId, id: moId,
text: mo.productionOrderNo || mo.billNo || '未知单号', text: mo.materialCode || '', //mo.productionOrderNo || mo.billNo || '', ??
materialCode: mo.materialCode || '', materialCode: mo.materialCode || '',
name: mo.materialName || '产品', name: mo.materialName || '产品',
start_date: formatGanttDate(minDate), start_date: formatGanttDate(minDate),
@ -174,6 +201,7 @@ function renderGanttData() {
open: false, // open: false, //
type: gantt.config.types.project, type: gantt.config.types.project,
_type: 'mo', _type: 'mo',
progress:0.6, //??
_raw: mo _raw: mo
}) })
@ -189,7 +217,7 @@ function renderGanttData() {
tasks.push({ tasks.push({
id: routeId, id: routeId,
text: route.operNumber != null ? String(route.operNumber) : String(index + 1), text:mo.materialCode || '', //route.operNumber != null ? String(route.operNumber) : String(index + 1), ??
materialCode: '', materialCode: '',
name: route.processProperty || '工序', name: route.processProperty || '工序',
color: processColors[index % processColors.length], color: processColors[index % processColors.length],
@ -197,6 +225,7 @@ function renderGanttData() {
end_date: formatGanttDate(rEnd), end_date: formatGanttDate(rEnd),
parent: moId, parent: moId,
_type: 'route', _type: 'route',
progress:0.6, //??
_raw: route _raw: route
}) })
}) })

View File

@ -476,7 +476,7 @@ const columns = [
align:'center', align:'center',
title: '暂停/改派时间', title: '暂停/改派时间',
key: 'pauseTime', key: 'pauseTime',
minWidth: 150 minWidth: 180
}, },
{ {
align:'center', align:'center',