@ -1,6 +1,5 @@
< template >
< template >
< ContentWrap >
< ContentWrap >
<!-- 搜索工作栏 -- >
< el -form
< el -form
class = "-mb-15px"
class = "-mb-15px"
: model = "queryParams"
: model = "queryParams"
@ -9,84 +8,82 @@
label - width = "auto"
label - width = "auto"
label - position = "left"
label - position = "left"
>
>
< el -form -item label = "任务单编码 " prop = "code" >
< el -form -item :label ="t('ProductionReport.Index.searchCodeLabel') " prop = "code" >
< el -input
< el -input
v - model = "queryParams.code"
v - model = "queryParams.code"
placeholder = "请输入任务单编码 "
: placeholder = "t('ProductionReport.Index.searchCodePlaceholder') "
clearable
clearable
@ keyup . enter = "handleQuery"
@ keyup . enter = "handleQuery"
class = "!w-240px"
class = "!w-240px"
/ >
/ >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< el -form -item label = "下达日期 " prop = "orderDate" >
< el -form -item :label ="t('ProductionReport.Index.searchOrderDateLabel') " prop = "orderDate" >
< el -date -picker
< el -date -picker
v - model = "queryParams.orderDate"
v - model = "queryParams.orderDate"
@ change = "handleQuery"
@ change = "handleQuery"
value - format = "YYYY-MM-DD HH:mm:ss"
value - format = "YYYY-MM-DD HH:mm:ss"
type = "daterange"
type = "daterange"
start - placeholder = " 开始日期 "
: start - placeholder = " t('ProductionReport.Index.startDatePlaceholder') "
end - placeholder = " 结束日期 "
: end - placeholder = " t('ProductionReport.Index.endDatePlaceholder') "
: default - time = "[new Date('1 00:00:00'), new Date('1 23:59:59')]"
: default - time = "[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class = "!w-240px"
class = "!w-240px"
/ >
/ >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< el -form -item label = "交货日期 " prop = "deliveryDate" >
< el -form -item :label ="t('ProductionReport.Index.searchDeliveryDateLabel') " prop = "deliveryDate" >
< el -date -picker
< el -date -picker
v - model = "queryParams.deliveryDate"
v - model = "queryParams.deliveryDate"
value - format = "YYYY-MM-DD HH:mm:ss"
value - format = "YYYY-MM-DD HH:mm:ss"
@ change = "handleQuery"
@ change = "handleQuery"
type = "daterange"
type = "daterange"
start - placeholder = " 开始日期 "
: start - placeholder = " t('ProductionReport.Index.startDatePlaceholder') "
end - placeholder = " 结束日期 "
: end - placeholder = " t('ProductionReport.Index.endDatePlaceholder') "
: default - time = "[new Date('1 00:00:00'), new Date('1 23:59:59')]"
: default - time = "[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class = "!w-240px"
class = "!w-240px"
/ >
/ >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< el -form -item label = "备注 " prop = "remark" >
< el -form -item :label ="t('ProductionReport.Index.searchRemarkLabel') " prop = "remark" >
< el -input
< el -input
v - model = "queryParams.remark"
v - model = "queryParams.remark"
placeholder = "请输入备注 "
: placeholder = "t('ProductionReport.Index.searchRemarkPlaceholder') "
clearable
clearable
@ keyup . enter = "handleQuery"
@ keyup . enter = "handleQuery"
class = "!w-240px"
class = "!w-240px"
/ >
/ >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< el -form -item label = "创建时间 " prop = "createTime" >
< el -form -item :label ="t('ProductionReport.Index.searchCreateTimeLabel') " prop = "createTime" >
< el -date -picker
< el -date -picker
v - model = "queryParams.createTime"
v - model = "queryParams.createTime"
@ change = "handleQuery"
@ change = "handleQuery"
value - format = "YYYY-MM-DD HH:mm:ss"
value - format = "YYYY-MM-DD HH:mm:ss"
type = "daterange"
type = "daterange"
start - placeholder = " 开始日期 "
: start - placeholder = " t('ProductionReport.Index.startDatePlaceholder') "
end - placeholder = " 结束日期 "
: end - placeholder = " t('ProductionReport.Index.endDatePlaceholder') "
: default - time = "[new Date('1 00:00:00'), new Date('1 23:59:59')]"
: default - time = "[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class = "!w-240px"
class = "!w-240px"
/ >
/ >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< el -form -item >
< el -form -item >
< el -button @click ="handleQuery" >
< el -button @click ="handleQuery" >
< Icon icon = "ep:search" class = "mr-5px" / > 搜索
< Icon icon = "ep:search" class = "mr-5px" / > { { t ( 'ProductionReport.Index.buttonSearch' ) } }
< / e l - b u t t o n >
< / e l - b u t t o n >
< el -button @click ="resetQuery" >
< el -button @click ="resetQuery" >
< Icon icon = "ep:refresh" class = "mr-5px" / > 重置
< Icon icon = "ep:refresh" class = "mr-5px" / > { { t ( 'ProductionReport.Index.buttonReset' ) } }
< / e l - b u t t o n >
< / e l - b u t t o n >
< el -button type = "success" plain @click ="handleExport" :loading ="exportLoading" >
< el -button type = "success" plain @click ="handleExport" :loading ="exportLoading" >
< Icon icon = "ep:download" class = "mr-5px" / > 导出
< Icon icon = "ep:download" class = "mr-5px" / > { { t ( 'ProductionReport.Index.buttonExport' ) } }
< / e l - b u t t o n >
< / e l - b u t t o n >
< / e l - f o r m - i t e m >
< / e l - f o r m - i t e m >
< / e l - f o r m >
< / e l - f o r m >
< / ContentWrap >
< / ContentWrap >
<!-- 列表 -- >
< ContentWrap >
< ContentWrap >
<!-- 状态Tabs -- >
< el -tabs v-model ="activeStatusTab" @tab-click="handleTabClick" >
< el -tabs v-model ="activeStatusTab" @tab-click="handleTabClick" >
< el -tab -pane label = "全部 " name = "" / >
< el -tab -pane :label ="t('ProductionReport.Index.tabAll') " name = "" / >
< el -tab -pane label = "已下达 " name = "2" / >
< el -tab -pane :label ="t('ProductionReport.Index.tabIssued') " name = "2" / >
< el -tab -pane label = "部分排产 " name = "7" / >
< el -tab -pane :label ="t('ProductionReport.Index.tabPartialScheduled') " name = "7" / >
< el -tab -pane label = "待生产 " name = "8" / >
< el -tab -pane :label ="t('ProductionReport.Index.tabPendingProduction') " name = "8" / >
< el -tab -pane label = "生产中 " name = "9" / >
< el -tab -pane :label ="t('ProductionReport.Index.tabInProduction') " name = "9" / >
< el -tab -pane label = "已完成 " name = "10" / >
< el -tab -pane :label ="t('ProductionReport.Index.tabCompleted') " name = "10" / >
< / e l - t a b s >
< / e l - t a b s >
< el -table
< el -table
v - loading = "loading"
v - loading = "loading"
@ -96,26 +93,26 @@
highlight - current - row
highlight - current - row
@ current - change = "handleCurrentChange"
@ current - change = "handleCurrentChange"
>
>
< el -table -column label = "任务单编码 " align = "center" prop = "code" width = "200px" sortable / >
< el -table -column :label ="t('ProductionReport.Index.tableCode') " align = "center" prop = "code" width = "200px" sortable / >
< el -table -column label = "下达日期 " align = "center" prop = "orderDate" :formatter ="dateFormatter2" sortable / >
< el -table -column :label ="t('ProductionReport.Index.tableOrderDate') " align = "center" prop = "orderDate" :formatter ="dateFormatter2" sortable / >
< el -table -column
< el -table -column
label = "交货日期 "
: label = "t('ProductionReport.Index.tableDeliveryDate') "
align = "center"
align = "center"
prop = "deliveryDate"
prop = "deliveryDate"
: formatter = "deliveryDateFormatter"
: formatter = "deliveryDateFormatter"
sortable
sortable
/ >
/ >
< el -table -column label = "状态 " align = "center" prop = "status" sortable >
< el -table -column :label ="t('ProductionReport.Index.tableStatus') " align = "center" prop = "status" sortable >
< template # default = "scope" >
< template # default = "scope" >
< dict -tag :type ="DICT_TYPE.MES_TASK_STATUS" :value ="scope.row.status" / >
< dict -tag :type ="DICT_TYPE.MES_TASK_STATUS" :value ="scope.row.status" / >
< / template >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "是否排产 " align = "center" >
< el -table -column :label ="t('ProductionReport.Index.tableIsScheduled') " align = "center" >
< template # default = "scope" >
< template # default = "scope" >
< el -tag : type = "scope.row.isScheduled ? 'success' : 'info'" > { { scope . row . isScheduled ? '是' : '否' } } < / e l - t a g >
< el -tag : type = "scope.row.isScheduled ? 'success' : 'info'" > { { scope . row . isScheduled ? t ( 'ProductionReport.Index.yes' ) : t ( 'ProductionReport.Index.no' ) } } < / e l - t a g >
< / template >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "生产进度 " align = "center" min -width = " 60px " >
< el -table -column :label ="t('ProductionReport.Index.tableProductionProgress') " align = "center" min -width = " 60px " >
< template # default = "scope" >
< template # default = "scope" >
< div class = "production-progress-cell" >
< div class = "production-progress-cell" >
< el -progress
< el -progress
@ -130,9 +127,8 @@
< / div >
< / div >
< / template >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e - c o l u m n >
< el -table -column label = "备注 " align = "center" prop = "remark" / >
< el -table -column :label ="t('ProductionReport.Index.tableRemark') " align = "center" prop = "remark" / >
< / e l - t a b l e >
< / e l - t a b l e >
<!-- 分页 -- >
< Pagination
< Pagination
: total = "total"
: total = "total"
v - model : page = "queryParams.pageNo"
v - model : page = "queryParams.pageNo"
@ -141,23 +137,18 @@
/ >
/ >
< / ContentWrap >
< / ContentWrap >
<!-- 详情Tabs -- >
< ContentWrap v-if ="currentRow && currentRow.id" >
< ContentWrap v-if ="currentRow && currentRow.id" >
< el -tabs v-model ="activeTabName" >
< el -tabs v-model ="activeTabName" >
<!-- 基础信息 -- >
< el -tab -pane :label ="t('ProductionReport.Index.detailTabBasicInfo')" name = "basicInfo" >
< el -tab -pane label = "基础信息" name = "basicInfo" >
< ProductionReportBasicInfo :task-id ="currentRow.id" :task-delivery-date ="currentRow.deliveryDate" / >
< ProductionReportBasicInfo :task-id ="currentRow.id" :task-delivery-date ="currentRow.deliveryDate" / >
< / e l - t a b - p a n e >
< / e l - t a b - p a n e >
<!-- 关联计划 -- >
< el -tab -pane :label ="t('ProductionReport.Index.detailTabRelatedPlan')" name = "relatedPlan" >
< el -tab -pane label = "关联计划" name = "relatedPlan" >
< ProductionReportRelatedPlan :task-id ="currentRow.id" / >
< ProductionReportRelatedPlan :task-id ="currentRow.id" / >
< / e l - t a b - p a n e >
< / e l - t a b - p a n e >
<!-- 质检信息 -- >
< el -tab -pane :label ="t('ProductionReport.Index.detailTabQualityInfo')" name = "qualityInfo" >
< el -tab -pane label = "质检信息" name = "qualityInfo" >
< ProductionReportQualityInfo :task-id ="currentRow.id" / >
< ProductionReportQualityInfo :task-id ="currentRow.id" / >
< / e l - t a b - p a n e >
< / e l - t a b - p a n e >
<!-- 报工信息 -- >
< el -tab -pane :label ="t('ProductionReport.Index.detailTabBaogongInfo')" name = "baogongInfo" >
< el -tab -pane label = "报工信息" name = "baogongInfo" >
< ProductionReportBaogongInfo :task-id ="currentRow.id" / >
< ProductionReportBaogongInfo :task-id ="currentRow.id" / >
< / e l - t a b - p a n e >
< / e l - t a b - p a n e >
< / e l - t a b s >
< / e l - t a b s >
@ -173,15 +164,16 @@ import ProductionReportBasicInfo from './components/ProductionReportBasicInfo.vu
import ProductionReportRelatedPlan from './components/ProductionReportRelatedPlan.vue'
import ProductionReportRelatedPlan from './components/ProductionReportRelatedPlan.vue'
import ProductionReportQualityInfo from './components/ProductionReportQualityInfo.vue'
import ProductionReportQualityInfo from './components/ProductionReportQualityInfo.vue'
import ProductionReportBaogongInfo from './components/ProductionReportBaogongInfo.vue'
import ProductionReportBaogongInfo from './components/ProductionReportBaogongInfo.vue'
import { useI18n } from '@/hooks/web/useI18n'
/** 生产报表 列表 */
defineOptions ( { name : 'ProductionReport' } )
defineOptions ( { name : 'ProductionReport' } )
const message = useMessage ( ) / / 消 息 弹 窗
const { t } = useI18n ( )
const message = useMessage ( )
const loading = ref ( true ) / / 列 表 的 加 载 中
const loading = ref ( true )
const list = ref < TaskVO [ ] > ( [ ] ) / / 列 表 的 数 据
const list = ref < TaskVO [ ] > ( [ ] )
const total = ref ( 0 ) / / 列 表 的 总 页 数
const total = ref ( 0 )
const queryParams = reactive ( {
const queryParams = reactive ( {
pageNo : 1 ,
pageNo : 1 ,
pageSize : 10 ,
pageSize : 10 ,
@ -192,11 +184,11 @@ const queryParams = reactive({
remark : undefined ,
remark : undefined ,
createTime : [ ]
createTime : [ ]
} )
} )
const queryFormRef = ref ( ) / / 搜 索 的 表 单
const queryFormRef = ref ( )
const exportLoading = ref ( false ) / / 导 出 的 加 载 中
const exportLoading = ref ( false )
const activeTabName = ref ( 'basicInfo' ) / / 当 前 详 情 t a b
const activeTabName = ref ( 'basicInfo' )
const activeStatusTab = ref ( '' ) / / 当 前 状 态 t a b
const activeStatusTab = ref ( '' )
const deliveryDateFormatter = ( _row : any , _column : any , value : any ) => {
const deliveryDateFormatter = ( _row : any , _column : any , value : any ) => {
if ( value ) return dateFormatter2 ( _row , _column , value )
if ( value ) return dateFormatter2 ( _row , _column , value )
@ -211,7 +203,6 @@ const getProductionProgressPercent = (row: any) => {
return Math . max ( 0 , Math . min ( 100 , Number ( rawPercent . toFixed ( 2 ) ) ) )
return Math . max ( 0 , Math . min ( 100 , Number ( rawPercent . toFixed ( 2 ) ) ) )
}
}
/** 查询列表 */
const getList = async ( ) => {
const getList = async ( ) => {
loading . value = true
loading . value = true
try {
try {
@ -223,35 +214,29 @@ const getList = async () => {
}
}
}
}
/** 搜索按钮操作 */
const handleQuery = ( ) => {
const handleQuery = ( ) => {
queryParams . pageNo = 1
queryParams . pageNo = 1
getList ( )
getList ( )
}
}
/** 重置按钮操作 */
const resetQuery = ( ) => {
const resetQuery = ( ) => {
queryFormRef . value . resetFields ( )
queryFormRef . value . resetFields ( )
handleQuery ( )
handleQuery ( )
}
}
/** 导出按钮操作 */
const handleExport = async ( ) => {
const handleExport = async ( ) => {
try {
try {
/ / 导 出 的 二 次 确 认
await message . exportConfirm ( )
await message . exportConfirm ( )
/ / 发 起 导 出
exportLoading . value = true
exportLoading . value = true
const data = await TaskApi . exportTask ( queryParams )
const data = await TaskApi . exportTask ( queryParams )
download . excel ( data , '生产报表 .xls')
download . excel ( data , t ( 'ProductionReport.Index.exportFilename' ) + ' .xls')
} catch {
} catch {
} finally {
} finally {
exportLoading . value = false
exportLoading . value = false
}
}
}
}
/** 选中行操作 */
const currentRow = ref < TaskVO > ( { } as TaskVO )
const currentRow = ref < TaskVO > ( { } as TaskVO ) / / 选 中 行
const handleCurrentChange = ( row : TaskVO | null ) => {
const handleCurrentChange = ( row : TaskVO | null ) => {
if ( row ) {
if ( row ) {
currentRow . value = row
currentRow . value = row
@ -259,7 +244,6 @@ const handleCurrentChange = (row: TaskVO | null) => {
}
}
}
}
/** tab 切换 */
const handleTabClick = ( tab : any ) => {
const handleTabClick = ( tab : any ) => {
queryParams . status = tab . paneName === '' ? undefined : tab . paneName
queryParams . status = tab . paneName === '' ? undefined : tab . paneName
currentRow . value = { } as TaskVO
currentRow . value = { } as TaskVO
@ -267,7 +251,6 @@ const handleTabClick = (tab: any) => {
getList ( )
getList ( )
}
}
/** 初始化 **/
onMounted ( ( ) => {
onMounted ( ( ) => {
getList ( )
getList ( )
} )
} )