| | |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import { useI18n } from 'vue-i18n' |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import footSum from "@/hook/footSum" |
| | | import useOrderInfoStore from "@/stores/sd/order/orderInfo"; |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | let router=useRouter() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const orderInfo = useOrderInfoStore() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | case 'setType':{ |
| | |
| | | const options = [ |
| | | { |
| | | value: '1', |
| | | label: '未质检', |
| | | label: t('reportingWorks.unqualified'), |
| | | }, |
| | | { |
| | | value: '2', |
| | | label: '已质检', |
| | | label: t('reportingWorks.qualified'), |
| | | }, |
| | | ] |
| | | |
| | |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 3) |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 7) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10) //默认开始时间7天前 |
| | | const end = new Date(new Date().getTime()+3600 * 1000 * 24) |
| | | const end = new Date(new Date().getTime()) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10)//默认结束时间当前时间 |
| | |
| | | } |
| | | |
| | | //第一次加载数据 |
| | | request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => { |
| | | request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${orderInfo.qualityInspectionDate}/${state}/${inputVal}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | orderInfo.qualityInspectionDate = res.data.selectDate |
| | | pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | |
| | | const selectPageList = ()=>{ |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`,filterData.value).then((res) => { |
| | | request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${orderInfo.qualityInspectionDate}/${state}/${inputVal}`,filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | |
| | | orderInfo.qualityInspectionDate = res.data.selectDate |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | }else{ |
| | |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => { |
| | | request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${orderInfo.qualityInspectionDate}/${state}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | orderInfo.qualityInspectionDate = res.data.selectDate |
| | | pageTotal.value = res.data.total |
| | | xGrid.value.loadData(res.data.data) |
| | | produceList = deepClone(res.data.data) |
| | | produceList.forEach(item => { |
| | | if (item.damageDetails.qualityInsStatus === 2) { |
| | | item.damageDetails.qualityInsStatus = t('reportingWorks.qualified'); |
| | | } |
| | | else if (item.damageDetails.qualityInsStatus === 1){ |
| | | item.damageDetails.qualityInsStatus = t('reportingWorks.unqualified'); |
| | | } |
| | | else if (item.damageDetails.qualityInsStatus === 0){ |
| | | item.damageDetails.qualityInsStatus = t('reportingWorks.notQualified'); |
| | | } |
| | | }); |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | |
| | | inputVal = null |
| | | } |
| | | |
| | | request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => { |
| | | request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${orderInfo.qualityInspectionDate}/${state}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal=parseInt(res.data.total) |
| | | orderInfo.qualityInspectionDate = res.data.selectDate |
| | | pageNum.value=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | id: 'QualityInspectionReview', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {title: '操作', width: 120, slots: { default: 'button_slot' },fixed:"left"}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {type:'expand',fixed:"left",slots: { content:'content' }}, |
| | | {title: t('basicData.operate'), width: 100, slots: { default: 'button_slot' },fixed:"left"}, |
| | | { type: 'seq',fixed:"left", title: t('basicData.Number'),}, |
| | | |
| | | {field: 'reportingWorkId',width: 130, title: '报工编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, }, |
| | | {field: 'reportingWorkTime',width: 120, title: '报工时间',showOverflow:"ellipsis" }, |
| | | {field: 'processId',width: 130, title: '流程卡号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project',width: 120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.customerName',width: 120, title: '客户名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'thisProcess',width: 100, title: '本工序',showOverflow:"ellipsis"}, |
| | | {field: 'thisCompletedQuantity',width: 100, title: '完工数量'}, |
| | | {field: 'thisWornQuantity', width: 100,title: '次破数量'}, |
| | | {field: 'teamsGroupsName',width: 110, title: '报工班组'}, |
| | | {field: 'deviceName',width: 110, title: '报工设备'}, |
| | | {field: 'previousProcess', width: 100,title: '上工序'}, |
| | | {field: 'nextProcess',width: 100, title: '下工序'}, |
| | | {field: 'qualityInspector',width: 120, title: '质检员'}, |
| | | {field: 'qualityInsTime',width: 120, title: '质检时间'}, |
| | | {field: 'damageDetails.qualityInsStatus',width: 120, title: '质检状态'} |
| | | {field: 'reportingWorkId',width: 130, title: t('reportingWorks.reportingWorkId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, }, |
| | | {field: 'reportingWorkTime',width: 120, title: t('reportingWorks.reportingWorkTime'),showOverflow:"ellipsis" }, |
| | | {field: 'processId',width: 130, title: t('processCard.processId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project',width: 120, title: t('order.project'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.customerName',width: 120, title: t('customer.customerName'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'thisProcess',width: 100, title: t('reportingWorks.thisProcess'),showOverflow:"ellipsis"}, |
| | | {field: 'thisCompletedQuantity',width: 100, title: t('reportingWorks.thisCompletedQuantity')}, |
| | | {field: 'thisWornQuantity', width: 100,title: t('reportingWorks.thisWornQuantity')}, |
| | | {field: 'teamsGroupsName',width: 110, title: t('reportingWorks.teamsType')}, |
| | | {field: 'deviceName',width: 110, title: t('reportingWorks.deviceType')}, |
| | | {field: 'previousProcess', width: 100,title: t('reportingWorks.previousProcess')}, |
| | | {field: 'nextProcess',width: 100, title: t('reportingWorks.nextProcess')}, |
| | | {field: 'qualityInspector',width: 120, title: t('reportingWorks.qualityInspector')}, |
| | | {field: 'qualityInsTime',width: 120, title: t('reportingWorks.qualityInsTime')}, |
| | | {field: 'damageDetails.qualityInsStatus',width: 120, title: t('reportingWorks.qualityInsStatus')} |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['',''] |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | return t('basicData.total') |
| | | } |
| | | if (footList.includes(column.field)) { |
| | | return sumNum(data, column.field) |
| | | const List = ["thisCompletedQuantity",'thisWornQuantity','area','perimeter'] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="main-div-customer"> |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <div style="width: 100%;height: 100%"> |
| | | <div class="head"> |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | v-model="orderInfo.qualityInspectionDate" |
| | | type="daterange" |
| | | format="YYYY/MM/DD" |
| | | value-format="YYYY-MM-DD" |
| | |
| | | /> |
| | | </el-select> |
| | | |
| | | <el-input v-model="form.processId" clearable placeholder="流程卡号" style="width: 130px"></el-input> |
| | | <el-input v-model="form.processId" clearable :placeholder="$t('processCard.processId')" style="width: 130px"></el-input> |
| | | |
| | | <el-button |
| | | @click="getWorkOrder" |
| | |
| | | type="primary" :icon="Search">{{$t('basicData.search')}} |
| | | |
| | | </el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <vxe-grid |
| | | max-height="100%" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | <div class="main-table"> |
| | | <vxe-grid |
| | | height="100%" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <!-- <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button>--> |
| | | <el-button @click="getTableRow(row,'edit')" |
| | | v-if="userStore.user.permissions.indexOf('QualityInspectionReview.edit') > -1" |
| | | link |
| | | type="primary" |
| | | size="small"> |
| | | {{ $t('basicData.edit') }} |
| | | </el-button> |
| | | <el-button v-if="row.damageDetails.qualityInsStatus===1" @click="getTableRow(row,'setType')" link type="primary" size="small">审核</el-button> |
| | | <el-button v-else disabled @click="getTableRow(row,'setType')" link type="primary" size="small">审核</el-button> |
| | | </template> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/> |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <!-- <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button>--> |
| | | <el-button @click="getTableRow(row,'edit')" |
| | | v-if="userStore.user.permissions.indexOf('qualityInspectionReview.edit') > -1" |
| | | link |
| | | type="primary" |
| | | size="small"> |
| | | {{ $t('basicData.edit') }} |
| | | </el-button> |
| | | <el-button v-if="row.damageDetails.qualityInsStatus===t('reportingWorks.qualified')||row.damageDetails.qualityInsStatus===t('reportingWorks.notQualified')" disabled @click="getTableRow(row,'setType')" link type="primary" size="small">{{ $t('basicData.review') }}</el-button> |
| | | <el-button v-else @click="getTableRow(row,'setType')" link type="primary" size="small">{{ $t('basicData.review') }}</el-button> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="type" v-model="option.data" |
| | | @keyup.enter.native="$panel.confirmFilter()" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <template #pager> |
| | | <!--使用 pager 插槽--> |
| | | <!-- 'PrevJump','NextJump', --> |
| | | <vxe-pager |
| | | @page-change="handlePageChange" |
| | | :layouts="[ 'PrevPage', 'Jump','PageCount', 'NextPage', 'Total']" |
| | | v-model:current-page="pageNum" |
| | | v-model:page-size="total.pageSize" |
| | | v-model:pager-count="total.pageTotal" |
| | | :total="total.dataTotal" |
| | | > |
| | | </vxe-pager> |
| | | </template> |
| | | </template> |
| | | <template #pager> |
| | | <!--使用 pager 插槽--> |
| | | <!-- 'PrevJump','NextJump', --> |
| | | <vxe-pager |
| | | @page-change="handlePageChange" |
| | | :layouts="[ 'PrevPage', 'Jump','PageCount', 'NextPage', 'Total']" |
| | | v-model:current-page="pageNum" |
| | | v-model:page-size="total.pageSize" |
| | | v-model:pager-count="total.pageTotal" |
| | | :total="total.dataTotal" |
| | | > |
| | | </vxe-pager> |
| | | </template> |
| | | |
| | | </vxe-grid> |
| | | </vxe-grid> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div-customer{ |
| | | width: 99%; |
| | | height: 100%; |
| | | .head{ |
| | | width: 100%; |
| | | height: 35px; |
| | | } |
| | | #selectForm { |
| | | width: 60%; |
| | | text-align: center; |
| | | |
| | | .main-table{ |
| | | width: 100%; |
| | | height: calc(100% - 35px); |
| | | } |
| | | </style> |