Browse Source

2026-07-21

优化
master
fengyuan_yang 1 week ago
parent
commit
e137c2d1d7
  1. 191
      src/views/modules/shopOrder/workOrderAlloc/searchWorkOrderDetailsAlloc.vue

191
src/views/modules/shopOrder/workOrderAlloc/searchWorkOrderDetailsAlloc.vue

@ -39,88 +39,47 @@
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="订单类型">
<el-input v-model="searchData.orderType" placeholder="请输入订单类型" clearable @click.native="getBaseList(16)"></el-input>
<el-form-item label="工单号">
<el-input v-model="searchData.orderNo" placeholder="请输入工单号" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="生产订单号">
<el-input v-model="searchData.orderNo" placeholder="请输入订单号" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="派工单号">
<el-input v-model="searchData.seqNo" placeholder="请输入派工单号" clearable></el-input>
<el-form-item label="订单状态">
<el-select v-model="searchData.orderStatus" placeholder="请选择状态" clearable style="width: 100%">
<el-option label="全部" value=""></el-option>
<el-option label="已计划" value="已计划"></el-option>
<el-option label="已下达" value="已下达"></el-option>
<el-option label="已排产" value="已排产"></el-option>
<el-option label="已开工" value="已开工"></el-option>
<el-option label="已停工" value="已停工"></el-option>
<el-option label="已完工" value="已完工"></el-option>
<el-option label="已关闭" value="已关闭"></el-option>
<el-option label="已取消" value="已取消"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="物料编码">
<el-input v-model="searchData.partNo" placeholder="请输入物料编码" clearable @click.native="getBaseList(5)"></el-input>
<el-input v-model="searchData.partNo" placeholder="请输入物料编码" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="物料名称">
<el-input v-model="searchData.partDescription" placeholder="请输入物料名称" clearable></el-input>
<el-input v-model="searchData.partDesc" placeholder="请输入物料名称" clearable></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="4">
<el-form-item label="报工人">
<el-input v-model="searchData.userName" placeholder="请输入报工人" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="加工中心">
<el-input v-model="searchData.workCenterNo" placeholder="请输入加工中心" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工单创建日期">
<el-date-picker
v-model="searchData.date1"
type="date"
value-format="yyyy-MM-dd"
placeholder="开始日期"
style="width: 45%">
</el-date-picker>
<span style="margin: 0 6px; color: #DCDFE6;">~</span>
<el-date-picker
v-model="searchData.date2"
type="date"
value-format="yyyy-MM-dd"
placeholder="结束日期"
style="width: 45%">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划完工日期">
<el-date-picker
v-model="searchData.date3"
type="date"
value-format="yyyy-MM-dd"
placeholder="开始日期"
style="width: 45%">
</el-date-picker>
<span style="margin: 0 6px; color: #DCDFE6;">~</span>
<el-date-picker
v-model="searchData.date4"
type="date"
value-format="yyyy-MM-dd"
placeholder="结束日期"
style="width: 45%">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="8">
<el-form-item label="实际完工日期">
<el-form-item label="报工时间">
<el-date-picker
v-model="searchData.finishDate1"
v-model="searchData.reportStartDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="开始日期"
@ -128,26 +87,7 @@
</el-date-picker>
<span style="margin: 0 6px; color: #DCDFE6;">~</span>
<el-date-picker
v-model="searchData.finishDate2"
type="date"
value-format="yyyy-MM-dd"
placeholder="结束日期"
style="width: 45%">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报工日期">
<el-date-picker
v-model="searchData.reportDate1"
type="date"
value-format="yyyy-MM-dd"
placeholder="开始日期"
style="width: 45%">
</el-date-picker>
<span style="margin: 0 6px; color: #DCDFE6;">~</span>
<el-date-picker
v-model="searchData.reportDate2"
v-model="searchData.reportEndDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="结束日期"
@ -333,12 +273,10 @@
</el-tab-pane>
</el-tabs>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import Chooselist from '@/views/modules/common/Chooselist'
import {
searchWorkOrderDetailsForAlloc,
selectWorkOrderDetailsByAllocType,
@ -349,13 +287,9 @@ import { getSiteList } from '@/api/report/partTemplateStatus.js'
export default {
name: 'searchWorkOrderDetailsAlloc',
components: {
Chooselist
},
data () {
return {
siteList: [],
tagNo: '',
searchExpanded: true,
searchLoading: false,
allocLoading: false,
@ -372,21 +306,13 @@ export default {
totalPage: 0,
searchData: {
site: '',
orderType: '',
orderNo: '',
seqNo: '',
orderStatus: '',
partNo: '',
partDescription: '',
partDesc: '',
userName: '',
workCenterNo: '',
date1: '',
date2: '',
date3: '',
date4: '',
finishDate1: '',
finishDate2: '',
reportDate1: '',
reportDate2: '',
reportStartDate: '',
reportEndDate: '',
user: this.$store.state.user.name,
page: 0,
limit: 20
@ -446,11 +372,8 @@ export default {
searchData: {
deep: true,
handler () {
this.searchData.orderType = (this.searchData.orderType || '').toUpperCase()
this.searchData.partNo = (this.searchData.partNo || '').toUpperCase()
this.searchData.orderNo = (this.searchData.orderNo || '').toUpperCase()
this.searchData.seqNo = (this.searchData.seqNo || '').toUpperCase()
this.searchData.workCenterNo = (this.searchData.workCenterNo || '').toUpperCase()
}
}
},
@ -507,13 +430,13 @@ export default {
return `${y}-${m}-${d}`
}
this.searchData.date1 = formatDate(firstDay)
this.searchData.date2 = formatDate(lastDay)
this.searchData.reportStartDate = formatDate(firstDay)
this.searchData.reportEndDate = formatDate(lastDay)
},
calculateTableHeight () {
this.$nextTick(() => {
const windowHeight = window.innerHeight
const headerHeight = this.searchExpanded ? 486 : 294
const headerHeight = this.searchExpanded ? 414 : 294
this.orderTableHeight = (windowHeight - headerHeight - 85) / 2
this.allocTableHeight = (windowHeight - headerHeight - 85) / 2
})
@ -525,21 +448,13 @@ export default {
resetSearch () {
this.searchData = {
site: '',
orderType: '',
orderNo: '',
seqNo: '',
orderStatus: '',
partNo: '',
partDescription: '',
partDesc: '',
userName: '',
workCenterNo: '',
date1: '',
date2: '',
date3: '',
date4: '',
finishDate1: '',
finishDate2: '',
reportDate1: '',
reportDate2: '',
reportStartDate: '',
reportEndDate: '',
user: this.$store.state.user.name,
page: 0,
limit: 20
@ -549,34 +464,34 @@ export default {
this.allocList = []
this.setDefaultDateRange()
},
getBaseData (val) {
if (this.tagNo === 16) {
this.searchData.orderType = val.OrderType
buildAllocQueryParams () {
return {
site: this.searchData.site || '',
orderNo: this.searchData.orderNo || '',
orderStatus: this.searchData.orderStatus || '',
partNo: this.searchData.partNo || '',
partDesc: this.searchData.partDesc || '',
reportStartDate: this.searchData.reportStartDate || '',
reportEndDate: this.searchData.reportEndDate || '',
userName: this.searchData.userName || '',
// 使
status: this.searchData.orderStatus || '',
partDescription: this.searchData.partDesc || '',
reportDate1: this.searchData.reportStartDate || '',
reportDate2: this.searchData.reportEndDate || ''
}
if (this.tagNo === 5) {
this.searchData.partNo = val.PartNo
}
},
getBaseList (val) {
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
if (val === 16) {
strVal = this.searchData.orderType
}
if (val === 5) {
strVal = this.searchData.partNo
}
this.$refs.baseList.init(val, strVal)
})
},
getData () {
this.searchLoading = true
this.orderListLoading = true
this.searchData.limit = this.pageSize
this.searchData.page = (this.pageIndex - 1) * this.pageSize
const queryData = {
...this.buildAllocQueryParams(),
user: this.searchData.user,
limit: this.pageSize,
page: (this.pageIndex - 1) * this.pageSize
}
searchWorkOrderDetailsForAlloc(this.searchData)
searchWorkOrderDetailsForAlloc(queryData)
.then(({ data }) => {
this.searchLoading = false
this.orderListLoading = false
@ -666,7 +581,7 @@ export default {
doExecuteAlloc () {
this.allocLoading = true
const requestData = {
...this.searchData,
...this.buildAllocQueryParams(),
user: this.$store.state.user.name
}

Loading…
Cancel
Save