From 30d33def04d689514443e9909a07c5734511cf32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=93=B2=E5=A5=87?= <13840175730@139.com> Date: Fri, 6 Jun 2025 14:08:13 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E6=96=B0=E5=8F=8C=E5=91=A8?= =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=AF=BC=E5=85=A5=E5=8F=8A=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/jhzx/DoubleWeekNeed/index.js | 177 ++++++++++++++++++++++++ src/views/jhzx/DoubleWeekNeed/index.vue | 100 +++++++++++++ 2 files changed, 277 insertions(+) create mode 100644 src/views/jhzx/DoubleWeekNeed/index.js create mode 100644 src/views/jhzx/DoubleWeekNeed/index.vue diff --git a/src/views/jhzx/DoubleWeekNeed/index.js b/src/views/jhzx/DoubleWeekNeed/index.js new file mode 100644 index 0000000..2a44390 --- /dev/null +++ b/src/views/jhzx/DoubleWeekNeed/index.js @@ -0,0 +1,177 @@ +import request from '@/utils/request' +import { VXETable } from 'vxe-table' + +const init=function (that){ + + let list=[] + const initList=function (){ + data.options.formConfig.data.dcCh=that.$refs.projectSelectRef.getDcch() + getData(data.options.formConfig.data).then(res=>{ + list=res.data + }) + } + + const save=()=>{ + const list=that.$refs.vGrid.getCheckboxRecords() + if(list.length>0){ + saveData(list).then(()=>{ + VXETable.modal.message({ content: '成功', status: 'success' }) + initList() + }) + } + } + + const importMethod=({file})=>{ + const formBody = new FormData() + formBody.append('file', file) + return fetch(`${process.env.VUE_APP_BASE_API}dmQfxq/uploadNew`, { method: 'POST', body: formBody }) + .then(response => { + console.log(response) + }).then(data => { + console.log(data) + }).catch((e) => { + console.log(e) + VXETable.modal.message({ content: '导入失败,请检查数据是否正确!', status: 'error' }) + }) + } + + const 提交=()=>{ + const list=that.$refs.vGrid.getCheckboxRecords() + if(list.length>0){ + const _list=list.map(item=>{ + return {id:item.id,zt:item.zt} + }) + submit(_list).then(()=>{ + VXETable.modal.message({ content: '成功', status: 'success' }) + initList() + }) + } + } + + const data={ + options:{ + height:800, + align:'center', + border: true, + resizable: true, + keepSource:true, + size:'mini', + showOverflow: true, + editConfig:{trigger: 'click', mode: 'cell', showStatus: true}, + highlightCurrentRow:true, + toolbarConfig: { + import: true, + custom: true + }, + importConfig: { + remote: true, + importMethod: importMethod, + types: ['xls','xlsx'], + modes: ['insert'] + }, + formConfig:{ + data:{ + dcCh:'', + }, + items:[ + { field: 'dcCh', title: '船只', span: 3,slots: { default: 'name_czbh' } }, + {span: 21, + children:[ + { align:'right',itemRender: { + name: '$button', props: {content:'查询',status:'primary'},events:{click:initList} + } + }, + { align:'right',itemRender: { + name: '$button', props: {content:'保存',status:'primary'},events:{click:save} + } + }, + { align:'right',itemRender: { + name: '$button', props: {content:'提交',status:'primary'},events:{click:提交} + } + }, + ] + }, + ], + }, + columns:[ + { field: 'dcCh', title: '船号', width: 100, + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination', }, + }, + { field: 'dcPl', title: '批量', width: 100, + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination', }, + }, + { field: 'dcFd', title: '分段', width: 100, + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination', }, + }, + //=============小组相关======================== + { field: 'xzcd', title: '小组场地', width: 100, + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination', }, + }, + { field: 'xdb', title: '大板', width: 100 }, + { field: 'xskj', title: '数控件', width: 100 }, + { field: 'xpt', title: '平铁', width: 100 }, + { field: 'xyw', title: '压弯', width: 100 }, + { field: 'xxc', title: '型材', width: 100 }, + { field: 'xok', title: '钢加回复', width: 100, + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination', }, + editRender: {name: '$input'} + }, + { field: 'xbz', title: '小组备注', width: 100, + editRender: {name: '$input'} + }, + //=============大组相关======================== + { field: 'dzcd', title: '大组场地', width: 100, + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination', }, + }, + { field: 'ddb', title: '大板', width: 100 }, + { field: 'dxc', title: '型材', width: 100 }, + { field: 'dsj', title: '散件', width: 100 }, + { field: 'dr150', title: 'R150', width: 100 }, + { field: 'dqb', title: '曲外板', width: 100 }, + { field: 'dok', title: '钢加回复', width: 100, + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination', }, + editRender: {name: '$input'} + }, + { field: 'dbz', title: '大组备注', width: 150, + editRender: {name: '$input'} + }, + ], + data:list, + }, + } + + return data +} + +const getData=(data)=>{ + return request({ + url: "/dmQfxq/getList", + method: "post", + data, + }); +} + +const saveData=(data)=>{ + return request({ + url: "/dmQfxq/save", + method: "post", + data, + }); +} + +const submit=(data)=>{ + return request({ + url: "/dmQfxq/qfxqTJ", + method: "post", + data, + }); +} + +export default init diff --git a/src/views/jhzx/DoubleWeekNeed/index.vue b/src/views/jhzx/DoubleWeekNeed/index.vue new file mode 100644 index 0000000..1129049 --- /dev/null +++ b/src/views/jhzx/DoubleWeekNeed/index.vue @@ -0,0 +1,100 @@ + + + +