| | |
| | | import GlassType from "@/components/sd/product/GlassType.vue" |
| | | import {useRouter} from 'vue-router' |
| | | import Sortable from 'sortablejs' |
| | | import BasicTable from '@/components/basic/BasicTable.vue' |
| | | import BasicTable from '@/components/sd/product/BasicTable.vue' |
| | | import {VXETable} from "vxe-table"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | |
| | | import { useI18n } from 'vue-i18n' |
| | | import footSum from "@/hook/footSum" |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | let router = useRouter() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | |
| | | case 'edit' : { |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/workOrder/addWorkOrder', query: {id: row.id}}) |
| | | break |
| | | } |
| | | case 'delete': { |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | } |
| | |
| | | const {currentRoute} = useRouter() |
| | | const route = currentRoute.value |
| | | |
| | | let id = route.query.orderId |
| | | onMounted(() => { |
| | | let id = route.query.orderId |
| | | |
| | | request.post(`/workOrder/addWork/${id}`, filterData.value).then((res) => { |
| | | request.post(`/workOrder/addWork/${id}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | if (res.code == 200) { |
| | | pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | |
| | | //筛选时查询 |
| | | function filterChanged(column) { |
| | | gridOptions.loading = true |
| | | //筛选条件发生变化条件发生变化 |
| | |
| | | } else { |
| | | filterData.value[column.property] = value |
| | | } |
| | | |
| | | |
| | | request.post(`/workOrder/addWork/${id}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'demo_1', |
| | | id: 'addWorkOrder', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | |
| | | },//表头参数 |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {type: 'checkbox', fixed: "left", title: '选择', width: 80}, |
| | | {type: 'seq', fixed: "left", title: '自序', width: 50}, |
| | | {field: 'orderId', title: '销售单号', filters: [{data: ''}], slots: {filter: 'num1_filter'},}, |
| | | {field: 'productId',title: '产品编号',showOverflow: "ellipsis",filters: [{data: ''}],slots: {filter: 'num1_filter'}}, |
| | | {field: 'productName', title: '产品名称', filters: [{data: ''}], slots: {filter: 'num1_filter'}, }, |
| | | {field: 'quantity', title: '总数量', }, |
| | | {field: 'computeGrossArea', title: '总面积', }, |
| | | {field: 'perimeter', title: '周长', showOverflow: "ellipsis"} |
| | | {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80}, |
| | | {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50}, |
| | | {field: 'orderId', title: t('order.orderId'), filters: [{data: ''}], slots: {filter: 'num1_filter'},}, |
| | | {field: 'productId',title: t('order.productId'),showOverflow: "ellipsis",filters: [{data: ''}],slots: {filter: 'num1_filter'}}, |
| | | {field: 'productName', title: t('order.product'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, }, |
| | | {field: 'quantity', title: t('order.quantity'), }, |
| | | {field: 'computeGrossArea', title: t('order.area'), }, |
| | | {field: 'perimeter', title: t('workOrder.perimeter'), showOverflow: "ellipsis"} |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {code: 'saveWorkOrder', name: '保存', status: 'primary', icon: 'vxe-icon-save'}, |
| | | {code: 'saveWorkOrder', name: t('basicData.save'), status: 'primary', icon: 'vxe-icon-save'}, |
| | | ], |
| | | import: false, |
| | | export: true, |
| | | print: true, |
| | | // import: false, |
| | | // export: true, |
| | | // print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: null,//表格数据 |
| | | //脚部求和 |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = ['total', 'totalArea'] |
| | | return [ |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | 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 = ["quantity",'computeGrossArea'] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | if(selectRecords.length!=$table.getTableData().fullData.length){ |
| | | ElMessage.warning(t('workOrder.msg')) |
| | | return; |
| | | } |
| | | |
| | | let workOrderData = ref({ |
| | | orderdetail: selectRecords, |
| | |
| | | }) |
| | | |
| | | request.post("/workOrder/addOrderWork", workOrderData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success("保存成功") |
| | | location.reload(); |
| | | if (res.code == 200 && res.data===true) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({path: '/main/workOrder/addWorkOrder', query: {orderId:route.query.orderId,random:Math.random()}}) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">转工单</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{ $t('workOrder.transferOrder') }}</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">{{ $t('basicData.delete') }}</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" @input="changeFilterEvent($event, option, $panel)"/> |
| | | <input type="type" v-model="option.data" |
| | | @keyup.enter.native="$panel.confirmFilter()" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |