diff --git a/src/components/edittablehead/index.vue b/src/components/edittablehead/index.vue index d1b34742..80d67806 100644 --- a/src/components/edittablehead/index.vue +++ b/src/components/edittablehead/index.vue @@ -124,15 +124,15 @@ const flexList = ref<(string | number)[]>([]); const sortlist = ref<(string | number)[]>([]); if (functions.getStorage(window.location.pathname + 'checkList')) { checkList.value = functions.getStorage(window.location.pathname + 'checkList'); - console.log(checkList.value) + console.log(checkList.value); } if (functions.getStorage(window.location.pathname + 'flexList')) { flexList.value = functions.getStorage(window.location.pathname + 'flexList'); - console.log(flexList.value) + console.log(flexList.value); } if (functions.getStorage(window.location.pathname + 'sortlist')) { sortlist.value = functions.getStorage(window.location.pathname + 'sortlist'); - console.log(sortlist.value) + console.log(sortlist.value); } let emit = defineEmits(['setcolum', 'closce']); let props = defineProps({ @@ -210,7 +210,7 @@ function checkboxitem(type: number) { } }); }); - emit('setcolum', props.columnList, checkList.value,type); + emit('setcolum', props.columnList, checkList.value, type); } else if (type == 2) { props.columnList.map(item => { item.fixed = false; @@ -218,15 +218,15 @@ function checkboxitem(type: number) { (flexList.value as []).map(ite => { props.columnList.map(item => { if (ite == item.label) { - if(item.type==6){ - item.fixed = 'right'; - }else{ - item.fixed = true; - } + if (item.type == 6) { + item.fixed = 'right'; + } else { + item.fixed = true; + } } }); }); - emit('setcolum', props.columnList, flexList.value,type); + emit('setcolum', props.columnList, flexList.value, type); } else if (type == 3) { props.columnList.map(item => { item.sortable = false; @@ -238,7 +238,7 @@ function checkboxitem(type: number) { } }); }); - emit('setcolum', props.columnList, sortlist.value,type); + emit('setcolum', props.columnList, sortlist.value, type); } } let headtop = ref([ diff --git a/src/views/basic/pda/basicPda1111.vue b/src/views/basic/pda/basicPdaTTTTT.vue similarity index 60% rename from src/views/basic/pda/basicPda1111.vue rename to src/views/basic/pda/basicPdaTTTTT.vue index fb154489..c6362a07 100644 --- a/src/views/basic/pda/basicPda1111.vue +++ b/src/views/basic/pda/basicPdaTTTTT.vue @@ -14,9 +14,9 @@ 查看维修记录 - 多选测试 + > -->
@@ -25,7 +25,7 @@ - @@ -37,63 +37,72 @@
- - - - - - - - - - - - - - - -
@@ -247,6 +256,74 @@
+ + +
+ + + + + +
@@ -255,6 +332,38 @@ import { ref, reactive, onMounted, computed } from 'vue'; import { getList, getDetail, $_AddInfo, update, remove, $_TableList } from '@/api/basic/basicPda'; //API import { ElMessage, type UploadProps } from 'element-plus'; import { getToken } from '@/utils/auth'; + +const MenuTop = ref([ + { + prop: 'label', + label: '列名', + width: '', + }, + { + prop: '', + label: '隐藏', + }, + { + prop: '', + label: '冻结', + }, + { + prop: '', + label: '排序', + }, +]); +const checkList = ref<(string | number)[]>([]); //隐藏 +const flexList = ref<(string | number)[]>([]); //冻结 +const CheckBox = (scope, type: number) => { + console.log(scope, 'scope'); + if (type === 1) { + scope.head = !scope.head; + } + if (type === 2) { + scope.fixed = !scope.fixed; + } +}; + const currentPage = ref(1); // 默认页码 const pageSize = ref(30); // 默认每一页几条 const pageList = ref([5, 10, 50, 100, 200]); // 选择每页显示多少条 @@ -272,6 +381,10 @@ const optionsvalue = ref(''); //下拉框值 const optionsvalue2 = ref(''); //状态值 const uploadRef = ref(); //图片上传 const tableRef = ref(null); // 用于引用 table 实例 +const menu = ref(true); //功能菜单列表 +const menuHeight = ref(); //右侧菜单栏高度,用于固定表头 +const MeunList = ref((name = {})); +const MeunName = ref([]); //菜单名 const options = [ //下拉选择框 { @@ -298,6 +411,187 @@ const options2 = [ label: '不能使用(不能开机)', }, ]; +// 菜单功能头部 + +// 菜单功能列表 +const menuData = ref([ + { + prop: 'name', + label: '产品名称', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'currentUsageWarehouse', + label: '当前使用仓', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'model', + label: '型号', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'purchaseAmount', + label: '购买金额', + type: 1, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'state', + label: '状态', + type: 1, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'user', + label: '使用人', + type: 1, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'deviceSerialNumber', + label: '设备序列号S/N', + type: 1, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'userPosition', + label: '使用人岗位', + type: 1, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'isDeposit', + label: '是否收取押金', + type: 1, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'deposit', + label: '押金金额(元)', + type: 1, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'purchasingCompany', + label: '采购公司', + type: 1, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'photo', + label: '商品图片', + type: 2, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'buyingTime', + label: '购买时间', + type: 1, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'notes', + label: '备注', + type: 1, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: 'warrantyPeriodEndTime', + label: '保修截止时间', + type: 1, + values: '', + width: '180', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, + { + prop: '', + label: '操作', + type: 3, + values: '', + width: '280', + checkarr: [], + fixed: false, + sortable: true, + head: true, + }, +]); // 图片上传背景图,固定白色背景 const url = 'https://img1.baidu.com/it/u=1996827238,2183445322&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889'; @@ -315,8 +609,10 @@ const headers = computed(() => { function onLoad() { // 获取表格数据API($_TableList) $_TableList({ current: currentPage.value, size: pageSize.value }).then(res => { - console.log(res.data.data.records); //表格信息 + console.log(res, 'res'); + const keys = Object.keys(res.data.data.records[0]); + MeunName.value = keys.map(key => ({ key })); data.value = res.data.data.records; const setIn = setTimeout(() => { toggleSelection(); //表格自动选中函数 @@ -328,6 +624,8 @@ function onLoad() { onMounted(() => { //默认值88 TabHeight.value = TabHeight.value.offsetHeight - 91; + menuHeight.value = window.innerHeight - 135; + console.log('元素的高度:', menuHeight.value); // 等待DOM高度被复制之后在请求数据,防止被数据撑开高度 onLoad(); }); @@ -352,7 +650,6 @@ const ImgSuccess: UploadProps['onSuccess'] = (response, uploadFile) => { img.value = true; // 图片放入预览 UrlImg.value.push(response.data.link); - console.log(UrlImg.value); // 图片存入表单准备提交 AddForm.value.photo = response.data.link; // 显示图片名字 @@ -370,6 +667,23 @@ const beforeAvatarUpload: UploadProps['beforeUpload'] = rawFile => { } return true; }; +// 字典转换(英文转中文) +let dictionary = (columnNames, text) => { + // columnNames:传入的数组,要修改的字段名 + // text:传入要修改的对象 + const mapping = text; + // 只获取指定参数对应的列数据,并将英文字段名替换为中文字段名 + const filteredData = userList.value.map(item => { + const translatedItem = {}; + for (let column of columnNames) { + const chineseColumn = mapping[column] || column; + translatedItem[chineseColumn] = item[column]; + } + return translatedItem; + }); + // 把修修改好表头数据赋值给要导出的工作表 + expExcel.value = filteredData; +}; // 表单信息提交 const submit = () => { console.log(AddForm.value); @@ -640,5 +954,47 @@ const submit = () => { margin-left: 6px; } } + // 侧边弹窗功能样式 + :deep(.el-menu-load) { + .el-drawer__header { + padding: 0; + padding-left: 20px; + position: relative; + border-bottom: 1px solid #172e5f; + margin-bottom: 0; + i { + color: #172e60; + } + } + .el-drawer__header::after { + content: ''; + display: block; + width: 4px; + height: 18px; + background-color: #172e60; + position: absolute; + top: 23px; + left: 9px; + } + .el-table__inner-wrapper { + .cell { + text-align: center; + width: 100%; + display: flex; + align-items: center; + justify-content: center; + } + .el-table__row { + height: 40px; + } + } + // 上移,下移按钮 + .el-text { + margin: 0 5px; + } + } +} +.hide-column { + display: none; } diff --git a/src/views/distribution/turndelivery/deliveryDiscuss.vue b/src/views/distribution/turndelivery/deliveryDiscuss.vue index d8178910..2ea0b40e 100644 --- a/src/views/distribution/turndelivery/deliveryDiscuss.vue +++ b/src/views/distribution/turndelivery/deliveryDiscuss.vue @@ -393,7 +393,7 @@ - 提交(商配订单) 返 回 @@ -820,7 +820,8 @@ import { ElMessageBox } from 'element-plus' default: () => ({}) }, isInitialized: false, - isUpdate: false + isUpdate: false, + BtnDisabled:false,//按钮禁止 }; }, watch: { @@ -1415,6 +1416,14 @@ import { ElMessageBox } from 'element-plus' * 订单提交 */ onSubmitBusiness() { + this.BtnDisabled=true + setTimeout(() => { + // 启用按钮 + this.BtnDisabled = false; + }, 2000); + if(!this.BtnDisabled){ + return + } if (this.orderData.length === 0) { this.$message.warning('请选择订单'); return; diff --git a/vite.config.js b/vite.config.js index cf6e5b91..528ccce5 100644 --- a/vite.config.js +++ b/vite.config.js @@ -22,8 +22,8 @@ export default ({ mode, command }) => { // cyz // target: 'http://192.168.10.75:8777', // tjj - target: 'http://192.168.10.29:13000', - // target: 'http://test.api.huitongys.com', + // target: 'http://192.168.10.29:13000', + target: 'http://test.api.huitongys.com', // target: 'http://h5uapi.huitongys.com', changeOrigin: true, rewrite: path => path.replace(/^\/api/, ''),