From 42bc535c947bcf999c706a753635d35ef73f91e6 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期一, 22 四月 2024 09:11:16 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/a1536384743/erp_-override
---
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectPrintFlowCard.vue | 331 ++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 257 insertions(+), 74 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectPrintFlowCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectPrintFlowCard.vue
index 4f0ef09..8a8971e 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectPrintFlowCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectPrintFlowCard.vue
@@ -1,105 +1,288 @@
<script lang="ts" setup>
-import {reactive, ref} from 'vue'
+import {reactive, ref} from "vue";
+import {useRouter} from 'vue-router'
+import request from "@/utils/request";
+import deepClone from "@/utils/deepClone";
+import {ElDatePicker, ElMessage} from "element-plus";
+import {Search} from "@element-plus/icons-vue";
+import {useI18n} from 'vue-i18n'
+import {changeFilterEvent, filterChanged} from "@/hook"
+//璇█鑾峰彇
+const {t} = useI18n()
-// do not use same name with ref
+let router = useRouter()
+
+
+//瀹氫箟椤甸潰鎬婚〉鏁�
+let pageTotal = ref('')
+//瀹氫箟鏁版嵁杩斿洖缁撴灉
+let produceList = ref([])
+//瀹氫箟褰撳墠椤垫暟
+let pageNum = $ref(1)
+let pageState = null
+
const form = reactive({
- name: '',
- region: '',
date1: '',
- date2: '',
- delivery: false,
- type: [],
- resource: '',
- desc: '',
+ orderId: '',
+ project: ''
})
-const defaultTime = ref<[Date, Date]>([
- new Date(2000, 1, 1, 0, 0, 0),
- new Date(2000, 2, 1, 23, 59, 59),
-])
-const tableData = [
- {
- salesOrderNo: 'NG231201',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
+const getTableRow = (row, type) => {
+ switch (type) {
+ case 'edit' :{
+ router.push({path: '/main/processCard/PrintFlowCard', query: { orderId: row.order_id }})
+ break
+ }
+ }
+}
+
+/*鍚庣杩斿洖缁撴灉澶氬眰宓屽灞曠ず*/
+const hasDecimal = (value) => {
+ const regex = /\./; // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐�
+ return regex.test(value); // 杩斿洖true/false
+}
+
+//绛涢�夋潯浠讹紝鏈夊閿渶瑕佸厛瀹氫箟鏄庣粏閲岄潰鐨勬暟鎹�
+let filterData = ref({
+
+ orderGlassDetail: {
+ productionId: '',
},
- {
- salesOrderNo: 'NG231202',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
+ orderDetail: {
+ orderId: '',
+ productId: '',
+ productName: '',
+ }
+})
+
+//鑾峰彇涓冨ぉ鍓嶅埌褰撳墠鏃堕棿
+function getNowTime() {
+ const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 7)
+ .toISOString()
+ .replace('T', ' ')
+ .slice(0, 10) //榛樿寮�濮嬫椂闂�7澶╁墠
+ const end = new Date(new Date().getTime() + 3600 * 1000 * 24)
+ .toISOString()
+ .replace('T', ' ')
+ .slice(0, 10)//榛樿缁撴潫鏃堕棿褰撳墠鏃堕棿
+ return [start, end]
+}
+
+//绗竴娆″姞杞借幏鍙栬繎涓冨ぉ鏃堕棿鍜岄粯璁ょ姸鎬�
+form.date1 = getNowTime()
+let startTime = form.date1[0]
+let endTime = form.date1[1]
+let orderId=form.orderId
+let project=form.project
+
+if (orderId==''){
+ orderId=null
+}
+if (project==''){
+ project=null
+}
+//绗竴娆″姞杞芥暟鎹�
+
+request.post(`/processCard/selectPrintFlowCard/${startTime}/${endTime}/${orderId}/${project}`, filterData.value).then((res) => {
+
+ if (res.code == 200) {
+ produceList = produceList.value.concat(deepClone(res.data.data))
+ xGrid.value.reloadData(produceList)
+ gridOptions.loading = false
+ } else {
+ ElMessage.warning(res.msg)
+ }
+})
+
+//鐐瑰嚮鏌ヨ
+const getWorkOrder = () => {
+
+ let startTime = form.date1[0]
+ let endTime = form.date1[1]
+ let orderId=form.orderId
+ let project=form.project
+
+ if (orderId==''){
+ orderId=null
+ }
+ if (project==''){
+ project=null
+ }
+ request.post(`/processCard/selectPrintFlowCard/${startTime}/${endTime}/${orderId}/${project}`, filterData.value).then((res) => {
+ if (res.code == 200) {
+
+ xGrid.value.loadData(res.data.data)
+ gridOptions.loading = false
+ } else {
+ ElMessage.warning(res.msg)
+ }
+ })
+}
+
+//瀛愮粍浠舵帴鏀跺弬鏁�
+const xGrid = ref()
+const gridOptions = reactive({
+ loading: true,
+ border: "full",//琛ㄦ牸鍔犺竟妗�
+ keepSource: true,//淇濇寔婧愭暟鎹�
+ align: 'center',//鏂囧瓧灞呬腑
+ stripe: true,//鏂戦┈绾�
+ rowConfig: {isCurrent: true, isHover: true, height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+ id: 'CustomerList',
+ showFooter: true,//鏄剧ず鑴�
+ printConfig: {},
+ importConfig: {},
+ exportConfig: {},
+ scrollY: {enabled: true},//寮�鍚櫄鎷熸粴鍔�
+ showOverflow: true,
+ columnConfig: {
+ resizable: true,
+ useKey: true
},
- {
- salesOrderNo: 'NG231203',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
+ filterConfig: { //绛涢�夐厤缃」
+ // remote: true
},
- {
- salesOrderNo: 'NG231204',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
+ customConfig: {
+ storage: true
},
- {
- salesOrderNo: 'NG231205',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
+
+ editConfig: {
+ trigger: 'click',
+ mode: 'row',
+ showStatus: true
},
- {
- salesOrderNo: 'NG231206',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
+ //琛ㄥご鍙傛暟
+ columns: [
+ {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50},
+ {title: t('basicData.operate'), width: 80, slots: { default: 'button_slot' },fixed:"left"},
+ {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50},
+ {
+ field: 'order_id',
+ title: '閿�鍞崟鍙�',
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ filterMethod: filterChanged
+ },
+ {
+ field: 'project',
+ title: '椤圭洰鍚嶇О',
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ filterMethod: filterChanged
+ },
+ {
+ field: 'quantity',
+ title: '鏁伴噺',
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ filterMethod: filterChanged
+ },
+ {
+ field: 'area',
+ title: '闈㈢Н',
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ filterMethod: filterChanged
+ },
+ ],//琛ㄥご鎸夐挳
+
+ toolbarConfig: {
+ buttons: [],
+ import: false,
+ // export: true,
+ // print: true,
+ zoom: true,
+ custom: true
},
- {
- salesOrderNo: 'NG231207',
- entryName: '淇″悎鏄ュぉ閲�',
- total: '169',
- TotalArea: '175.31',
- },
-]
+ data: [],//table body瀹為檯鏁版嵁
+ //鑴氶儴姹傚拰
+ footerMethod({columns, data}) {//椤佃剼鍑芥暟
+ let footList = []
+ return [
+ columns.map((column, columnIndex) => {
+ if (columnIndex === 0) {
+ return '鍚堣:'
+ }
+ if (footList.includes(column.field)) {
+ return sumNum(data, column.field)
+ }
+ return ''
+ })
+ ]
+ }
+
+})
+
</script>
<template>
- <div>
+ <div class="main-div-customer">
<div id="selectForm">
<el-row :gutter="0">
-<!-- <el-input placeholder="閿�鍞崟鍙�" v-model="form.name" style="width: 200px"/>-->
-<!-- -->
-<!-- <el-input placeholder="椤圭洰鍚嶇О" v-model="form.region" style="width: 200px"/>-->
-<!-- -->
<el-date-picker
v-model="form.date1"
- type="daterange"
- start-placeholder="寮�濮嬫椂闂�"
end-placeholder="缁撴潫鏃堕棿"
- :default-time="defaultTime"
+ format="YYYY/MM/DD"
+ start-placeholder="寮�濮嬫椂闂�"
+ type="daterange"
+ value-format="YYYY-MM-DD"
+
/>
- <el-button type="primary">鏌ヨ</el-button>
+ <el-input v-model="form.orderId" :placeholder="$t('order.orderId')" clearable style="width: 110px"></el-input>
+
+ <el-input v-model="form.project" clearable placeholder="椤圭洰鍚嶇О" style="width: 110px"></el-input>
+
+ <el-button
+ id="select"
+ :icon="Search"
+ type="primary" @click="getWorkOrder">{{ $t('basicData.search') }}
+ </el-button>
</el-row>
-
</div>
- <el-table :data="tableData" border style="width: 100%" height="100%">
- <el-table-column sortable prop="salesOrderNo" label="閿�鍞崟鍙�" width="110" >
- <template v-slot="scope">
- <router-link :to="{path:'PrintFlowCard'}" >{{scope.row.salesOrderNo}}</router-link>
- </template>
- </el-table-column>
- <el-table-column prop="entryName" label="椤圭洰鍚嶇О" width="155" />
- <el-table-column prop="total" label="鎬荤墖鏁�" width="75" />
- <el-table-column prop="TotalArea" label="鎬婚潰绉�" width="100" />
- </el-table><!-- <h1>{{msg}}</h1> -->
+ <vxe-grid
+ ref="xGrid"
+ class="mytable-scrollbar"
+ height="100%"
+ max-height="100%"
+ v-bind="gridOptions"
+ >
+ <!-- @toolbar-button-click="toolbarButtonClickEvent"-->
+ <!-- 涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
+ <template #content="{ row }">
+ <ul class="expand-wrapper">
+ <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
+ <span style="font-weight: bold">{{ item.title + ': ' }}</span>
+ <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span>
+ <span v-else>{{ row[item.field] }}</span>
+
+ </li>
+ </ul>
+ </template>
+ <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
+ <template #button_slot="{ row }">
+ <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button>
+ </template>
+
+ <template #num1_filter="{ column, $panel }">
+ <div>
+ <div v-for="(option, index) in column.filters" :key="index">
+ <input v-model="option.data" type="text" @input="changeFilterEvent($event, option, $panel)"/>
+ </div>
+ </div>
+ </template>
+
+
+ </vxe-grid>
</div>
</template>
<style scoped>
-#selectForm {
- width: 40%;
+.main-div-customer {
+ width: 99%;
height: 100%;
- text-align: center;
+}
+#selectForm {
+ width: 60%;
}
--
Gitblit v1.8.0