| | |
| | | let sheetIndex = ref(-1) |
| | | let orderType = ref("2") |
| | | let filterData = ref({}) |
| | | let sortData = ref({ |
| | | field:'id', |
| | | order:null |
| | | }) |
| | | let orderList = ref([]) |
| | | let pageNum=ref(1) |
| | | let total = reactive({ |
| | | let total = ref({ |
| | | pageTotal : 0, |
| | | dataTotal : 0, |
| | | pageSize : 50 |
| | |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | sortConfig: { //排序配置项 |
| | | remote: true//是否服务端排序 |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | |
| | | } |
| | | const List = ["quantity",'goodsQuantity','area','perimeter','money'] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | //return footSum(data, column.field) |
| | | return total.value[column.field] |
| | | } |
| | | return '' |
| | | }) |
| | |
| | | }, |
| | | cellClick({ row }){ |
| | | rowClickIndex.value = row |
| | | }, |
| | | sortChange ({ field, order }) { |
| | | sortData.value = {field,order} |
| | | selectOrderList() |
| | | } |
| | | } |
| | | |
| | | const getOrderList = () => { |
| | | //加载请求 |
| | | request.post(`/order/getOrderList/1/${total.pageSize}/${orderType.value}/${orderInfo.selectDate}`,filterData).then((res) => { |
| | | const config = { |
| | | filter: filterData.value, |
| | | sort: sortData.value |
| | | } |
| | | request.post(`/order/getOrderList/1/${total.value.pageSize}/${orderType.value}/${orderInfo.selectDate}`,config).then((res) => { |
| | | if(res.code==200){ |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | total.value = res.data.total |
| | | /*total.dataTotal = res.data.total.dataTotal*1 |
| | | total.pageTotal= res.data.total.pageTotal*/ |
| | | orderInfo.selectDate = res.data.selectDate |
| | | orderList.value = deepClone(res.data.data) |
| | | xGrid.value.loadData(orderList.value) |
| | |
| | | }else{ |
| | | filterData.value[column.property] = value |
| | | } |
| | | request.post(`/order/getOrderList/${pageNum.value}/${total.pageSize}/${orderType.value}/${orderInfo.selectDate}`,filterData.value).then((res) => { |
| | | |
| | | const config = { |
| | | filter: filterData.value, |
| | | sort: sortData.value |
| | | } |
| | | request.post(`/order/getOrderList/${pageNum.value}/${total.value.pageSize}/${orderType.value}/${orderInfo.selectDate}`,config).then((res) => { |
| | | if(res.code==200){ |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal=parseInt(res.data.total) |
| | | total.value = res.data.total |
| | | /*total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal=parseInt(res.data.total)*/ |
| | | pageNum.value=1 |
| | | orderList.value = deepClone(res.data.data) |
| | | xGrid.value.loadData(orderList.value) |
| | |
| | | //双击表格行 |
| | | |
| | | const selectOrderList = ()=>{ |
| | | request.post(`/order/getOrderList/${pageNum.value}/${total.pageSize}/${orderType.value}/${orderInfo.selectDate}` |
| | | ,filterData.value).then((res) => { |
| | | const config = { |
| | | filter: filterData.value, |
| | | sort: sortData.value |
| | | } |
| | | request.post(`/order/getOrderList/${pageNum.value}/${total.value.pageSize}/${orderType.value}/${orderInfo.selectDate}` |
| | | ,config).then((res) => { |
| | | if(res.code==200){ |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | total.value = res.data.total |
| | | /*total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal = res.data.total.pageTotal*/ |
| | | orderInfo.selectDate=res.data.selectDate |
| | | orderList.value = deepClone(res.data.data) |
| | | xGrid.value.loadData(orderList.value) |