| | |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {ElMessage} from "element-plus"; |
| | | import { useI18n } from 'vue-i18n' |
| | | import DeliveryPrinting from "@/views/sd/delivery/DeliveryPrinting.vue"; |
| | | |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | const dialogTableVisible = ref(false) |
| | | let rowClickIndex = ref(null) |
| | | let produceList = ref([]) |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | router.push({path: '/main/delivery/createDelivery', query: { deliveryID: row.deliveryId }}) |
| | | break |
| | | } |
| | | case 'printing' :{ |
| | | const url = router.resolve({path: '/main/delivery/deliveryPrinting', query: { deliveryID: row.deliveryId }}) |
| | | window.open(url.href, '_blank') |
| | | break |
| | | } |
| | | case 'delete':{ |
| | |
| | | selectOrderList() |
| | | } |
| | | |
| | | const gridEvents = { |
| | | |
| | | menuClick ({ menu, row, column }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (menu.code) { |
| | | case 'getProcessList': { |
| | | if(rowClickIndex.value===null){ |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | | return |
| | | } |
| | | dialogTableVisible.value = true |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | }, |
| | | cellClick({ row }){ |
| | | rowClickIndex.value = row |
| | | } |
| | | } |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | }, |
| | | menuConfig: { |
| | | body: { |
| | | options: [ |
| | | [ |
| | | { code: 'getProcessList', name: "打印", prefixIcon: 'vxe-icon-file-txt', visible: true} |
| | | ] |
| | | ] |
| | | } |
| | | }, |
| | | //表头参数 |
| | | columns:[ |
| | | {type:'expand',slots: { content:'content' },width: 60}, |
| | | {title: t('basicData.operate'), width: 110, slots: { default: 'button_slot' }}, |
| | | {title: t('basicData.operate'), width: 150, slots: { default: 'button_slot' }}, |
| | | {type: 'seq', title: t('basicData.Number'), width: 80 }, |
| | | |
| | | {field: 'deliveryState',title: t('basicData.review'), width: 40, slots: { default: 'state' }}, |
| | |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | |
| | | > |
| | | <!-- 下拉显示所有信息插槽--> |
| | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button> |
| | | <el-button @click="getTableRow(row,'printing')" :disabled="row.deliveryState!==2" link type="primary" size="small">打印</el-button> |
| | | <el-popconfirm @confirm="getTableRow(row,'delete')" title="确定删除?"> |
| | | <template #reference> |
| | | <el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button> |
| | |
| | | </vxe-pager> |
| | | </template> |
| | | </vxe-grid> |
| | | |
| | | <el-dialog |
| | | v-model="dialogTableVisible" |
| | | destroy-on-close |
| | | style="width: 75%;height:70% "> |
| | | <DeliveryPrinting |
| | | :deliveryId="rowClickIndex.deliveryId" |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | | </template> |