| | |
| | | import {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove"; |
| | | import {useI18n} from 'vue-i18n' |
| | | 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' : { |
| | |
| | | }) |
| | | |
| | | //第一次加载获取近3天时间和默认状态 |
| | | form.date1 = getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | if (orderInfo.workOrderDate[0]=="" && orderInfo.workOrderDate[1]==""){ |
| | | orderInfo.workOrderDate=getNowTime() |
| | | } |
| | | let startTime = orderInfo.workOrderDate[0] |
| | | let endTime = orderInfo.workOrderDate[1] |
| | | let selectProcesses = processVal.value |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | |
| | | //禁用删除、审核按钮 |
| | | gridOptions.toolbarConfig.buttons[0].disabled = true |
| | | gridOptions.toolbarConfig.buttons[1].disabled = true |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | |
| | | |
| | | //点击时查询 |
| | | const getWorkOrder = () => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let startTime = orderInfo.workOrderDate[0] |
| | | let endTime = orderInfo.workOrderDate[1] |
| | | let selectProcesses = processVal.value |
| | | let selectState = stateValue.value |
| | | let inputVal = form.orderId |
| | |
| | | //禁用删除、审核按钮 |
| | | gridOptions.toolbarConfig.buttons[0].disabled = true |
| | | gridOptions.toolbarConfig.buttons[1].disabled = true |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | //启用保存 |
| | | gridOptions.toolbarConfig.buttons[2].disabled = false |
| | | gridOptions.toolbarConfig.buttons[3].disabled = false |
| | | }else{ |
| | | //启用删除、审核按钮 |
| | | gridOptions.toolbarConfig.buttons[0].disabled = false |
| | | gridOptions.toolbarConfig.buttons[1].disabled = false |
| | | gridOptions.toolbarConfig.buttons[2].disabled = false |
| | | //禁用保存 |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | gridOptions.toolbarConfig.buttons[3].disabled = true |
| | | |
| | | } |
| | | } else { |
| | |
| | | } |
| | | |
| | | //获取选中时间 |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let startTime = orderInfo.workOrderDate[0] |
| | | let endTime = orderInfo.workOrderDate[1] |
| | | let selectProcesses = processVal.value |
| | | let selectState = stateValue.value |
| | | let inputVal = form.orderId |
| | |
| | | |
| | | // {field: '排产编号', title: '排产编号', width: 120 }, |
| | | { |
| | | field: 'orderGlassDetail.orderId', |
| | | field: 'order.orderId', |
| | | title: t('order.orderId'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | |
| | | buttons: [ |
| | | {code: 'delete', name: t('basicData.delete'), status: 'primary'}, |
| | | {code: 'review', name: t('basicData.review'), status: 'primary'}, |
| | | {code: 'cancelReview', name: t('basicData.cancelReview'), status: 'primary'}, |
| | | {code: 'save', name: t('processCard.scheduling'), status: 'primary', icon: 'vxe-icon-save'}, |
| | | ], |
| | | import: false, |
| | |
| | | ElMessage.warning("请勾选排产数据") |
| | | return; |
| | | } |
| | | selectRecords.forEach(item => { |
| | | if(item.reviewStatus=="已审核"){ |
| | | ElMessage.warning("不能删除已审核数据") |
| | | return; |
| | | } |
| | | }); |
| | | alert(1111) |
| | | // const type = await VXETable.modal.confirm('您确定要删除该数据?') |
| | | // if (type === 'confirm') { |
| | | // let schedulingData = ref({ |
| | | // scheduling: selectRecords, |
| | | // }) |
| | | // |
| | | // request.post("/productionScheduling/deleteScheduling", schedulingData.value).then((res) => { |
| | | // if (res.code == 200) { |
| | | // ElMessage.success("删除成功") |
| | | // location.reload(); |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // |
| | | // } |
| | | // }) |
| | | // } |
| | | |
| | | const type = await VXETable.modal.confirm('您确定要删除该数据?') |
| | | if (type === 'confirm') { |
| | | let schedulingData = ref({ |
| | | scheduling: selectRecords, |
| | | }) |
| | | |
| | | request.post("/productionScheduling/deleteScheduling", schedulingData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success("删除成功") |
| | | location.reload(); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | case 'review': { |
| | | const $table = xGrid.value |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | let date = form.date1 |
| | | let selectProcesses = processVal.value |
| | | let selectState = stateValue.value |
| | | let inputVal = form.orderId |
| | | if ($table) { |
| | | if (selectRecords.length == 0) { |
| | | ElMessage.warning("请勾选排产数据") |
| | |
| | | request.post("/productionScheduling/examineScheduling", schedulingData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success("审核成功") |
| | | router.push({ |
| | | path: '/main/processCard/ProductionScheduling', |
| | | query: {random: Math.random()} |
| | | }) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | }) |
| | | |
| | | } |
| | | return; |
| | | } |
| | | case 'cancelReview': { |
| | | const $table = xGrid.value |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | if ($table) { |
| | | if (selectRecords.length == 0) { |
| | | ElMessage.warning("请勾选排产数据") |
| | | return; |
| | | } |
| | | let schedulingData = ref({ |
| | | scheduling: selectRecords, |
| | | userName: username//审核人 |
| | | }) |
| | | request.post("/productionScheduling/cancelReviewScheduling", schedulingData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success("反审成功") |
| | | location.reload(); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | let selectState = stateValue.value |
| | | selectRecords.forEach((selectRecords) => { |
| | | console.log(selectRecords) |
| | | if (selectRecords.schedulingQuantity > selectRecords.pendingProductionQuantity) { |
| | | ElMessage.warning("排产数量不能大于待排产数量") |
| | | //禁用保存按钮 |
| | |
| | | } |
| | | const checkBoxConfig = { |
| | | checkMethod: ({ row }) => { |
| | | console.log(row) |
| | | if (row['reviewStatus']==="已审核"){ |
| | | return row.disable |
| | | }else{ |
| | |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | v-model="orderInfo.workOrderDate" |
| | | :default-time="defaultTime" |
| | | end-placeholder="结束时间" |
| | | format="YYYY/MM/DD" |
| | |
| | | <vxe-grid |
| | | ref="xGrid" |
| | | class="mytable-scrollbar" |
| | | height="500px" |
| | | max-height="100%" |
| | | height="95%" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | @filter-change="filterChanged" |
| | | @checkbox-change="determineNum" |
| | | :checkbox-config="checkBoxConfig" |
| | | |
| | | |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- :checkbox-config="checkBoxConfig" @checkbox-change="determineNum"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <ul class="expand-wrapper"> |
| | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/> |
| | | <input v-model="option.data" type="type" |
| | | @keyup.enter.native="$panel.confirmFilter()" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |