¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢ç©æç®¡çå表 |
| | | export function listMaterialManagement(query) { |
| | | return request({ |
| | | url: '/aps/materialManagement/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢ç©æç®¡çè¯¦ç» |
| | | export function getMaterialManagement(id) { |
| | | return request({ |
| | | url: '/materialManagement/materialManagement/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢ç©æç®¡ç |
| | | export function addMaterialManagement(data) { |
| | | return request({ |
| | | url: '/materialManagement/materialManagement', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹ç©æç®¡ç |
| | | export function updateMaterialManagement(data) { |
| | | return request({ |
| | | url: '/materialManagement/materialManagement', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤ç©æç®¡ç |
| | | export function delMaterialManagement(id) { |
| | | return request({ |
| | | url: '/materialManagement/materialManagement/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢ç©æåºå管çå表 |
| | | export function listMaterialStorageManagement(query) { |
| | | return request({ |
| | | url: '/aps/materialStorageManagement/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢ç©æåºå管çè¯¦ç» |
| | | export function getMaterialStorageManagement(id) { |
| | | return request({ |
| | | url: '/materialStorageManagement/materialStorageManagement/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢ç©æåºå管ç |
| | | export function addMaterialStorageManagement(data) { |
| | | return request({ |
| | | url: '/materialStorageManagement/materialStorageManagement', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹ç©æåºå管ç |
| | | export function updateMaterialStorageManagement(data) { |
| | | return request({ |
| | | url: '/materialStorageManagement/materialStorageManagement', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤ç©æåºå管ç |
| | | export function delMaterialStorageManagement(id) { |
| | | return request({ |
| | | url: '/materialStorageManagement/materialStorageManagement/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | |
| | | // æ¥è¯¢å·¥å管çå表 |
| | | export function listAll_plant(query) { |
| | | return request({ |
| | | url: '/aps/aps_plant/listAll', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢è½¦é´å表 |
| | | export function listAll_shop(query) { |
| | | return request({ |
| | | url: '/aps/aps_shop/listAll', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | |
| | | return [] |
| | | } |
| | | }, |
| | | expandConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return {lazy: false} |
| | | } |
| | | }, |
| | | subGridOptions: { |
| | | type:Object, |
| | | default :()=>{ |
| | | return {} |
| | | } |
| | | expandConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return {lazy: false} |
| | | } |
| | | }, |
| | | subGridOptions: { |
| | | type:Object, |
| | | default :()=>{ |
| | | return {} |
| | | } |
| | | } |
| | | }) |
| | | |
| | | |
| | |
| | | // å®ä¹ footData 计ç®å±æ§ |
| | | const footData = computed(() => props.mxTableFootData); |
| | | |
| | | /* const data = computed(() => { |
| | | if (!props.page) { |
| | | return; |
| | | } |
| | | const total = props.page.total; |
| | | const currentPage = tablePage.value.currentPage; |
| | | const pageSize = tablePage.value.pageSize; |
| | | let start = (currentPage - 1) * pageSize; |
| | | let end = start + pageSize; |
| | | if (end > total) { |
| | | end = total; |
| | | } |
| | | const tableData = []; |
| | | for (let i = start; i < end; i++) { |
| | | tableData.push(props.data[i]); |
| | | } |
| | | return tableData; |
| | | }); */ |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="aps_plantList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="å·¥ååç§°" align="center" prop="plantName" /> |
| | | <el-table-column label="å·¥åç¼ç " align="center" prop="plantCode" /> |
| | | <el-table-column label="å¯ç¨ç¶æ" align="center" prop="status"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="aps_plant_status" :value="scope.row.status"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å建è
" align="center" prop="createBy" /> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" /> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['plant:edit']">ä¿®æ¹</el-button> |
| | | <!-- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['aps_plant:aps_plant:remove']">å é¤</el-button>--> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="aps_plantList" |
| | | :loading="loading" |
| | | :height="height" |
| | | :page="page" |
| | | @changePageNo="changePageNo" |
| | | @changePageSize="changePageSize" |
| | | @on-checkbox="handleCheckboxChange" |
| | | > |
| | | <template #buttons="{row}"> |
| | | <vxe-button mode="text" @click="handleUpdate(row)" v-hasPermi="['plant:edit']" >ç¼è¾</vxe-button> |
| | | </template> |
| | | </HxlhTable> |
| | | |
| | | <!-- æ·»å æä¿®æ¹å·¥å管çå¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" v-model="open" width="500px" append-to-body> |
| | |
| | | |
| | | <script setup name="Aps_plant"> |
| | | import { listAps_plant, getAps_plant, delAps_plant, addAps_plant, updateAps_plant } from "@/api/basicData/plant"; |
| | | import HxlhTable from '@/components/HxlhTable' |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const { aps_plant_status } = proxy.useDict('aps_plant_status'); |
| | | |
| | | const height = ref(document.documentElement.clientHeight - 170 + "px;"); |
| | | const plantNameRules = ref(null); |
| | | const plantCodeRules = ref(null); |
| | | const dataForm = ref(); |
| | | const aps_plantList = ref([]); |
| | | const open = ref(false); |
| | | const loading = ref(true); |
| | |
| | | rules: { |
| | | plantName: [ |
| | | { required: true, message: "å·¥ååç§°ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | validator: async (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(); |
| | | } |
| | | try { |
| | | if(value === plantNameRules.value){ |
| | | callback(); |
| | | }else{ |
| | | const isExists = await checkPlantNameExists(value); |
| | | if (isExists) { |
| | | return callback(new Error('该工ååç§°å·²åå¨ï¼è¯·æ´æ¢')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | return callback(new Error('æ ¡éªç¨æ·åæ¶åçé误ï¼è¯·ç¨åéè¯')); |
| | | } |
| | | }, |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | plantCode: [ |
| | | { required: true, message: "å·¥åç¼ç ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | validator: async (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(); |
| | | } |
| | | try { |
| | | if(value === plantCodeRules.value){ |
| | | callback(); |
| | | }else{ |
| | | const isExists = await checkPlantCodeExists(value); |
| | | if (isExists) { |
| | | return callback(new Error('该工åç¼ç å·²åå¨ï¼è¯·æ´æ¢')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | return callback(new Error('æ ¡éªç¨æ·åæ¶åçé误ï¼è¯·ç¨åéè¯')); |
| | | } |
| | | }, |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | status: [ |
| | | { required: true, message: "å¯ç¨ç¶æä¸è½ä¸ºç©º", trigger: "blur" }, |
| | |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | // å页屿§ |
| | | const page = ref({ |
| | | total: 0, |
| | | current: 1, |
| | | size: 10 |
| | | }); |
| | | |
| | | // è¡¨æ ¼é
ç½® |
| | | const columns = ref([ |
| | | { type: 'checkbox', width: 60, align:"center"}, |
| | | { type: 'seq', title: 'åºå·', width: 60 }, |
| | | { |
| | | title: 'å·¥ååç§°', |
| | | field: 'plantName', |
| | | }, |
| | | { |
| | | title: 'å·¥åç¼ç ', |
| | | field: 'plantCode', |
| | | }, |
| | | { |
| | | title: 'å¯ç¨ç¶æ', |
| | | field: 'status', |
| | | }, |
| | | { |
| | | title: 'å建è
', |
| | | field: 'createBy', |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | field: 'createTime', |
| | | }, |
| | | { title: 'æä½', width: 100, fixed:"right", slots: { default: 'buttons' } } |
| | | ]); |
| | | |
| | | /** æ¥è¯¢å·¥å管çå表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | listAps_plant(queryParams.value).then(response => { |
| | | aps_plantList.value = response.rows; |
| | | total.value = response.total; |
| | | page.value.total = response.total; |
| | | loading.value = false; |
| | | }); |
| | | } |
| | |
| | | updateTime: null |
| | | }; |
| | | proxy.resetForm("aps_plantRef"); |
| | | plantNameRules.value = null; |
| | | plantCodeRules.value = null; |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | |
| | | const _id = row.id || ids.value |
| | | disabled.value = true; |
| | | getAps_plant(_id).then(response => { |
| | | dataForm.value = response.data; |
| | | form.value = response.data; |
| | | open.value = true; |
| | | title.value = "ä¿®æ¹å·¥å管ç"; |
| | | plantNameRules.value = form.value.plantName; |
| | | plantCodeRules.value = form.value.plantCode; |
| | | }); |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | function submitForm() { |
| | | proxy.$refs["aps_plantRef"].validate(valid => { |
| | | const submitForm = async () => { |
| | | await proxy.$refs["aps_plantRef"].validate(valid => { |
| | | if (valid) { |
| | | if (form.value.id != null) { |
| | | updateAps_plant(form.value).then(response => { |
| | |
| | | }, `aps_plant_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | /** æ£æ¥å·¥åååéå¤ */ |
| | | const checkPlantNameExists = async (value) => { |
| | | return new Promise((resolve) => { |
| | | queryParams.value = {}; |
| | | queryParams.value.plantName = value; |
| | | listAps_plant(queryParams.value).then(response => { |
| | | if(response.total === 0){ |
| | | resolve(false); |
| | | }else{ |
| | | resolve(true); |
| | | } |
| | | }); |
| | | queryParams.value = {}; |
| | | }); |
| | | }; |
| | | |
| | | /** æ£æ¥å·¥åç¼ç éå¤ */ |
| | | const checkPlantCodeExists = async (value) => { |
| | | return new Promise((resolve) => { |
| | | queryParams.value = {}; |
| | | queryParams.value.plantCode = value; |
| | | listAps_plant(queryParams.value).then(response => { |
| | | if(response.total === 0){ |
| | | resolve(false); |
| | | }else{ |
| | | resolve(true); |
| | | } |
| | | }); |
| | | queryParams.value = {}; |
| | | }); |
| | | }; |
| | | |
| | | function changePageNo(currentPage) { |
| | | queryParams.value.pageNum = currentPage; |
| | | page.value.current = currentPage; |
| | | getList(); |
| | | } |
| | | |
| | | function changePageSize(pageSize) { |
| | | page.value.current = 1; |
| | | queryParams.value.pageNum = 1; |
| | | queryParams.value.pageSize = pageSize; |
| | | getList(); |
| | | } |
| | | |
| | | // å¤éæ¡é䏿°æ® |
| | | const handleCheckboxChange = (data) => { |
| | | ids.value = data.records.map(item => item.id); |
| | | single.value = data.records.length != 1; |
| | | multiple.value = !data.records.length; |
| | | }; |
| | | |
| | | getList(); |
| | | </script> |
| | |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="aps_shopList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="车é´åç§°" align="center" prop="shopName" /> |
| | | <el-table-column label="车é´ä»£ç " align="center" prop="shopCode" /> |
| | | <el-table-column label="å·¥å代ç " align="center" prop="plantCode" /> |
| | | <el-table-column label="å¯ç¨ç¶æ" align="center" prop="status"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="aps_plant_status" :value="scope.row.status"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å建è
" align="center" prop="createBy" /> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" /> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['shop:edit']">ä¿®æ¹</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="aps_shopList" |
| | | :loading="loading" |
| | | :height="height" |
| | | :page="page" |
| | | @changePageNo="changePageNo" |
| | | @changePageSize="changePageSize" |
| | | @on-checkbox="handleCheckboxChange" |
| | | > |
| | | <template #buttons="{row}"> |
| | | <vxe-button mode="text" @click="handleUpdate(row)" v-hasPermi="['plant:edit']" >ç¼è¾</vxe-button> |
| | | </template> |
| | | </HxlhTable> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹è½¦é´å¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" v-model="open" width="500px" append-to-body> |
| | | <el-form ref="aps_shopRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="车é´åç§°" prop="shopName"> |
| | | <el-input v-model="form.shopName" placeholder="请è¾å
¥è½¦é´åç§°" /> |
| | | <el-input v-model="form.shopName" placeholder="请è¾å
¥è½¦é´åç§°" ref="shopNameInputRef"/> |
| | | </el-form-item> |
| | | <el-form-item label="车é´ä»£ç " prop="shopCode"> |
| | | <el-input v-model="form.shopCode" placeholder="请è¾å
¥è½¦é´ä»£ç " :disabled=shopCodeDisabled /> |
| | | <el-input v-model="form.shopCode" placeholder="请è¾å
¥è½¦é´ä»£ç " :disabled=shopCodeDisabled ref="shopCodeInputRef" /> |
| | | |
| | | </el-form-item> |
| | | <el-form-item label="å·¥åç¼ç " prop="plantCode"> |
| | |
| | | <script setup name="Aps_shop"> |
| | | import { listAps_shop, getAps_shop, delAps_shop, addAps_shop, updateAps_shop } from "@/api/basicData/shop"; |
| | | import { listAps_plant } from "@/api/basicData/plant"; |
| | | import { ref } from "vue"; |
| | | import HxlhTable from '@/components/HxlhTable' |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const { aps_plant_status } = proxy.useDict('aps_plant_status'); |
| | | |
| | | const height = ref(document.documentElement.clientHeight - 170 + "px;"); |
| | | const shopNameRules = ref(null); |
| | | const shopCodeRules = ref(null); |
| | | const plantCodeRules = ref(null); |
| | | const aps_shopList = ref([]); |
| | | const open = ref(false); |
| | | const loading = ref(true); |
| | |
| | | rules: { |
| | | shopName: [ |
| | | { required: true, message: "车é´åç§°ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | validator: async (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(); |
| | | } |
| | | try { |
| | | if(value === shopNameRules.value && plantCodeRules.value === form.value.plantCode){ |
| | | callback(); |
| | | }else{ |
| | | const isExists = await checkShopNameExists(value); |
| | | if (isExists) { |
| | | return callback(new Error('车é´åç§°å·²åå¨ï¼è¯·æ´æ¢')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | return callback(new Error('æ ¡éªç¨æ·åæ¶åçé误ï¼è¯·ç¨åéè¯')); |
| | | } |
| | | }, |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | shopCode: [ |
| | | { required: true, message: "车é´ç¼ç ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | validator: async (rule, value, callback) => { |
| | | if (!value) { |
| | | return callback(); |
| | | } |
| | | try { |
| | | if(form.value.shopCode){ |
| | | callback(); |
| | | }else{ |
| | | const isExists = await checkShopCodeExists(value); |
| | | if (isExists) { |
| | | return callback(new Error('该车é´ç¼ç å·²åå¨ï¼è¯·æ´æ¢')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | } catch (error) { |
| | | return callback(new Error('æ ¡éªç¨æ·åæ¶åçé误ï¼è¯·ç¨åéè¯')); |
| | | } |
| | | }, |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | plantCode: [ |
| | | { required: true, message: "å·¥åç¼ç ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | // å页屿§ |
| | | const page = ref({ |
| | | total: 0, |
| | | current: 1, |
| | | size: 10 |
| | | }); |
| | | |
| | | // è¡¨æ ¼é
ç½® |
| | | const columns = ref([ |
| | | { type: 'checkbox', width: 60, align:"center"}, |
| | | { type: 'seq', title: 'åºå·', width: 60 }, |
| | | { |
| | | title: '车é´åç§°', |
| | | field: 'shopName', |
| | | }, |
| | | { |
| | | title: '车é´ä»£ç ', |
| | | field: 'shopCode', |
| | | }, |
| | | { |
| | | title: 'å·¥å代ç ', |
| | | field: 'plantCode', |
| | | }, |
| | | { |
| | | title: 'å¯ç¨ç¶æ', |
| | | field: 'status', |
| | | }, |
| | | { |
| | | title: 'å建è
', |
| | | field: 'createBy', |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | field: 'createTime', |
| | | }, |
| | | { title: 'æä½', width: 100, fixed:"right", slots: { default: 'buttons' } } |
| | | ]); |
| | | |
| | | /** æ¥è¯¢è½¦é´å表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | listAps_shop(queryParams.value).then(response => { |
| | | aps_shopList.value = response.rows; |
| | | total.value = response.total; |
| | | page.value.total = response.total; |
| | | loading.value = false; |
| | | }); |
| | | } |
| | |
| | | updateTime: null |
| | | }; |
| | | proxy.resetForm("aps_shopRef"); |
| | | shopNameRules.value = null; |
| | | shopCodeRules.value = null; |
| | | plantCodeRules.value = null; |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | |
| | | form.value = response.data; |
| | | open.value = true; |
| | | title.value = "ä¿®æ¹è½¦é´"; |
| | | shopNameRules.value = form.value.shopName; |
| | | shopCodeRules.value = form.value.shopCode; |
| | | plantCodeRules.value = form.value.plantCode; |
| | | }); |
| | | } |
| | | |
| | |
| | | loading.value = false; |
| | | }); |
| | | } |
| | | |
| | | /** æ£æ¥è½¦é´ååéå¤ */ |
| | | const checkShopNameExists = async (value) => { |
| | | return new Promise((resolve) => { |
| | | queryParams.value = {}; |
| | | queryParams.value.shopName = value; |
| | | queryParams.value.plantCode = form.value.plantCode; |
| | | listAps_shop(queryParams.value).then(response => { |
| | | console.log(response); |
| | | if(response.total === 0){ |
| | | resolve(false); |
| | | }else{ |
| | | resolve(true); |
| | | } |
| | | }); |
| | | queryParams.value = {}; |
| | | }); |
| | | }; |
| | | |
| | | /** æ£æ¥è½¦é´ç¼ç éå¤ */ |
| | | const checkShopCodeExists = async (value) => { |
| | | return new Promise((resolve) => { |
| | | queryParams.value = {}; |
| | | queryParams.value.shopCode = value; |
| | | queryParams.value.plantCode = form.value.plantCode; |
| | | listAps_shop(queryParams.value).then(response => { |
| | | if(response.total === 0){ |
| | | resolve(false); |
| | | }else{ |
| | | resolve(true); |
| | | } |
| | | }); |
| | | queryParams.value = {}; |
| | | }); |
| | | }; |
| | | |
| | | getPlantList(); |
| | | getList(); |
| | | |
| | | const shopNameInputRef = ref(null); |
| | | const aps_shopRef = ref(null); |
| | | |
| | | watch(() => form.value.shopName, (newValue, oldValue) => { |
| | | nextTick(() => { |
| | | if (newValue!== oldValue && proxy.$refs["aps_shopRef"] != null) { |
| | | proxy.$refs["aps_shopRef"].validateField('shopCode'); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | watch(() => form.value.shopCode, (newValue, oldValue) => { |
| | | nextTick(() => { |
| | | if (newValue!== oldValue && proxy.$refs["aps_shopRef"] != null) { |
| | | proxy.$refs["aps_shopRef"].validateField('shopName'); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | watch(() => form.value.plantCode, (newValue, oldValue) => { |
| | | nextTick(() => { |
| | | if (newValue!== oldValue && proxy.$refs["aps_shopRef"] != null) { |
| | | proxy.$refs["aps_shopRef"].validateField('shopName'); |
| | | proxy.$refs["aps_shopRef"].validateField('shopCode'); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | function changePageNo(currentPage) { |
| | | queryParams.value.pageNum = currentPage; |
| | | page.value.current = currentPage; |
| | | getList(); |
| | | } |
| | | |
| | | function changePageSize(pageSize) { |
| | | page.value.current = 1; |
| | | queryParams.value.pageNum = 1; |
| | | queryParams.value.pageSize = pageSize; |
| | | getList(); |
| | | } |
| | | |
| | | // å¤éæ¡é䏿°æ® |
| | | const handleCheckboxChange = (data) => { |
| | | ids.value = data.records.map(item => item.id); |
| | | single.value = data.records.length != 1; |
| | | multiple.value = !data.records.length; |
| | | }; |
| | | |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="æå·" prop="itemNumber"> |
| | | <el-input |
| | | v-model="queryParams.itemNumber" |
| | | placeholder="请è¾å
¥æå·" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="18" style="text-align: right;"> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="materialManagementList" |
| | | :loading="loading" |
| | | :height="height" |
| | | :page="page" |
| | | @changePageNo="changePageNo" |
| | | @changePageSize="changePageSize" |
| | | > |
| | | </HxlhTable> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="MaterialManagement"> |
| | | import { listMaterialManagement, getMaterialManagement, delMaterialManagement, addMaterialManagement, updateMaterialManagement } from "@/api/basicData/materialManagement/materialManagement"; |
| | | import HxlhTable from '@/components/HxlhTable' |
| | | import { listAll_plant } from "@/api/basicData/plant"; |
| | | import { listAll_shop } from "@/api/basicData/shop"; |
| | | import { status } from "nprogress"; |
| | | import { onMounted } from "vue"; |
| | | import axios from 'axios'; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const { aps_material_status } = proxy.useDict('aps_material_status'); |
| | | const { aps_professional_affiliation } = proxy.useDict('aps_professional_affiliation'); |
| | | const { aps_self_made } = proxy.useDict('aps_self_made'); |
| | | const materialManagementList = ref([]); |
| | | const open = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | const title = ref(""); |
| | | const height = ref(document.documentElement.clientHeight - 230 + "px;") |
| | | |
| | | const data = reactive({ |
| | | form: {}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | itemNumber: null, |
| | | }, |
| | | rules: { |
| | | } |
| | | }); |
| | | |
| | | // è¡¨æ ¼é
ç½® |
| | | const columns = ref([ |
| | | { type: 'seq', title: 'åºå·', width: 60 }, |
| | | { |
| | | title: 'æå·', |
| | | field: 'itemNumber', |
| | | width: 150, |
| | | }, |
| | | { |
| | | title: 'ç©ææè¿°', |
| | | field: 'materialDescription', |
| | | width: 150, |
| | | }, |
| | | { |
| | | title: 'ç©æç¶æ', |
| | | field: 'materialStatus', |
| | | width: 150, |
| | | formatter: (({ cellValue, row, column }) => { |
| | | if (cellValue) { |
| | | for(let i=0;i<aps_material_status.value.length;i++){ |
| | | |
| | | if(cellValue===aps_material_status.value[i].value){ |
| | | return aps_material_status.value[i].label |
| | | } |
| | | } |
| | | } |
| | | return ''; |
| | | }) |
| | | }, |
| | | { |
| | | title: 'ç©æç±»å', |
| | | field: 'materialType', |
| | | width: 150, |
| | | }, |
| | | { |
| | | title: 'ä¸ä¸å½å±', |
| | | field: 'professionalAffiliation', |
| | | width: 150, |
| | | formatter: (({ cellValue, row, column }) => { |
| | | if (cellValue) { |
| | | for(let i=0;i<aps_professional_affiliation.value.length;i++){ |
| | | if(cellValue===aps_professional_affiliation.value[i].value){ |
| | | return aps_professional_affiliation.value[i].label |
| | | } |
| | | } |
| | | } |
| | | return ''; |
| | | }) |
| | | }, |
| | | { |
| | | title: 'å¾å·', |
| | | field: 'drawingNo', |
| | | width: 150, |
| | | }, |
| | | { |
| | | title: 'çæ¬', |
| | | field: 'versionNumber', |
| | | width: 150, |
| | | }, |
| | | { |
| | | title: 'ææ©å¯æåç产天æ°', |
| | | field: 'advanceProductionDays', |
| | | width: 150, |
| | | }, |
| | | { |
| | | title: 'æåæ¹é', |
| | | field: 'splitBatch', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'æ¯å¦èªå¶', |
| | | field: 'selfMade', |
| | | width: 80, |
| | | formatter: (({ cellValue, row, column }) => { |
| | | if (cellValue) { |
| | | for(let i=0;i<aps_self_made.value.length;i++){ |
| | | if(cellValue===aps_self_made.value[i].value){ |
| | | return aps_self_made.value[i].label |
| | | } |
| | | } |
| | | } |
| | | return ''; |
| | | }) |
| | | }, |
| | | { |
| | | title: 'éç¨å·¥å', |
| | | field: 'applicableFactories', |
| | | width: 150, |
| | | formatter: (({ cellValue, row, column }) => { |
| | | if (cellValue) { |
| | | console.log(plantList.value); |
| | | for(let i=0;i<plantList.value.length;i++){ |
| | | if(cellValue===plantList.value[i].plantCode){ |
| | | return plantList.value[i].plantName |
| | | } |
| | | } |
| | | } |
| | | return ''; |
| | | }) |
| | | }, |
| | | { |
| | | title: 'éç¨è½¦é´', |
| | | field: 'applicableWorkshop', |
| | | width: 150, |
| | | formatter: (({ cellValue, row, column }) => { |
| | | if (cellValue) { |
| | | console.log(apsShopList.value); |
| | | for(let i=0;i<apsShopList.value.length;i++){ |
| | | if(cellValue===apsShopList.value[i].shopCode){ |
| | | return apsShopList.value[i].shopCode |
| | | } |
| | | } |
| | | } |
| | | return ''; |
| | | }) |
| | | }, |
| | | { |
| | | title: 'çææ¥æ', |
| | | field: 'effectiveDate', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'å¤±ææ¥æ', |
| | | field: 'expiringDate', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'éææ¥æ', |
| | | field: 'integrationDate', |
| | | width: 100, |
| | | }, |
| | | ]); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | const queryPlants = ref({status: 1}); |
| | | const plantList = ref([]); |
| | | const queryApsShops = ref({status: 1}); |
| | | const apsShopList = ref([]); |
| | | |
| | | // å页屿§ |
| | | const page = ref({ |
| | | total: 0, |
| | | current: 1, |
| | | size: 10 |
| | | }); |
| | | |
| | | /** æ¥è¯¢ç©æç®¡çå表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | axios.all([ |
| | | /** æ¥è¯¢å·¥åå表 */ |
| | | listAll_plant(queryPlants.value), |
| | | /** æ¥è¯¢è½¦é´å表 */ |
| | | listAll_shop(queryApsShops.value), |
| | | listMaterialManagement(queryParams.value) |
| | | ]) |
| | | .then(axios.spread((response1, response2, response3) => { |
| | | plantList.value = response1.data; |
| | | apsShopList.value = response2.data; |
| | | materialManagementList.value = response3.rows; |
| | | page.value.total = response3.total; |
| | | loading.value = false; |
| | | })) |
| | | .catch(error => { |
| | | console.error('请æ±åºé:', error); |
| | | }); |
| | | } |
| | | |
| | | // åæ¶æé® |
| | | function cancel() { |
| | | open.value = false; |
| | | reset(); |
| | | } |
| | | |
| | | // 表åéç½® |
| | | function reset() { |
| | | form.value = { |
| | | id: null, |
| | | itemNumber: null, |
| | | materialDescription: null, |
| | | materialStatus: null, |
| | | materialType: null, |
| | | professionalAffiliation: null, |
| | | drawingNo: null, |
| | | versionNumber: null, |
| | | advanceProductionDays: null, |
| | | splitBatch: null, |
| | | selfMade: null, |
| | | applicableFactories: null, |
| | | applicableWorkshop: null, |
| | | effectiveDate: null, |
| | | expiringDate: null, |
| | | integrationDate: null, |
| | | createBy: null, |
| | | createTime: null, |
| | | updateBy: null, |
| | | updateTime: null |
| | | }; |
| | | proxy.resetForm("materialManagementRef"); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | function handleQuery() { |
| | | page.value.current = 1; |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | function resetQuery() { |
| | | proxy.resetForm("queryRef"); |
| | | handleQuery(); |
| | | } |
| | | |
| | | // å¤éæ¡é䏿°æ® |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map(item => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | function handleAdd() { |
| | | reset(); |
| | | open.value = true; |
| | | title.value = "æ·»å ç©æç®¡ç"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | const _id = row.id || ids.value |
| | | getMaterialManagement(_id).then(response => { |
| | | form.value = response.data; |
| | | open.value = true; |
| | | title.value = "ä¿®æ¹ç©æç®¡ç"; |
| | | }); |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | function submitForm() { |
| | | proxy.$refs["materialManagementRef"].validate(valid => { |
| | | if (valid) { |
| | | if (form.value.id != null) { |
| | | updateMaterialManagement(form.value).then(response => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else { |
| | | addMaterialManagement(form.value).then(response => { |
| | | proxy.$modal.msgSuccess("æ°å¢æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | function handleDelete(row) { |
| | | const _ids = row.id || ids.value; |
| | | proxy.$modal.confirm('æ¯å¦ç¡®è®¤å é¤ç©æç®¡çç¼å·ä¸º"' + _ids + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delMaterialManagement(_ids); |
| | | }).then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | }).catch(() => {}); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | function handleExport() { |
| | | proxy.download('materialManagement/materialManagement/export', { |
| | | ...queryParams.value |
| | | }, `materialManagement_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | function changePageNo(currentPage) { |
| | | queryParams.value.pageNum = currentPage; |
| | | page.value.current = currentPage; |
| | | getList(); |
| | | } |
| | | |
| | | function changePageSize(pageSize) { |
| | | page.value.current = 1; |
| | | queryParams.value.pageNum = 1; |
| | | queryParams.value.pageSize = pageSize; |
| | | getList(); |
| | | } |
| | | |
| | | getList(); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="æå·" prop="itemNumber"> |
| | | <el-input |
| | | v-model="queryParams.itemNumber" |
| | | placeholder="请è¾å
¥æå·" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="18" style="text-align: right;"> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="materialStorageManagementList" |
| | | :loading="loading" |
| | | :height="height" |
| | | :page="page" |
| | | @on-checkbox="handleCheckboxChange" |
| | | @changePageNo="changePageNo" |
| | | @changePageSize="changePageSize" |
| | | > |
| | | </HxlhTable> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="MaterialStorageManagement"> |
| | | import { listMaterialStorageManagement, getMaterialStorageManagement, delMaterialStorageManagement, addMaterialStorageManagement, updateMaterialStorageManagement } from "@/api/basicData/materialStorageManagement/materialStorageManagement"; |
| | | import HxlhTable from '@/components/HxlhTable' |
| | | import { listAll_plant } from "@/api/basicData/plant"; |
| | | import axios from 'axios'; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const materialStorageManagementList = ref([]); |
| | | const open = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const title = ref(""); |
| | | const height = ref(document.documentElement.clientHeight - 230 + "px;") |
| | | const queryPlants = ref({status: 1}); |
| | | const plantList = ref([]); |
| | | |
| | | // å页屿§ |
| | | const page = ref({ |
| | | total: 0, |
| | | current: 1, |
| | | size: 10 |
| | | }); |
| | | |
| | | const data = reactive({ |
| | | form: {}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | itemNumber: null, |
| | | }, |
| | | rules: { |
| | | } |
| | | }); |
| | | |
| | | // è¡¨æ ¼é
ç½® |
| | | const columns = ref([ |
| | | { type: 'seq', title: 'åºå·', width: 60 }, |
| | | { |
| | | title: 'æå·', |
| | | field: 'itemNumber', |
| | | }, |
| | | { |
| | | title: 'æ°é', |
| | | field: 'num', |
| | | }, |
| | | { |
| | | title: 'éç¨å·¥å', |
| | | field: 'applicableFactories', |
| | | formatter: (({ cellValue, row, column }) => { |
| | | if (cellValue) { |
| | | for(let i=0;i<plantList.value.length;i++){ |
| | | if(cellValue===plantList.value[i].plantCode){ |
| | | return plantList.value[i].plantName |
| | | } |
| | | } |
| | | } |
| | | return ''; |
| | | }) |
| | | }, |
| | | { |
| | | title: 'éææ¥æ', |
| | | field: 'integrationDate', |
| | | }, |
| | | { |
| | | title: 'å·æ°æ¥æ', |
| | | field: 'refreshDate', |
| | | }, |
| | | ]); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | /** æ¥è¯¢ç©æåºå管çå表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | axios.all([ |
| | | /** æ¥è¯¢å·¥åå表 */ |
| | | listAll_plant(queryPlants.value), |
| | | listMaterialStorageManagement(queryParams.value) |
| | | ]) |
| | | .then(axios.spread((response1, response2) => { |
| | | plantList.value = response1.data; |
| | | materialStorageManagementList.value = response2.rows; |
| | | page.value.total = response2.total; |
| | | loading.value = false; |
| | | })) |
| | | .catch(error => { |
| | | console.error('请æ±åºé:', error); |
| | | }); |
| | | } |
| | | |
| | | // åæ¶æé® |
| | | function cancel() { |
| | | open.value = false; |
| | | reset(); |
| | | } |
| | | |
| | | // 表åéç½® |
| | | function reset() { |
| | | form.value = { |
| | | id: null, |
| | | itemNumber: null, |
| | | num: null, |
| | | applicableFactories: null, |
| | | integrationDate: null, |
| | | refreshDate: null, |
| | | createBy: null, |
| | | createTime: null, |
| | | updateBy: null, |
| | | updateTime: null |
| | | }; |
| | | proxy.resetForm("materialStorageManagementRef"); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | function handleQuery() { |
| | | page.value.current = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | function resetQuery() { |
| | | proxy.resetForm("queryRef"); |
| | | handleQuery(); |
| | | } |
| | | |
| | | // å¤éæ¡é䏿°æ® |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map(item => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | function handleAdd() { |
| | | reset(); |
| | | open.value = true; |
| | | title.value = "æ·»å ç©æåºå管ç"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | const _id = row.id || ids.value |
| | | getMaterialStorageManagement(_id).then(response => { |
| | | form.value = response.data; |
| | | open.value = true; |
| | | title.value = "ä¿®æ¹ç©æåºå管ç"; |
| | | }); |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | function submitForm() { |
| | | proxy.$refs["materialStorageManagementRef"].validate(valid => { |
| | | if (valid) { |
| | | if (form.value.id != null) { |
| | | updateMaterialStorageManagement(form.value).then(response => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else { |
| | | addMaterialStorageManagement(form.value).then(response => { |
| | | proxy.$modal.msgSuccess("æ°å¢æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | function handleDelete(row) { |
| | | const _ids = row.id || ids.value; |
| | | proxy.$modal.confirm('æ¯å¦ç¡®è®¤å é¤ç©æåºå管çç¼å·ä¸º"' + _ids + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delMaterialStorageManagement(_ids); |
| | | }).then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | }).catch(() => {}); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | function handleExport() { |
| | | proxy.download('materialStorageManagement/materialStorageManagement/export', { |
| | | ...queryParams.value |
| | | }, `materialStorageManagement_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | function changePageNo(currentPage) { |
| | | queryParams.value.pageNum = currentPage; |
| | | page.value.current = currentPage; |
| | | getList(); |
| | | } |
| | | |
| | | function changePageSize(pageSize) { |
| | | page.value.current = 1; |
| | | queryParams.value.pageNum = 1; |
| | | queryParams.value.pageSize = pageSize; |
| | | getList(); |
| | | } |
| | | |
| | | getList(); |
| | | </script> |
| | |
| | | :data="tableData" |
| | | :loading="loading" |
| | | :page="page" |
| | | @changePageNo="changePageNo" |
| | | @changePageSize="changePageSize" |
| | | > |
| | | </HxlhTable> |
| | | </div> |
| | |
| | | { code: '444', name: 'èµµå
', sex: '女' } |
| | | ]); |
| | | |
| | | const mockData = ref([]); |
| | | |
| | | for (let i = 0; i < 1000; i++) { |
| | | tableData.value.push({ |
| | | code: `new${i + 1}`, |
| | |
| | | sex: 'æªç¥' |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | // è¡¨æ ¼é
ç½® |
| | | const columns = ref([ |
| | |
| | | const loading = ref(false); |
| | | |
| | | // å页屿§ |
| | | const page = reactive({ |
| | | const page = ref({ |
| | | total: 1004, |
| | | current: 1, |
| | | size: 10 |
| | | }); |
| | | |
| | | const changePageNo = async (currentPage) => { |
| | | console.log(currentPage); |
| | | page.value.current = currentPage; |
| | | // await fetchData(); |
| | | } |
| | | |
| | | const changePageSize = async (pageSize) => { |
| | | console.log(pageSize); |
| | | page.value.current = 1; |
| | | page.value.size = pageSize; |
| | | // await fetchData(); |
| | | } |
| | | |
| | | // æ¨¡ææ°æ®å è½½ |
| | | /* const fetchData = () => { |
| | | // è¿éå¯ä»¥æ¿æ¢ä¸ºå®é
ç API è¯·æ± |
| | | return new Promise((resolve) => { |
| | | const current = page.value.current; |
| | | const pageSize = page.value.size; |
| | | const start = (current - 1) * pageSize; |
| | | let end = start + pageSize; |
| | | if(end > tableData.value.length){ |
| | | end = tableData.value.length; |
| | | } |
| | | const data = []; |
| | | for (let i = start; i < end; i++) { |
| | | console.log(tableData.value[i]); |
| | | data.push(tableData.value[i]); |
| | | } |
| | | // æ¨¡ææ»è®°å½æ° |
| | | // const total = 100; |
| | | mockData.value = data; |
| | | // pagerConfig.value.total = total; |
| | | resolve(); |
| | | }); |
| | | }; */ |
| | | |
| | | // çå½å¨æé©åï¼æ¿ä»£ mounted |
| | | onMounted(() => { |
| | | // è¿éå¯ä»¥æ¾ç½®åæ¥ mounted é©åä¸ç代ç |
| | | }); |
| | | |
| | | |
| | | // åå§åæ°æ® |
| | | // const initData = async () => { |
| | | // await fetchData(); |
| | | // }; |
| | | |
| | | // initData(); |
| | | </script> |
| | | |
| | | <style scoped="scoped"> |