| | |
| | | import {CircleCheck, Download, Printer} from "@element-plus/icons-vue/global"; |
| | | import PrintSheet1 from "@/components/sd/delivery/PrintSheet1.vue"; |
| | | import PrintSheet2 from "@/components/sd/delivery/PrintSheet2.vue"; |
| | | import PrintSheetLuoyang from "@/components/sd/delivery/PrintSheetLuoyang.vue"; |
| | | import PrintSheetLuoyangDetails from "@/components/sd/delivery/PrintSheetLuoyangDetails.vue"; |
| | | import useOrderInfoStore from "@/stores/sd/order/orderInfo"; |
| | | import { saveAs } from "file-saver" |
| | | import companyInfo from "@/stores/sd/companyInfo"; |
| | | import PrintSheet3 from "@/components/sd/delivery/PrintSheet3.vue"; |
| | | import PrintSheet4 from "@/components/sd/delivery/PrintSheet4.vue"; |
| | | |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | const orderInfo = useOrderInfoStore() |
| | | const router = useRouter() |
| | | const company = companyInfo() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | |
| | | let sheetIndex = ref(-1) |
| | | let rowClickIndex = ref(null) |
| | | let produceList = ref([]) |
| | | |
| | | let optionVal = ref(null) |
| | | let flowData = ref({ |
| | | delivery: null |
| | | |
| | |
| | | orderInfo.selectDeliveryDate = res.data.selectDate |
| | | pageNum.value=1 |
| | | produceList = deepClone(res.data.data) |
| | | if(company.companyName=='洛阳北方玻璃技术股份有限公司'){ |
| | | xGrid.value.menuConfig.body.options[0][2].visible=true |
| | | xGrid.value.menuConfig.body.options[0][3].visible=true |
| | | xGrid.value.menuConfig.body.options[0][4].visible=true |
| | | xGrid.value.menuConfig.body.options[0][5].visible=true |
| | | } |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | |
| | | pageNum.value=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | if(company.companyName=='洛阳北方玻璃技术股份有限公司'){ |
| | | xGrid.value.menuConfig.body.options[0][2].visible=true |
| | | xGrid.value.menuConfig.body.options[0][3].visible=true |
| | | } |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | } |
| | | orderInfo.selectDeliveryDate = res.data.selectDate |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | if(company.companyName=='洛阳北方玻璃技术股份有限公司'){ |
| | | xGrid.value.menuConfig.body.options[0][2].visible=true |
| | | xGrid.value.menuConfig.body.options[0][3].visible=true |
| | | } |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | |
| | | } |
| | | break |
| | | } |
| | | case 'sheet3': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if (selectRecords.length === 0) { |
| | | if(rowClickIndex.value.deliveryState>0){ |
| | | ElMessage.warning(t('order.printingNumber')+rowClickIndex.value.printingNumber) |
| | | let delivery=([]) |
| | | delivery.push(rowClickIndex.value) |
| | | flowData.value.delivery=delivery |
| | | dialogTableVisible.value = true |
| | | sheetIndex.value=3 |
| | | optionVal.value = 4 |
| | | }else{ |
| | | ElMessage.warning(t('order.orderNotApproved')) |
| | | } |
| | | }else{ |
| | | let a=0 |
| | | selectRecords.forEach((item) => { |
| | | if(item.deliveryState==0){ |
| | | ElMessage.warning(t('order.orderNotApproved')) |
| | | a=1 |
| | | } |
| | | }) |
| | | if(a==0){ |
| | | flowData.value.delivery=selectRecords |
| | | dialogTableVisible.value = true |
| | | sheetIndex.value=3 |
| | | optionVal.value = 4 |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | break |
| | | |
| | | } |
| | | case 'sheet4': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if (selectRecords.length === 0) { |
| | | if(rowClickIndex.value.deliveryState>0){ |
| | | ElMessage.warning(t('order.printingNumber')+rowClickIndex.value.printingNumber) |
| | | let delivery=([]) |
| | | delivery.push(rowClickIndex.value) |
| | | flowData.value.delivery=delivery |
| | | dialogTableVisible.value = true |
| | | sheetIndex.value=4 |
| | | optionVal.value = 4 |
| | | }else{ |
| | | ElMessage.warning(t('order.orderNotApproved')) |
| | | } |
| | | }else{ |
| | | let a=0 |
| | | selectRecords.forEach((item) => { |
| | | if(item.deliveryState==0){ |
| | | ElMessage.warning(t('order.orderNotApproved')) |
| | | a=1 |
| | | } |
| | | }) |
| | | if(a==0){ |
| | | flowData.value.delivery=selectRecords |
| | | dialogTableVisible.value = true |
| | | sheetIndex.value=4 |
| | | optionVal.value = 4 |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | break |
| | | |
| | | } |
| | | case 'sheet5': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if (selectRecords.length === 0) { |
| | | if(rowClickIndex.value.deliveryState>0){ |
| | | ElMessage.warning(t('order.printingNumber')+rowClickIndex.value.printingNumber) |
| | | let delivery=([]) |
| | | delivery.push(rowClickIndex.value) |
| | | flowData.value.delivery=delivery |
| | | dialogTableVisible.value = true |
| | | sheetIndex.value=5 |
| | | optionVal.value = 8 |
| | | }else{ |
| | | ElMessage.warning(t('order.orderNotApproved')) |
| | | } |
| | | }else{ |
| | | let a=0 |
| | | selectRecords.forEach((item) => { |
| | | if(item.deliveryState==0){ |
| | | ElMessage.warning(t('order.orderNotApproved')) |
| | | a=1 |
| | | } |
| | | }) |
| | | if(a==0){ |
| | | flowData.value.delivery=selectRecords |
| | | dialogTableVisible.value = true |
| | | sheetIndex.value=5 |
| | | optionVal.value = 8 |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | break |
| | | |
| | | } |
| | | case 'sheet6': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if (selectRecords.length === 0) { |
| | | if(rowClickIndex.value.deliveryState>0){ |
| | | ElMessage.warning(t('order.printingNumber')+rowClickIndex.value.printingNumber) |
| | | let delivery=([]) |
| | | delivery.push(rowClickIndex.value) |
| | | flowData.value.delivery=delivery |
| | | dialogTableVisible.value = true |
| | | sheetIndex.value=6 |
| | | optionVal.value = 8 |
| | | }else{ |
| | | ElMessage.warning(t('order.orderNotApproved')) |
| | | } |
| | | }else{ |
| | | let a=0 |
| | | selectRecords.forEach((item) => { |
| | | if(item.deliveryState==0){ |
| | | ElMessage.warning(t('order.orderNotApproved')) |
| | | a=1 |
| | | } |
| | | }) |
| | | if(a==0){ |
| | | flowData.value.delivery=selectRecords |
| | | dialogTableVisible.value = true |
| | | sheetIndex.value=6 |
| | | optionVal.value = 8 |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | break |
| | | } |
| | | case 'sheet7': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if (selectRecords.length === 0) { |
| | | if(rowClickIndex.value.deliveryState>0){ |
| | | ElMessage.warning(t('order.printingNumber')+rowClickIndex.value.printingNumber) |
| | | let delivery=([]) |
| | | delivery.push(rowClickIndex.value) |
| | | flowData.value.delivery=delivery |
| | | dialogTableVisible.value = true |
| | | sheetIndex.value=7 |
| | | }else{ |
| | | ElMessage.warning(t('order.orderNotApproved')) |
| | | } |
| | | }else{ |
| | | let a=0 |
| | | selectRecords.forEach((item) => { |
| | | if(item.deliveryState==0){ |
| | | ElMessage.warning(t('order.orderNotApproved')) |
| | | a=1 |
| | | } |
| | | }) |
| | | if(a==0){ |
| | | flowData.value.delivery=selectRecords |
| | | dialogTableVisible.value = true |
| | | sheetIndex.value=7 |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | break |
| | | |
| | | } |
| | | case 'sheet8': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if (selectRecords.length === 0) { |
| | | if(rowClickIndex.value.deliveryState>0){ |
| | | ElMessage.warning(t('order.printingNumber')+rowClickIndex.value.printingNumber) |
| | | let delivery=([]) |
| | | delivery.push(rowClickIndex.value) |
| | | flowData.value.delivery=delivery |
| | | dialogTableVisible.value = true |
| | | sheetIndex.value=8 |
| | | }else{ |
| | | ElMessage.warning(t('order.orderNotApproved')) |
| | | } |
| | | }else{ |
| | | let a=0 |
| | | selectRecords.forEach((item) => { |
| | | if(item.deliveryState==0){ |
| | | ElMessage.warning(t('order.orderNotApproved')) |
| | | a=1 |
| | | } |
| | | }) |
| | | if(a==0){ |
| | | flowData.value.delivery=selectRecords |
| | | dialogTableVisible.value = true |
| | | sheetIndex.value=8 |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | break |
| | | |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | [ |
| | | { code: 'sheet1', name: t('basicData.print'), prefixIcon: 'vxe-icon-file-txt', visible: true}, |
| | | { code: 'sheet2', name: t('basicData.print')+ t('delivery.noMoney'), prefixIcon: 'vxe-icon-file-txt', visible: true}, |
| | | { code: 'sheet3', name: t('delivery.print1'), prefixIcon: 'vxe-icon-file-txt', visible: false}, |
| | | { code: 'sheet4', name: t('delivery.print1')+ t('delivery.noMoney'), prefixIcon: 'vxe-icon-file-txt', visible: false}, |
| | | { code: 'sheet5', name: t('delivery.print2'), prefixIcon: 'vxe-icon-file-txt', visible: false}, |
| | | { code: 'sheet6', name: t('delivery.print2')+ t('delivery.noMoney'), prefixIcon: 'vxe-icon-file-txt', visible: false}, |
| | | { code: 'sheet7', name: t('打印一行俩列'), prefixIcon: 'vxe-icon-file-txt', visible: true}, |
| | | { code: 'sheet8', name: t('打印一行俩列')+ t('delivery.noMoney'), prefixIcon: 'vxe-icon-file-txt', visible: true}, |
| | | ] |
| | | ] |
| | | } |
| | |
| | | {field: 'customerName',width:120, title: t('customer.customerName'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderId',width:120, title: t('order.orderId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'project',width:120, title: t('order.project'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.batch',width:120, title: t('order.batch'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'money',width:120, title: t('order.grossAmount'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'paymentTerms',width:120, title: t('delivery.paymentTerms'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'payMethod',width:120, title:t('delivery.paymentMethod'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | |
| | | <template #header="{ close, titleId, titleClass }"> |
| | | <el-button v-print="printContent" @click="printingNumber" :icon="Printer" circle /> |
| | | <el-button @click="exportFile" :icon="Download" circle /> |
| | | <el-select |
| | | v-model="optionVal" |
| | | v-if="sheetIndex>2&&sheetIndex<7" |
| | | style="width: 120px"> |
| | | <el-option |
| | | v-for="n in 8" |
| | | :key="n" |
| | | :label="n" |
| | | :value="n" |
| | | /> |
| | | </el-select> |
| | | </template> |
| | | <print-sheet1 id="child" v-if="sheetIndex===1" :deliveryId="flowData.delivery" /> |
| | | <print-sheet2 id="child" v-if="sheetIndex===2" :deliveryId="flowData.delivery" /> |
| | | <print-sheet-luoyang id="child" v-if="sheetIndex===3" :deliveryId="flowData.delivery" :type="1" :optionVal='optionVal'/> |
| | | <print-sheet-luoyang id="child" v-if="sheetIndex===4" :deliveryId="flowData.delivery" :type="2" :optionVal='optionVal'/> |
| | | <print-sheet-luoyang-details id="child" v-if="sheetIndex===5" :deliveryId="flowData.delivery" :type="3" :optionVal='optionVal'/> |
| | | <print-sheet-luoyang-details id="child" v-if="sheetIndex===6" :deliveryId="flowData.delivery" :type="4" :optionVal='optionVal'/> |
| | | <print-sheet3 id="child" v-if="sheetIndex===7" :deliveryId="flowData.delivery" /> |
| | | <print-sheet4 id="child" v-if="sheetIndex===8" :deliveryId="flowData.delivery" /> |
| | | |
| | | </el-dialog> |
| | | </div> |