廖井涛
2024-07-25 15fa56463061f1e94140e23e98987aa3131714bf
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/QualityInspectionReview.vue
@@ -8,6 +8,7 @@
import {Search} from "@element-plus/icons-vue";
import { useI18n } from 'vue-i18n'
import useUserInfoStore from "@/stores/userInfo";
import footSum from "@/hook/footSum"
//语言获取
const { t } = useI18n()
let router=useRouter()
@@ -55,11 +56,11 @@
const options = [
  {
    value: '1',
    label: '未质检',
    label: t('reportingWorks.unqualified'),
  },
  {
    value: '2',
    label: '已质检',
    label: t('reportingWorks.qualified'),
  },
]
@@ -99,12 +100,12 @@
//定义数据返回结果
let produceList = ref([])
//定义当前页数
const pageNum = $ref(1)
let pageNum=ref(1)
let pageState = null
//获取七天前到当前时间
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天前
@@ -150,7 +151,7 @@
const selectPageList = ()=>{
  let startTime = form.date1[0]
  let endTime = form.date1[1]
  request.post(`/reportingWork/selectQualityTesting/${pageNum}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`,filterData.value).then((res) => {
  request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`,filterData.value).then((res) => {
    if(res.code==200){
      produceList = deepClone(res.data.data)
@@ -170,12 +171,24 @@
  if (inputVal == '') {
    inputVal = null
  }
  request.post(`/reportingWork/selectQualityTesting/${pageNum}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => {
  request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => {
    if (res.code == 200) {
      total.dataTotal = res.data.total.total*1
      total.pageTotal= res.data.total.pageTotal
      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 = '已质检';
        }
        else if (item.damageDetails.qualityInsStatus === 1){
          item.damageDetails.qualityInsStatus = '待质检';
        }
        else if (item.damageDetails.qualityInsStatus === 0){
          item.damageDetails.qualityInsStatus = '无需质检';
        }
      });
      xGrid.value.reloadData(produceList)
      gridOptions.loading = false
    } else {
      ElMessage.warning(res.msg)
@@ -222,12 +235,12 @@
  request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => {
    if (res.code == 200) {
      pageTotal.value=res.data.total
      total.dataTotal = res.data.total.total*1
      total.pageTotal=parseInt(res.data.total)
      pageNum.value=1
      produceList = deepClone(res.data.data)
      xGrid.value.loadData(produceList)
      gridOptions.loading = false
      xGrid.value.reloadData(produceList)
      gridOptions.loading=false
    } else {
      ElMessage.warning(res.msg)
    }
@@ -249,7 +262,7 @@
  align: 'center',//文字居中
  stripe:true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮
  id: 'CustomerList',
  id: 'QualityInspectionReview',
  showFooter: true,//显示脚
  printConfig: {},
  importConfig: {},
@@ -272,25 +285,25 @@
    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: {
@@ -307,14 +320,14 @@
  ],//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 ''
      })
@@ -352,7 +365,7 @@
          />
        </el-select>
        &nbsp;&nbsp;
        <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>
        &nbsp;
        <el-button
            @click="getWorkOrder"
@@ -364,7 +377,7 @@
    </div>
    <vxe-grid
        max-height="100%"
        height="100%"
        @filter-change="filterChanged"
        class="mytable-scrollbar"
        ref="xGrid"
@@ -394,8 +407,8 @@
                   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>
        <el-button v-if="row.damageDetails.qualityInsStatus==='已质检'||row.damageDetails.qualityInsStatus==='无需质检'" 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 }">
@@ -426,7 +439,7 @@
<style scoped>
.main-div-customer{
  width: 99%;
  height: 100%;
  height: 95%;
}
#selectForm {
  width: 60%;