diff --git a/src/main.js b/src/main.js index f628ff1..4ae4821 100644 --- a/src/main.js +++ b/src/main.js @@ -29,6 +29,7 @@ import './permission' // permission control import { useDict } from '@/utils/dict' import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/manage' +import { tableInfoRowClick } from '@/utils/tableHelper' // 分页组件 import Pagination from '@/components/Pagination' @@ -58,6 +59,7 @@ app.config.globalProperties.handleTree = handleTree app.config.globalProperties.addDateRange = addDateRange app.config.globalProperties.selectDictLabel = selectDictLabel app.config.globalProperties.selectDictLabels = selectDictLabels +app.config.globalProperties.tableInfoRowClick = tableInfoRowClick // 全局组件挂载 app.component('DictTag', DictTag) diff --git a/src/utils/tableHelper.js b/src/utils/tableHelper.js new file mode 100644 index 0000000..0b6d342 --- /dev/null +++ b/src/utils/tableHelper.js @@ -0,0 +1,4 @@ +export const tableInfoRowClick = (row, ref) => { + console.log(row, ref); + ref.setCurrentRow(row); +}; diff --git a/src/views/information/warehouseinfo/index.vue b/src/views/information/warehouseinfo/index.vue index 6ffa7b4..d1af5f7 100644 --- a/src/views/information/warehouseinfo/index.vue +++ b/src/views/information/warehouseinfo/index.vue @@ -161,7 +161,7 @@ /> - + diff --git a/src/views/wisdom/bill/index.vue b/src/views/wisdom/bill/index.vue index 228da8a..1dc29d5 100644 --- a/src/views/wisdom/bill/index.vue +++ b/src/views/wisdom/bill/index.vue @@ -50,7 +50,7 @@ - @@ -128,7 +128,7 @@ 一键删除 - @@ -1128,9 +1128,11 @@ const delData = (row) => { // 单击单据 const billTableRef = ref(null); -const tableBillRowClick = (row, event, column) => { - billTableRef.value.setCurrentRow(row) -} +// 单击列表的颜色 +const infoTableRef = ref(null); +// const tableInfoRowClick = (row, ref) => { +// ref.setCurrentRow(row) +// } //双击单据,查询明细 const billDoubleClickObj = ref({}); diff --git a/src/views/wisdom/borrow/index.vue b/src/views/wisdom/borrow/index.vue index 8f60440..fc7d553 100644 --- a/src/views/wisdom/borrow/index.vue +++ b/src/views/wisdom/borrow/index.vue @@ -50,6 +50,9 @@ @@ -100,7 +103,7 @@ - + @@ -240,30 +243,11 @@ import { addOutbound } from "@/api/wisdom/outbound" const { proxy } = getCurrentInstance(); -const outboundList = ref([]); -const open = ref(false); -const loading = ref(true); const showSearch = ref(true); -const ids = ref([]); -const total = ref(0); -const title = ref(""); -const planList = ref([]); //从供应计划中添加列表 - -const storeTypeList = ref([]); //出库类型下拉数据 -const wzTypeList = ref([]); //施工队下拉数据 - -const personList = ref([]); //理货员下拉数据 -const orderNum = ref("") //搜索条件:订单号 -const showContent = ref(false); // 控制打印内容是否显示 -const dateStr = ref("") //打印单据生成的日期 -const printList = ref([]) //要打印的数据列表 -const kwOptions = ref([]); //库位下拉 -const borrowTime = ref([]) const data = reactive({ - form: {}, storeData: { ckType: "JLCK" }, //借料数据 @@ -294,8 +278,6 @@ const data = reactive({ printViewInfo: { id: "printMe", //打印区域的唯一的id属性 popTitle: '入库信息打印', - - beforeOpenCallback() { showContent.value = false; }, // 开始打印之前的callback @@ -308,13 +290,12 @@ const data = reactive({ } }); -const { queryParams, storeData, rules, form, printViewInfo, outQueryParams } = toRefs(data); +const { queryParams, storeData, rules, printViewInfo, outQueryParams } = toRefs(data); const statusList = ref([ { value: 1, label: '未还料', elTagType: "danger", elTagClass: null }, { value: 2, label: '已还料', elTagType: "primary", elTagClass: null } ]) - const dictTagData = () => { return statusList.value.map(item => ({ ...item, @@ -323,6 +304,10 @@ const dictTagData = () => { } /** 查询库存单据主列表 */ +const outboundList = ref([]); +const infoTableRef = ref(null); +const loading = ref(true); +const total = ref(0); function getList() { loading.value = true; listStock({ ...queryParams.value, bizType: '2' }).then(response => { @@ -333,23 +318,8 @@ function getList() { } getList(); -// 取消按钮 -function cancel() { - open.value = false; - reset(); -} - -// 表单重置 -function reset() { - planList.value = [] - storeData.value = { - ckType: "JLCK" - } - orderNum.value = "" - proxy.resetForm("stockRef"); -} - /** 搜索按钮操作 */ +const borrowTime = ref([]) function handleQuery() { if (borrowTime.value && borrowTime.value.length > 0) { queryParams.value.startDate = borrowTime.value[0] @@ -369,56 +339,44 @@ function resetQuery() { handleQuery(); } -//出库 多选框选中数据 -function handleSelectionChange(selection) { - ids.value = selection.map(info => info.id) -} -//打印单据 多选框选中数据 -function printSelectionChange(selection) { - printList.value = selection - queryParams.value.ids = selection.map(item => item.id) - // console.log(queryParams.value.ids) -} -//打印单据 -function handlePrint() { - if (printList.value.length == 0) { - proxy.$modal.msgError("请勾选数据"); - return - } - const date = new Date(); - const year = date.getFullYear(); - const month = date.getMonth() + 1; // 月份从0开始,需要加1 - const day = date.getDate(); - const hour = date.getHours(); - const minute = date.getMinutes(); - const second = date.getSeconds(); - dateStr.value = year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second - showContent.value = true +//获取出库类型下拉数据 +const storeTypeList = ref([]); //出库类型下拉数据 +const getOutTypeList = () => { + listOuttype({ pageNum: 1, pageSize: 50 }).then(response => { + storeTypeList.value = response.rows + }) } +getOutTypeList() +// 获取施工队下拉数据 +const wzTypeList = ref([]); //施工队下拉数据 +const getConstructionList = () => { + listConstruction({ pageNum: 1, pageSize: 50 }).then(response => { + wzTypeList.value = response.rows + }) +} +getConstructionList() + +// 获取理货员下拉数据 +const personList = ref([]); //理货员下拉数据 +const getPersonList = () => { + personListDict().then(response => { + personList.value = response.data + }) +} +getPersonList() /** 新增按钮操作 */ +const open = ref(false); +const title = ref(""); function handleAdd() { reset(); open.value = true; title.value = "添加借料单据"; - //获取出库类型下拉数据 - listOuttype({ pageNum: 1, pageSize: 50 }).then(response => { - storeTypeList.value = response.rows - }) - //获取施工队下拉数据 - listConstruction({ pageNum: 1, pageSize: 50 }).then(response => { - wzTypeList.value = response.rows - }) - - //理货员下拉数据 - personListDict().then(response => { - personList.value = response.data - }) - - } + //查询库存中数据 搜索 +const planList = ref([]); //从供应计划中添加列表 function searchPlan() { if (!outQueryParams.value.xmNo && !outQueryParams.value.wlNo && !outQueryParams.value.sapNo) { proxy.$modal.msgWarning("查询条件不能为空"); @@ -435,15 +393,17 @@ function searchPlan() { planList.value = response.rows } }) - - } +//出库 多选框选中数据 +const ids = ref([]); +function handleSelectionChange(selection) { + ids.value = selection.map(info => info.id) +} /** 借料出库 提交按钮 */ function submitForm() { proxy.$refs["stockRef"].validate(valid => { - if (valid) { if (ids.value.length == 0) { proxy.$modal.msgError("请勾选数据"); @@ -476,6 +436,46 @@ function submitForm() { }); } +// 取消按钮 +function cancel() { + open.value = false; + reset(); +} + +// 表单重置 +function reset() { + planList.value = [] + storeData.value = { + ckType: "JLCK" + } + proxy.resetForm("stockRef"); +} + +//打印单据 多选框选中数据 +const printList = ref([]) //要打印的数据列表 +function printSelectionChange(selection) { + printList.value = selection +} + +//打印单据 +const dateStr = ref("") //打印单据生成的日期 +const showContent = ref(false); // 控制打印内容是否显示 +function handlePrint() { + if (printList.value.length == 0) { + proxy.$modal.msgError("请勾选数据"); + return + } + const date = new Date(); + const year = date.getFullYear(); + const month = date.getMonth() + 1; // 月份从0开始,需要加1 + const day = date.getDate(); + const hour = date.getHours(); + const minute = date.getMinutes(); + const second = date.getSeconds(); + dateStr.value = year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second + showContent.value = true +} + const returnId = ref([]) const returnData = ref({}) const returnOpen = ref(false) @@ -525,60 +525,12 @@ function warehouseFun() { }) } warehouseFun() -//库位字典 -function pcodeList(value) { - console.log(value) - getKwAllList(value[1]).then(response => { - kwOptions.value = response.data - returnData.value.pcode = "" - }) -} - - - + \ No newline at end of file diff --git a/src/views/wisdom/move/index.vue b/src/views/wisdom/move/index.vue index b6df0ba..72c4a91 100644 --- a/src/views/wisdom/move/index.vue +++ b/src/views/wisdom/move/index.vue @@ -28,13 +28,13 @@ - 搜索 - 重置 + 搜索 + 重置 - + @@ -71,226 +71,71 @@ @pagination="getList" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/views/wisdom/outbound/index.vue b/src/views/wisdom/outbound/index.vue index 8934edd..2f8f2a8 100644 --- a/src/views/wisdom/outbound/index.vue +++ b/src/views/wisdom/outbound/index.vue @@ -87,6 +87,9 @@ :data="billList" :row-class-name="tableBillRowClassName" @row-dblclick="billClick" + ref="billTableRef" + highlight-current-row + @row-click="(row) => tableInfoRowClick(row, billTableRef)" > { }); } +// 单击列表的颜色 +const billTableRef = ref(null); +const infoTableRef = ref(null); +// const tableInfoRowClick = (row, ref) => { +// ref.setCurrentRow(row) +// } + // 双击主单据查询明细 const billDoubleClickObj = ref({}); const detailLoading = ref(false); diff --git a/src/views/wisdom/record/index.vue b/src/views/wisdom/record/index.vue index 01bdf78..465bdb0 100644 --- a/src/views/wisdom/record/index.vue +++ b/src/views/wisdom/record/index.vue @@ -102,7 +102,10 @@ + :row-class-name="tableBillRowClassName" + ref="infoTableRef" + highlight-current-row + @row-click="(row) => tableInfoRowClick(row, infoTableRef)">