Compare commits

..

No commits in common. 'e286bf5e09025ffe70fd491bf93b5800ce9bf6bf' and 'c9a11dd5acf0ff6839db52be7d34ff62fd64bd88' have entirely different histories.

  1. 1
      src/api/materials/list.js
  2. 89
      src/views/authority/datascope.vue
  3. 23
      src/views/demandOrder/index.vue
  4. 101
      src/views/firstOrder/components/approvalProcessDialog.vue
  5. 17
      src/views/firstOrder/components/inDialog.vue
  6. 164
      src/views/firstOrder/components/outDialog.vue
  7. 112
      src/views/firstOrder/inbound.vue
  8. 94
      src/views/firstOrder/list.vue
  9. 64
      src/views/firstOrder/outbound.vue
  10. 2
      src/views/materials/expend.vue
  11. 96
      src/views/materials/index.vue
  12. 46
      src/views/purchaseOrders/index.vue
  13. 2
      src/views/secondOrder/list.vue
  14. 2
      src/views/secondOrder/outbound.vue

@ -1,7 +1,6 @@
import request from '@/router/axios'; import request from '@/router/axios';
export const getList = (current, size, params) => { export const getList = (current, size, params) => {
console.log(params,'params')
return request({ return request({
url: '/smartpark/material/list', url: '/smartpark/material/list',
method: 'get', method: 'get',

@ -1,35 +1,71 @@
<template> <template>
<basic-container> <basic-container>
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" <avue-crud :option="option"
:permission="permissionList" :before-open="beforeOpen" :before-close="beforeClose" @row-del="rowDel" :table-loading="loading"
@row-update="rowUpdate" @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset" :data="data"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" ref="crud"
@refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad"> v-model="form"
:permission="permissionList"
:before-open="beforeOpen"
:before-close="beforeClose"
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
@tree-load="treeLoad">
<template slot-scope="{row}" slot="menu"> <template slot-scope="{row}" slot="menu">
<el-button type="text" icon="el-icon-setting" size="small" v-if="permission.data_scope_setting" plain <el-button type="text"
style="border: 0;background-color: transparent !important;" @click.stop="handleDataScope(row)">权限配置 icon="el-icon-setting"
size="small"
v-if="permission.data_scope_setting"
plain
style="border: 0;background-color: transparent !important;"
@click.stop="handleDataScope(row)">权限配置
</el-button> </el-button>
</template> </template>
<template slot-scope="{row}" slot="source"> <template slot-scope="{row}" slot="source">
<div style="text-align:center"> <div style="text-align:center">
<i :class="row.source" /> <i :class="row.source"/>
</div> </div>
</template> </template>
</avue-crud> </avue-crud>
<el-drawer :title="`[${scopeMenuName}] 数据权限配置`" :visible.sync="drawerVisible" :direction="direction" append-to-body <el-drawer :title="`[${scopeMenuName}] 数据权限配置`" :visible.sync="drawerVisible" :direction="direction"
append-to-body
:before-close="handleDrawerClose" size="1000px"> :before-close="handleDrawerClose" size="1000px">
<basic-container> <basic-container>
<avue-crud :option="optionScope" :data="dataScope" :page="pageScope" v-model="formScope" <avue-crud :option="optionScope"
:table-loading="scopeLoading" ref="crudScope" @row-del="rowDelScope" @row-update="rowUpdateScope" :data="dataScope"
@row-save="rowSaveScope" :before-open="beforeOpenScope" @search-change="searchChangeScope" :page="pageScope"
@search-reset="searchResetScope" @selection-change="selectionChangeScope" @current-change="currentChangeScope" v-model="formScope"
@size-change="sizeChangeScope" @on-load="onLoadScope"> :table-loading="scopeLoading"
ref="crudScope"
@row-del="rowDelScope"
@row-update="rowUpdateScope"
@row-save="rowSaveScope"
:before-open="beforeOpenScope"
@search-change="searchChangeScope"
@search-reset="searchResetScope"
@selection-change="selectionChangeScope"
@current-change="currentChangeScope"
@size-change="sizeChangeScope"
@on-load="onLoadScope">
<template slot="menuLeft"> <template slot="menuLeft">
<el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDeleteScope"> <el-button type="danger"
size="small"
icon="el-icon-delete"
plain
@click="handleDeleteScope">
</el-button> </el-button>
</template> </template>
<template slot-scope="{row}" slot="scopeType"> <template slot-scope="{row}"
<el-tag>{{ row.scopeTypeName }}</el-tag> slot="scopeType">
<el-tag>{{row.scopeTypeName}}</el-tag>
</template> </template>
</avue-crud> </avue-crud>
</basic-container> </basic-container>
@ -38,25 +74,25 @@
</template> </template>
<script> <script>
import { import {
add, add,
remove, remove,
update, update,
getLazyMenuList, getLazyMenuList,
getMenu getMenu
} from "@/api/system/menu"; } from "@/api/system/menu";
import { import {
addDataScope, addDataScope,
removeDataScope, removeDataScope,
updateDataScope, updateDataScope,
getListDataScope, getListDataScope,
getMenuDataScope getMenuDataScope
} from "@/api/system/scope"; } from "@/api/system/scope";
import { mapGetters } from "vuex"; import {mapGetters} from "vuex";
import iconList from "@/config/iconList"; import iconList from "@/config/iconList";
import func from "@/util/func"; import func from "@/util/func";
export default { export default {
data() { data() {
return { return {
form: {}, form: {},
@ -691,5 +727,6 @@ export default {
}); });
}, },
} }
}; };
</script> </script>

@ -33,7 +33,7 @@ export default {
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: true,
searchMenuSpan: 18, searchMenuSpan: 6,
border: true, border: true,
index: true, index: true,
selection: true, selection: true,
@ -48,7 +48,6 @@ export default {
gridSpan: false, gridSpan: false,
filterBtn: false, filterBtn: false,
columnBtn: false, columnBtn: false,
searchMenuPosition: "right",
column: [ column: [
{ {
label: "需求单号", label: "需求单号",
@ -110,16 +109,16 @@ export default {
tableData: [], tableData: [],
ckTable: [ ckTable: [
{ str1: '3', str2: '2025-04-09', str3: '部门一' }, {str1: '3', str2: '2025-04-09', str3: '部门一'},
{ str1: '37', str2: '2025-04-03', str3: '部门一' } {str1: '37', str2: '2025-04-03', str3: '部门一'}
], ],
rkTable: [ rkTable: [
{ str1: '5', str2: '2025-03-19', str3: '部门二' }, {str1: '5',str2: '2025-03-19',str3: '部门二'},
{ str1: '12', str2: '2025-03-19', str3: '部门二' }, {str1: '12',str2: '2025-03-19',str3: '部门二'},
], ],
bfTable: [ bfTable: [
{ str1: '9', str2: '2025-03-19', str3: '部门三' }, {str1: '9',str2: '2025-03-19',str3: '部门三'},
{ str1: '19', str2: '2025-03-19', str3: '部门三' }, {str1: '19',str2: '2025-03-19',str3: '部门三'},
], ],
}; };
}, },
@ -150,13 +149,13 @@ export default {
}, },
handleTabClick(tab, event) { handleTabClick(tab, event) {
console.log(tab, event); console.log(tab, event);
if (this.activeName == 'first') { if(this.activeName=='first'){
this.tableData = this.ckTable this.tableData = this.ckTable
} }
if (this.activeName == 'second') { if(this.activeName=='second'){
this.tableData = this.rkTable this.tableData = this.rkTable
} }
if (this.activeName == 'third') { if(this.activeName=='third'){
this.tableData = this.bfTable this.tableData = this.bfTable
} }
}, },
@ -218,7 +217,7 @@ export default {
// this.selectionClear(); // this.selectionClear();
// }); // });
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
console.log(123, res.data.result) console.log(123,res.data.result)
// const data = res.data.data; // const data = res.data.data;
this.data = res.data.result.list; this.data = res.data.result.list;
this.loading = false; this.loading = false;

@ -1,97 +1,84 @@
<template> <template>
<div> <div>
<el-dialog :close-on-click-modal="false" :title="inDialogTiltle" :visible.sync="inDialogVisible" <el-dialog
:append-to-body="true" width="20%" @close="handleCloseDetail"> :close-on-click-modal="false"
:title="inDialogTiltle"
:visible.sync="inDialogVisible"
:append-to-body="true"
width="20%"
@close="handleCloseDetail"
>
<el-steps class="teps-con" direction="vertical" :active="1"> <el-steps class="teps-con" direction="vertical" :active="1">
<el-step v-for="(item, index) in processedApproveList" <el-step
:key="item.id" v-for="(item, index) in approvalList"
:title="item.userName" :title="item.name"
:description="`状态:${item.statusText}\n${item.formattedTime}`" :description="item.time || ''"
></el-step> ></el-step>
</el-steps> </el-steps>
<!-- <span slot="footer" class="dialog-footer">
<el-button @click="handleCloseDetail()"> </el-button>
</span> -->
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {
getAllQuarter,
getPurchasesByIds,
getMaterialList,
getDetailList,
} from "@/api/firstOrder/inbound";
export default { export default {
props: { props: {
showDialog: { showDialog: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
approveList: {
type: Array,
default: () => [],
}, },
data() {
return {
inDialogVisible: false,
inDialogTiltle: "审批流程",
approvalList: [
{
name: "张三",
time: "2021-01-01 10:10:10",
status: "通过",
}, },
watch: { {
showDialog(val) { name: "张三1",
this.inDialogVisible = val; time: "",
status: "待审核",
}, },
{
name: "张三3",
time: "",
status: "待审核",
}, },
computed: { ],
//
processedApproveList() {
return this.approveList.map(item => {
// 1.
let formattedTime = ''
if (item.optTime) {
const date = new Date(item.optTime);
const pad = (num) => num.toString().padStart(2, '0');
formattedTime = `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
}
let statusText = '待审核'
if (item.status !== '' && item.status !== undefined) {
const statusMap = {
0: '审批中',
1: '已完成',
2: '已驳回',
}; };
statusText = statusMap[item.status] || '';
}
return {
...item,
formattedTime,
statusText,
};
});
}, },
activeStep() {
return this.processedApproveList.findIndex((item, index, array) => { mounted() {
return index === array.length - 1 && item.statusText !== '审批中'; this.inDialogVisible = this.showDialog;
}) || 0;
}
}, },
methods: { methods: {
handleCloseDetail() { handleCloseDetail() {
this.inDialogVisible = false; this.inDialogVisible = false;
this.$emit("closeDialog"); this.$emit("closeDialog");
}
}, },
data() {
return {
inDialogVisible: false,
inDialogTiltle: "审批流程"
};
}, },
mounted() {
this.inDialogVisible = this.showDialog;
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.form-title { .form-title {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
padding: 18px 0; padding: 18px 0;
} }
.teps-con{
.teps-con { margin:0 auto 0
margin: 0 auto 0
} }
:deep(.el-dialog__body) { :deep(.el-dialog__body) {
height: 300px; height: 300px;
} }

@ -8,7 +8,7 @@
<el-row> <el-row>
<el-col :span="12" v-show="sizeForm.options == 1 && inDialogType != 'add'"> <el-col :span="12" v-show="sizeForm.options == 1 && inDialogType != 'add'">
<el-form-item label="入库单号"> <el-form-item label="入库单号">
<el-input v-model="sizeForm.orderNo" disabled></el-input> <el-input v-model="sizeForm.orderNo" disabled ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -84,7 +84,7 @@
{{ scope.row.requiredQuantity || 0 }} {{ scope.row.requiredQuantity || 0 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="inboundQuantity" label="已入库数量" v-if="sizeForm.option == 1"> <el-table-column prop="inboundQuantity" label="已入库数量" v-if="sizeForm.option == 1" >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.inboundQuantity || 0 }} {{ scope.row.inboundQuantity || 0 }}
</template> </template>
@ -93,7 +93,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.theInboundQuantity" :min="1" style="width: 100%;" <el-input-number size="mini" v-model="scope.row.theInboundQuantity" :min="1" style="width: 100%;"
@change="syncInboundQuantity(scope.row)" v-if='inDialogType != "details"'></el-input-number> @change="syncInboundQuantity(scope.row)" v-if='inDialogType != "details"'></el-input-number>
<span v-else>{{ scope.row.theInboundQuantity || 0 }}</span> <span v-else>{{ scope.row.theInboundQuantity || 0}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="unitPrice" label="单价"> <el-table-column prop="unitPrice" label="单价">
@ -117,7 +117,8 @@
<el-table-column prop="type" label="类别 "> <el-table-column prop="type" label="类别 ">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.type" placeholder="请选择" style="width: 100%;" <el-select v-model="scope.row.type" placeholder="请选择" style="width: 100%;"
@change="handleTypeChange(scope.row)" v-if='inDialogType !== "details"'> @change="handleTypeChange(scope.row)"
v-if='inDialogType !== "details"'>
<el-option label="耐用品" value="NY"></el-option> <el-option label="耐用品" value="NY"></el-option>
<el-option label="易耗品" value="YH"></el-option> <el-option label="易耗品" value="YH"></el-option>
</el-select> </el-select>
@ -429,7 +430,7 @@ export default {
this.$message.error("获取详情数据失败"); this.$message.error("获取详情数据失败");
} }
} }
}, },
addInit() { addInit() {
// //
// const randomNum = Math.floor(Math.random() * 100000000) + 1; // const randomNum = Math.floor(Math.random() * 100000000) + 1;
@ -484,7 +485,6 @@ export default {
return return
} }
this.sizeForm.quarterName = selectedOption.quarterName this.sizeForm.quarterName = selectedOption.quarterName
this.sizeForm.purchaseEndInfo = selectedOption this.sizeForm.purchaseEndInfo = selectedOption
this.loading = true this.loading = true
const res = await getPurchasesByIds(this.batchType); const res = await getPurchasesByIds(this.batchType);
@ -623,7 +623,6 @@ export default {
this.sizeForm.options = this.sizeForm.option this.sizeForm.options = this.sizeForm.option
this.sizeForm.option = '' this.sizeForm.option = ''
} }
try {
const res = await submitData(this.sizeForm) const res = await submitData(this.sizeForm)
if (res.data.success) { if (res.data.success) {
this.$message({ this.$message({
@ -636,10 +635,6 @@ export default {
} else { } else {
this.$message.error(res.data.message || "提交失败"); this.$message.error(res.data.message || "提交失败");
} }
} catch (error) {
this.$message.error(error.message || "服务器错误");
}
}, },
// 1 2 // 1 2

@ -7,7 +7,7 @@
<div class="form-title"> 基本信息</div> <div class="form-title"> 基本信息</div>
<el-row> <el-row>
<el-col :span="12" v-show="sizeForm.options == 1 && outDialogType != 'add'"> <el-col :span="12" v-show="sizeForm.options == 1 && outDialogType != 'add'">
<el-form-item label="库单号"> <el-form-item label="库单号">
<el-input v-model="sizeForm.orderNo" disabled></el-input> <el-input v-model="sizeForm.orderNo" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -71,7 +71,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="unit" label="单位"> <el-table-column prop="unit" label="单位">
</el-table-column> </el-table-column>
<el-table-column prop="departmentName" label="部门" v-if="sizeForm.options === 2"> <el-table-column prop="departmentName" label="部门" v-if="sizeForm.options == 2">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;" <el-select v-model="scope.row.department" placeholder="请选择部门名称" style="width: 100%;"
v-if='inDialogType != "details"'> v-if='inDialogType != "details"'>
@ -85,15 +85,12 @@
<el-table-column prop="applicationQuantity" label="申请数量" v-if="sizeForm.options == 1"> <el-table-column prop="applicationQuantity" label="申请数量" v-if="sizeForm.options == 1">
</el-table-column> </el-table-column>
<el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1"> <el-table-column prop="outboundQuantity" label="已出库数量" v-if="sizeForm.options == 1">
<template slot-scope="scope">
{{ scope.row.outboundQuantity || 0 }}
</template>
</el-table-column> </el-table-column>
<el-table-column prop="theOutboundQuantity" label="本次库数量"> <el-table-column prop="theInboundQuantity" label="本次入库数量">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.theOutboundQuantity" :min="1" style="width: 100%;" <el-input-number size="mini" v-model="scope.row.theInboundQuantity" :min="1" style="width: 100%;"
@change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'"></el-input-number> @change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'"></el-input-number>
<!-- <span v-else>{{ scope.row.theOutboundQuantity || 0 }}</span> --> <!-- <span v-else>{{ scope.row.theInboundQuantity || 0 }}</span> -->
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="status" label="出库情况"> <!-- <el-table-column prop="status" label="出库情况">
@ -124,20 +121,19 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="theOutboundQuantity" label="本次出库数量"> <!-- <el-table-column prop="str6" label="数量" v-if="sizeForm.options == 1">
</el-table-column> -->
<el-table-column prop="theInboundQuantity" label="本次出库数量">
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="date" label="出库信息" v-if="sizeForm.options == 1"> <el-table-column prop="date" label="出库信息" v-if="sizeForm.options == 1">
<el-table-column prop="outboundQuantity" label="数量"> <el-table-column prop="outboundQuantity" label="数量">
<template slot-scope="scope">
{{ scope.row.outboundQuantity || 0 }}
</template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="date" label="出库后库存" v-if="sizeForm.options == 1"> <el-table-column prop="date" label="出库后库存" v-if="sizeForm.options == 1">
<el-table-column prop="str10" label="数量"> <el-table-column prop="str10" label="数量">
</el-table-column> </el-table-column>
</el-table-column> --> </el-table-column>
</el-table> </el-table>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -178,10 +174,10 @@
<el-button type="primary" @click="batchSubmit()"> </el-button> <el-button type="primary" @click="batchSubmit()"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 选择弹窗 --> <!-- 耐用品选择弹窗 -->
<el-dialog :close-on-click-modal="false" title="选择耐用品" :visible.sync="goodsVisible" :append-to-body="true" <el-dialog :close-on-click-modal="false" title="选择耐用品" :visible.sync="goodsVisible" :append-to-body="true"
width="70%"> width="40%" @selection-change="goodsListSelectionChange">
<el-table :data="goodsList" border style="width: 100%" @selection-change="goodsListSelectionChange"> <el-table :data="goodsList" border style="width: 100%">
<el-table-column type="selection" width="55"> <el-table-column type="selection" width="55">
</el-table-column> </el-table-column>
<el-table-column prop="materialCode" label="物资编码"> <el-table-column prop="materialCode" label="物资编码">
@ -202,13 +198,10 @@
<el-table-column prop="applicationQuantity" label="申请数量"> <el-table-column prop="applicationQuantity" label="申请数量">
</el-table-column> </el-table-column>
<el-table-column prop="outboundQuantity" label="已出库数量"> <el-table-column prop="outboundQuantity" label="已出库数量">
<template slot-scope="scope">
{{ scope.row.outboundQuantity || 0 }}
</template>
</el-table-column> </el-table-column>
<el-table-column prop="theOutboundQuantity" label="本次库数量"> <el-table-column prop="theInboundQuantity" label="本次入库数量">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number size="mini" v-model="scope.row.theOutboundQuantity" :min="1" style="width: 100%;" <el-input-number size="mini" v-model="scope.row.theInboundQuantity" :min="1" style="width: 100%;"
@change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'"></el-input-number> @change="syncInboundQuantity(scope.row)" :disabled="outDialogType == 'details'"></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
@ -253,14 +246,14 @@ export default {
departmentList: [], departmentList: [],
outDialogVisible: false, outDialogVisible: false,
sizeForm: { sizeForm: {
orderNo: '',// orderNo: '',//
reason: '',// reason: '',//
// inAccountsTableData: [],// // inAccountsTableData: [],//
inTableData: [], inTableData: [],
ldOneOutStorageDetailVOList: [], ldOneOutStorageDetailVOList: [],
demandEndInfo: '',// demandEndInfo: '',//
outDate: '',// outDate: '',//
options: 2,// options: '',//
materialType: '1',// materialType: '1',//
status: '',//1 2 status: '',//1 2
// materialld: '',//Id // materialld: '',//Id
@ -304,9 +297,9 @@ export default {
this.getMaterialList() this.getMaterialList()
}, },
methods: { methods: {
// //
syncInboundQuantity(row) { syncInboundQuantity(row) {
row.theOutboundQuantity = Number(row.theOutboundQuantity); row.theInboundQuantity = Number(row.theInboundQuantity);
}, },
// //
handleCloseDetail() { handleCloseDetail() {
@ -395,28 +388,24 @@ export default {
if (selectedQuarter) { if (selectedQuarter) {
this.sizeForm.demandEndInfo = selectedQuarter.quarterName; this.sizeForm.demandEndInfo = selectedQuarter.quarterName;
} }
if (res.data.result.uniqueList != null && res.data.result.uniqueList.length > 0) {
this.goodsVisible = true if(res.data.result.abc != null && res.data.result.abc.length > 0){
this.goodsList = res.data.result.uniqueList this.data.goodsVisible = true
this.data.goodsList = res.data.result.abc
} }
} else { } else {
this.$message.warning('未获取到详细数据'); this.$message.warning('未获取到详细数据');
} }
}, },
// //
goodsListSelectionChange(val) { goodsListSelectionChange(val){
this.goodsSelectList = val this.goodsSelectList = val
}, },
// //
goodsSubmit() { goodsSubmit(){
if (this.goodsSelectList.length > 0) { this.data.goodsVisible = false
this.sizeForm.inTableData.push(...this.goodsSelectList); this.sizeForm.inTableData.push(this.goodsSelectList)
this.$forceUpdate();
} else {
this.$message.warning('请先勾选需要添加的数据');
}
this.goodsVisible = false
}, },
// //
async getDetailedItems() { async getDetailedItems() {
@ -492,23 +481,19 @@ export default {
this.sizeForm.ldOneOutStorageDetailVOList.departmentName = this.sizeForm.inTableData.department this.sizeForm.ldOneOutStorageDetailVOList.departmentName = this.sizeForm.inTableData.department
this.sizeForm.inTableData = [] this.sizeForm.inTableData = []
try {
const res = await submitData(this.sizeForm) const res = await submitData(this.sizeForm)
console.log(res, '暂存提交数据')
if (res.data.success) { if (res.data.success) {
this.$message({ this.$message({
type: "success", type: "success",
message: "提交成功" message: "提交成功"
}); });
//
this.$emit('submitSuccess'); this.$emit('submitSuccess');
this.handleCloseDetail(); this.handleCloseDetail();
} else { } else {
this.$message.error(res.data.message || "提交失败"); this.$message.error(res.data.message || "提交失败");
} }
} catch (error) {
this.$message.error(error.message || "服务器错误");
}
}, },
// //
async inInit() { async inInit() {
@ -523,7 +508,7 @@ export default {
} }
const handledDetailList = ldOneOutStorageDetails.map(item => ({ const handledDetailList = ldOneOutStorageDetails.map(item => ({
...item, ...item,
outboundQuantity: item.outboundQuantity || 0 // theInboundQuantity: item.theInboundQuantity || 0
})) }))
this.sizeForm = { this.sizeForm = {
...this.sizeForm, ...this.sizeForm,
@ -540,22 +525,97 @@ export default {
} }
}, },
addInit() { addInit() {
this.sizeForm.outDate = new Date()// // //
// const randomNum = Math.floor(Math.random() * 100000000) + 1;
// this.sizeForm.code = String(randomNum).padStart(8, '0');//
this.sizeForm.outDate = new Date()//
}, },
// //
inTableAdd() { inTableAdd() {
this.sizeForm.inTableData.push({}) this.sizeForm.inTableData.push({})
}, },
// //
// // putIn(row) {
// // row.status = 0
// // //
// // this.sizeForm.inAccountsTableData.push({
// // str1: "000001",
// // str2: "1",
// // str3: "1",
// // str4: "1",
// // str5: "1",
// // str6: "12",
// // str7: "3",
// // str8: row.str7,
// // str9: "3",
// // str10: row.str7 + 12,
// // str11: "3",
// // str12: "1",
// // str13: "2025-04-05",
// // })
// // },
//
// //
// handleBatchClose() {
// this.inBatchDialogVisible = false
// },
// //
// batchSumbit() {
// this.sizeForm.bumen = ''
// this.sizeForm.xuqiudanmingcheng = '2025'
// this.sizeForm.inTableData.push({
// // str1: '000001',
// // str2: '1',
// // str3: '1',
// // str4: '1',
// // str5: '1',
// // str6: '11',
// // str7: '22',
// // str8: '3',
// // str9: '',
// // name: '',
// // status: '1',//
// // yichuku: 98,
// })
// this.inBatchDialogVisible = false
// },
// //
async radioChange() { async radioChange() {
this.sizeForm.inTableData = [] this.sizeForm.inTableData = []
if (this.sizeForm.options === 1) { if (this.sizeForm.options == 1) {
await this.getQuarterList() await this.getQuarterList() //
this.inBatchDialogVisible = true this.inBatchDialogVisible = true
this.$forceUpdate()
} }
}, },
//
// changeName(index) {
// console.log(9999, index)
// this.sizeForm.inTableData.forEach((item, i) => {
// if (i == index) {
// item.str1 = '000001'
// item.str2 = '1'
// item.str3 = '1'
// item.str4 = '1'
// item.str5 = '1'
// item.str6 = '11'
// item.str7 = 22
// item.str8 = '3'
// item.str9 = ''
// item.name = ''
// item.status = '1'
// this.$set(item, 'str7', 22)
// }
// })
// console.log(888888, this.sizeForm.inTableData)
// },
numberChange() {
this.$forceUpdate();//
console.log(77777, this.sizeForm.inTableData)
}
}, },
watch: { watch: {
// //

@ -16,16 +16,20 @@
@refresh-change="refreshChange" @refresh-change="refreshChange"
@on-load="onLoad" @on-load="onLoad"
> >
<!-- @row-click="rowSelect" -->
<template slot-scope="scope" slot="menuLeft"> <template slot-scope="scope" slot="menuLeft">
<el-button size="small" type="primary" @click="handleDesign()" <el-button size="small" type="primary" @click="handleDesign()"
>新增入库单 >新增入库单
</el-button> </el-button>
<!-- <el-button size="small" type="primary" @click="handleExport()"
>入库单导出
</el-button> -->
</template> </template>
<template slot-scope="scope" slot="purchaseEndInfo"> <template slot-scope="scope" slot="purchaseEndInfo">
<el-button <el-button
type="text" type="text"
@click.stop="purchaseFn(scope.row)" @click.stop="purchaseFn(scope.row)"
v-if="scope.row.purchaseEndInfo && scope.row.purchaseEndInfo !== ''" v-if="scope.row.purchaseEndInfo != ''"
>{{ scope.row.purchaseEndInfo }}</el-button >{{ scope.row.purchaseEndInfo }}</el-button
> >
<span v-else></span> <span v-else></span>
@ -72,13 +76,13 @@
:showDialog="approvalProcessShow" :showDialog="approvalProcessShow"
v-if="approvalProcessShow" v-if="approvalProcessShow"
@closeDialog="closeDialog" @closeDialog="closeDialog"
:approveList="approveList"
></approvalProcessDialog> ></approvalProcessDialog>
</basic-container> </basic-container>
</template> </template>
<script> <script>
import { getList, editList } from "@/api/firstOrder/inbound"; import { getList } from "@/api/firstOrder/inbound";
// import { mapGetters } from "vuex";
import inDialog from "./components/inDialog.vue"; import inDialog from "./components/inDialog.vue";
import purchaseDialog from "./components/purchaseDialog.vue"; import purchaseDialog from "./components/purchaseDialog.vue";
import approvalProcessDialog from "./components/approvalProcessDialog.vue"; import approvalProcessDialog from "./components/approvalProcessDialog.vue";
@ -90,7 +94,7 @@ export default {
}, },
data() { data() {
return { return {
approveList:[], // form: {},
form: { inDate: [], inOperatorName: "", inOperator: "" }, form: { inDate: [], inOperatorName: "", inOperator: "" },
selectionList: [], selectionList: [],
query: {}, query: {},
@ -105,7 +109,7 @@ export default {
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: true,
searchMenuSpan: 12, searchMenuSpan: 6,
border: true, border: true,
index: true, index: true,
viewBtn: false, viewBtn: false,
@ -124,24 +128,39 @@ export default {
menuWidth: 190, menuWidth: 190,
menu: true, menu: true,
menuAlign: "left", menuAlign: "left",
searchMenuAlign: "right",
searchMenuPosition: "right", searchMenuPosition: "right",
excelBtn: true, excelBtn: true,
column: [ column: [
{ {
label: "采购单名称", label: "采购单名称",
prop: "purchaseEndInfo", prop: "purchaseEndInfo",
<<<<<<< HEAD
width: 150,
align: "center",
formatter: (row, column) => {
const value = row.purchaseEndInfo;
if (value === null || value === undefined || value === "") {
return "无"; //
}
return value; //
}
=======
width: 180, width: 180,
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
slot: "purchaseEndInfo" >>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
}, },
{ {
label: "入库单号", label: "入库单号",
prop: "orderNo", prop: "orderNo",
<<<<<<< HEAD
width: 160,
align: "center"
=======
width: 110, width: 110,
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
>>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
}, },
{ {
label: "入库日期", label: "入库日期",
@ -151,49 +170,72 @@ export default {
searchRange: true, searchRange: true,
startPlaceholder: "开始时间", startPlaceholder: "开始时间",
endPlaceholder: "结束时间", endPlaceholder: "结束时间",
<<<<<<< HEAD
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
width: 160,
align: "center"
=======
format: "yyyy-MM-dd HH:mm:ss", format: "yyyy-MM-dd HH:mm:ss",
valueFormat: "yyyy-MM-dd HH:mm:ss", valueFormat: "yyyy-MM-dd HH:mm:ss",
width: 140, width: 140,
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
>>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
// searchParam: 'startTime',
// searchEndParam: 'endTime'
}, },
{ {
label: "入库人", label: "入库人",
prop: "inOperatorName", prop: "inOperatorName",
search: true, search: true,
<<<<<<< HEAD
searchParam: 'inOperator',
align: "center"
=======
searchParam: "inOperator", searchParam: "inOperator",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
>>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
}, },
{ {
label: "来源", label: "来源",
prop: "source", prop: "source",
search: false, search: false,
<<<<<<< HEAD
align: "center"
=======
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
type: "select", >>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
dicData: [
{
label: "采购申请",
value: 'cg',
},
{
label: "其他来源",
value: 'qt',
},
],
}, },
{ {
label: "事由", label: "事由",
prop: "reason", prop: "reason",
search: false, search: false,
<<<<<<< HEAD
align: "center"
=======
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
>>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
}, },
{ {
label: "物资类型", label: "物资类型",
prop: "materialType", prop: "materialType",
search: false, search: false,
<<<<<<< HEAD
type: 'select',
align: "center",
dicData: [{
label: '办公物资',
value: '1'
},
{
label: '其他物资',
value: '2'
}]
=======
type: "select", type: "select",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
@ -207,12 +249,27 @@ export default {
value: "2", value: "2",
}, },
], ],
>>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
},
{
label: "审批人员",
prop: "approvers",
<<<<<<< HEAD
align: "center"
=======
headerAlign: "center",
align: "center",
>>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
}, },
{ {
label: "状态", label: "状态",
prop: "status", prop: "status",
<<<<<<< HEAD
type: 'select',
=======
type: "select", type: "select",
headerAlign: "center", headerAlign: "center",
>>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
align: "center", align: "center",
dicData: [ dicData: [
{ {
@ -243,11 +300,8 @@ export default {
}, },
computed: {}, computed: {},
methods: { methods: {
async approvalProcessFn(row) { approvalProcessFn(row) {
this.approvalProcessShow = true; this.approvalProcessShow = true;
const res = await editList(row.id);
this.approveList = res.data.result.approveList
console.log(this.approveList,'1111122')
}, },
handleDesign() { handleDesign() {
this.inDialogType = "add"; this.inDialogType = "add";
@ -256,10 +310,19 @@ export default {
}, },
// //
handleDetails(row) { handleDetails(row) {
<<<<<<< HEAD
this.inDialogVisible = true
this.inDialogType = 'details'
this.inDialogTiltle = '详情'
this.id = row.id
console.log(this.id, 'id')
=======
this.inDialogVisible = true; this.inDialogVisible = true;
this.inDialogType = "details"; this.inDialogType = "details";
this.inDialogTiltle = "详情"; this.inDialogTiltle = "详情";
this.id = row.id; this.id = row.id;
console.log(this.id, "id");
>>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
}, },
// //
handleEdit(row) { handleEdit(row) {
@ -347,6 +410,7 @@ export default {
delete queryParams.inDate; delete queryParams.inDate;
} }
getList(page.currentPage, page.pageSize, queryParams).then((res) => { getList(page.currentPage, page.pageSize, queryParams).then((res) => {
console.log("列表", res.data.result);
this.data = res.data.result.list; this.data = res.data.result.list;
this.loading = false; this.loading = false;
this.page.total = res.data.result.total; this.page.total = res.data.result.total;
@ -356,6 +420,4 @@ export default {
}; };
</script> </script>
<style> <style></style>
</style>

@ -1,31 +1,48 @@
<template> <template>
<div> <div>
<basic-container> <basic-container>
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page" <avue-crud
:permission="permissionList" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" :option="option"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" :table-loading="loading"
@refresh-change="refreshChange" @on-load="onLoad"> :data="data"
ref="crud"
v-model="form"
:page.sync="page"
:permission="permissionList"
@row-del="rowDel"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
<template slot-scope="scope" slot="menu"> <template slot-scope="scope" slot="menu">
<el-button type="text" size="small" @click.stop="handleLog(scope.row)">记录 <el-button type="text" size="small" @click.stop="handleLog(scope.row)"
>记录
</el-button> </el-button>
</template> </template>
</avue-crud> </avue-crud>
</basic-container> </basic-container>
<el-dialog title="记录" :visible.sync="dialogLogVisible" width="50%" :close-on-click-modal="false" <el-dialog
:append-to-body="true"> title="记录"
:visible.sync="dialogLogVisible"
width="50%"
:close-on-click-modal="false"
:append-to-body="true"
>
<el-tabs v-model="transactionType" @tab-click="handleTabClick"> <el-tabs v-model="transactionType" @tab-click="handleTabClick">
<el-tab-pane label="出库" name="1"></el-tab-pane> <el-tab-pane label="出库" name="1"></el-tab-pane>
<el-tab-pane label="入库" name="2"></el-tab-pane> <el-tab-pane label="入库" name="2"></el-tab-pane>
</el-tabs> </el-tabs>
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
<el-table-column type="index" width="50"> </el-table-column> <el-table-column type="index" width="50"> </el-table-column>
<el-table-column prop="quantity" label="数量"> <el-table-column prop="quantity" label="数量" >
</el-table-column>
<el-table-column prop="money" label="单价" v-if="transactionType == '2'">
</el-table-column> </el-table-column>
<el-table-column prop="operatorName" label="操作人" > <el-table-column prop="operatorName" label="操作人" >
</el-table-column> </el-table-column>
<el-table-column prop="operationTime" label="时间" :formatter="formatTime"> <el-table-column prop="operationTime" label="时间" >
</el-table-column> </el-table-column>
<el-table-column prop="departmentName" label="部门"> </el-table-column> <el-table-column prop="departmentName" label="部门"> </el-table-column>
</el-table> </el-table>
@ -56,7 +73,7 @@ export default {
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: true,
searchMenuSpan: 12, searchMenuSpan: 6,
border: true, border: true,
index: true, index: true,
selection: true, selection: true,
@ -141,13 +158,6 @@ export default {
prop: "remark", prop: "remark",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
formatter: (row, column) => {
const value = row.remark;
if (value === null || value === undefined || value === "") {
return "无";
}
return value;
}
}, },
], ],
}, },
@ -179,54 +189,38 @@ export default {
}, },
}, },
mounted() { mounted() {
this.ckTable = []; this.tableData = this.ckTable;
this.rkTable = []; this.tableData = this.rkTable;
this.tableData = [];
}, },
methods: { methods: {
formatTime(row, column, cellValue) {
if (!cellValue) return '';
return cellValue.replace('T', ' ');
},
async handleLog(row) { async handleLog(row) {
this.dialogLogVisible = true; this.dialogLogVisible = true;
this.currentRow = row; this.currentRow = row;
this.loadTransactionData();
},
handleTabClick() {
this.loadTransactionData();
},
async loadTransactionData() {
if (!this.currentRow) return;
const params = { const params = {
oneFromId: this.currentRow.id, oneFromId: row.id,
transactionType: this.transactionType transactionType: this.transactionType,
}; };
const pageNum = this.page.currentPage; const pageNum = this.page.currentPage;
const pageSize = this.page.pageSize; const pageSize = this.page.pageSize;
this.loading = true;
try {
const res = await recordList( const res = await recordList(
pageNum, pageNum,
pageSize, pageSize,
Object.assign({}, this.query, params) Object.assign({}, this.query, params)
); );
if (this.transactionType === "1") {
this.ckTable = res.data.result.list;
} else {
this.rkTable = res.data.result.list;
}
this.tableData = res.data.result.list; this.tableData = res.data.result.list;
} catch (error) { },
console.error("获取记录数据失败:", error);
} finally { handleTabClick() {
this.loading = false; //
if (this.transactionType == "1") {
this.tableData = this.ckTable;
}
//
if (this.transactionType == "2") {
this.tableData = this.rkTable;
} }
}, },
searchReset() { searchReset() {
this.query = {}; this.query = {};
this.onLoad(this.page); this.onLoad(this.page);

@ -12,9 +12,9 @@
</el-button> --> </el-button> -->
</template> </template>
<template slot-scope="scope" slot="purchaseEndInfo"> <template slot-scope="scope" slot="purchaseEndInfo">
<el-button type="text" @click.stop="purchaseFn(scope.row)" v-if="scope.row.purchaseEndInfo != ''">{{ <el-button type="text" @click.stop="purchaseFn(scope.row)" v-if="scope.row.purchaseEndInfo != ''">{{
scope.row.purchaseEndInfo }}</el-button> scope.row.purchaseEndInfo }}</el-button>
<span>{{ scope.row.purchaseEndInfo || '无' }}</span> <span v-else></span>
</template> </template>
<template #menu="scope"> <template #menu="scope">
<el-button type="text" @click.stop="handleDetails(scope.row)">详情</el-button> <el-button type="text" @click.stop="handleDetails(scope.row)">详情</el-button>
@ -35,6 +35,7 @@
<script> <script>
import { getList } from "@/api/firstOrder/outbound"; import { getList } from "@/api/firstOrder/outbound";
// import { mapGetters } from "vuex";
import outDialog from './components/outDialog.vue'; import outDialog from './components/outDialog.vue';
import needDialog from './components/needDialog.vue'; import needDialog from './components/needDialog.vue';
export default { export default {
@ -44,6 +45,7 @@ export default {
}, },
data() { data() {
return { return {
// form: {},
form: { outDate: [] }, form: { outDate: [] },
selectionList: [], selectionList: [],
query: {}, query: {},
@ -58,7 +60,7 @@ export default {
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: true,
searchMenuSpan: 12, searchMenuSpan: 6,
border: true, border: true,
index: true, index: true,
selection: true, selection: true,
@ -84,23 +86,26 @@ export default {
{ {
label: "需求单名称", label: "需求单名称",
prop: "demandEndInfo", prop: "demandEndInfo",
<<<<<<< HEAD
width: 150,
align: "center"
=======
width: 180, width: 180,
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
formatter: (row, column) => { >>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
const value = row.demandEndInfo;
if (value === null || value === undefined || value === "") {
return "无";
}
return value;
}
}, },
{ {
label: "出库单号", label: "出库单号",
prop: "orderNo", prop: "orderNo",
width: 140, <<<<<<< HEAD
width: 160,
align: "center"
=======
width: 110,
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
>>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
}, },
{ {
label: "出库日期", label: "出库日期",
@ -112,23 +117,37 @@ export default {
endPlaceholder: "结束时间", endPlaceholder: "结束时间",
format: 'yyyy-MM-dd HH:mm:ss', format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss',
<<<<<<< HEAD
width: 160,
align: "center"
=======
width: 140, width: 140,
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
>>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
// searchParam: 'startTime',
// searchEndParam: 'endTime'
}, },
{ {
label: "事由", label: "事由",
prop: "reason", prop: "reason",
search: false, search: false,
<<<<<<< HEAD
align: "center"
=======
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
>>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
}, },
{ {
label: "物资类型", label: "物资类型",
prop: "materialType", prop: "materialType",
search: false, search: false,
type: 'select', type: 'select',
<<<<<<< HEAD
=======
headerAlign: "center", headerAlign: "center",
>>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
align: "center", align: "center",
dicData: [{ dicData: [{
label: '办公物资', label: '办公物资',
@ -142,23 +161,25 @@ export default {
{ {
label: "部门", label: "部门",
prop: "department", prop: "department",
align: "center", <<<<<<< HEAD
align: "center"
=======
headerAlign: "center", headerAlign: "center",
formatter: (row, column) => { align: "center",
const value = row.department; >>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
if (value === null || value === undefined || value === "") {
return "无";
}
return value;
}
}, },
{ {
label: "出库人", label: "出库人",
prop: "shipperName", prop: "shipperName",
search: true, search: true,
<<<<<<< HEAD
searchParam: 'inOperator', searchParam: 'inOperator',
align: "center", align: "center"
=======
headerAlign: "center", headerAlign: "center",
align: "center",
searchParam: 'inOperator'
>>>>>>> 8b1ca70a0fedc4bfbcc6caa65f87be7eec4bd817
}, },
// { // {
@ -278,7 +299,10 @@ export default {
}, },
// //
handleSubmitSuccess() { handleSubmitSuccess() {
console.log(2)
console.log('父组件更新')
this.onLoad(this.page) this.onLoad(this.page)
console.log('父组件更新完成')
}, },
// //
onLoad(page, params = {}) { onLoad(page, params = {}) {

@ -85,7 +85,7 @@ export default {
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: true,
searchMenuSpan: 12, searchMenuSpan: 6,
border: true, border: true,
index: true, index: true,
selection: true, selection: true,

@ -1,9 +1,30 @@
<template> <template>
<div> <div>
<basic-container> <basic-container>
<avue-crud :option="option" v-model="form" :data="data" @row-del="rowDel" @on-load="onLoad" <!-- <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page"
:table-loading="loading" @row-update="rowUpdate" @row-save="rowSave" @search-change="searchChange" :permission="permissionList" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset"
@search-reset="searchReset" :page.sync="page"></avue-crud> @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad">
<template slot-scope="scope" slot="menu">
<el-button type="text" size="small" @click.stop="handleReturn(scope.row)">查看
</el-button>
<el-button type="text" size="small" @click.stop="handleReturn(scope.row)">编辑
</el-button>
</template>
</avue-crud> -->
<avue-crud
:option="option"
v-model="form"
:data="data"
@row-del="rowDel"
@on-load="onLoad"
:table-loading="loading"
@row-update="rowUpdate"
@row-save="rowSave"
@search-change="searchChange"
@search-reset="searchReset"
:page.sync="page"
></avue-crud>
</basic-container> </basic-container>
</div> </div>
</template> </template>
@ -17,7 +38,6 @@ export default {
selectionList: [], selectionList: [],
query: {}, query: {},
loading: true, loading: true,
codeList: [],
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
@ -28,7 +48,7 @@ export default {
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: true,
searchMenuSpan: 18, searchMenuSpan: 6,
border: true, border: true,
index: true, index: true,
selection: true, selection: true,
@ -43,7 +63,7 @@ export default {
gridSpan: false, gridSpan: false,
filterBtn: false, filterBtn: false,
columnBtn: false, columnBtn: false,
menuAlign: "center", menuAlign: "left",
searchMenuPosition: "right", searchMenuPosition: "right",
addBtnIcon: " ", addBtnIcon: " ",
viewBtnIcon: " ", viewBtnIcon: " ",
@ -74,6 +94,14 @@ export default {
label: "label", label: "label",
value: "value", value: "value",
}, },
// formatter: (row, value, label, column) => {
// // valuelabel
// const typeMap = {
// 1: '',
// 2: ''
// };
// return typeMap[value] || value;
// },
dataType: "string", dataType: "string",
}, },
{ {
@ -82,25 +110,25 @@ export default {
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
}, },
{
label: "描述",
prop: "remark",
headerAlign: "center",
align: "center",
formatter: (row, column) => {
const value = row.remark;
if (value === null || value === undefined || value === "") {
return "无";
}
return value;
}
},
], ],
}, },
data: [], data: [],
dialogLogVisible: false, dialogLogVisible: false,
activeName: "first", activeName: "first",
tableData: [], tableData: [],
ckTable: [
{ str1: "3", str2: "2025-04-09", str3: "部门一" },
{ str1: "37", str2: "2025-04-03", str3: "部门一" },
],
rkTable: [
{ str1: "5", str2: "2025-03-19", str3: "部门二" },
{ str1: "12", str2: "2025-03-19", str3: "部门二" },
],
bfTable: [
{ str1: "9", str2: "2025-03-19", str3: "部门三" },
{ str1: "19", str2: "2025-03-19", str3: "部门三" },
],
}; };
}, },
computed: { computed: {
@ -133,6 +161,7 @@ export default {
label: item.name, label: item.name,
value: item.code, value: item.code,
})); }));
console.log("materialCode字典数据:", dicData);
const targetColumn = this.option.column.find( const targetColumn = this.option.column.find(
(col) => col.prop === "materialCode" (col) => col.prop === "materialCode"
); );
@ -141,6 +170,7 @@ export default {
} }
}) })
.catch((error) => { .catch((error) => {
console.error("获取materialCode字典数据失败:", error);
this.$message.error("加载类别数据失败,请刷新重试"); this.$message.error("加载类别数据失败,请刷新重试");
}); });
}, },
@ -188,14 +218,7 @@ export default {
}, },
// //
rowSave(row, done, loading) { rowSave(row, done, loading) {
// const submitData = {
// ...row,
// code: row.materialCode,
// materialCode: undefined
// };
// console.log(submitData,'submitData')
add(row).then( add(row).then(
() => { () => {
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
@ -258,11 +281,32 @@ export default {
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
// this.data.push({
// no: '00100001',
// name: '1',
// xh: '1',
// lb: '',
// unit: '11',
// number: '1',
// dj: '11',
// pice: '11'
// }, {
// no: '00100002',
// name: '2',
// xh: '2',
// lb: '',
// unit: '22',
// number: '2',
// dj: '11',
// pice: '22'
// })
this.loading = false;
getList( getList(
page.currentPage, page.currentPage,
page.pageSize, page.pageSize,
Object.assign(params, this.query) Object.assign(params, this.query)
).then((res) => { ).then((res) => {
// const data = res.data.data;
this.data = res.data.result.list; this.data = res.data.result.list;
this.loading = false; this.loading = false;
this.page.total = res.data.result.total; this.page.total = res.data.result.total;

@ -33,7 +33,7 @@ export default {
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: true,
searchMenuSpan: 18, searchMenuSpan: 6,
border: true, border: true,
index: true, index: true,
selection: true, selection: true,
@ -48,7 +48,6 @@ export default {
gridSpan: false, gridSpan: false,
filterBtn: false, filterBtn: false,
columnBtn: false, columnBtn: false,
searchMenuPosition: "right",
column: [ column: [
{ {
label: "采购单号", label: "采购单号",
@ -69,6 +68,12 @@ export default {
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
}, },
{
label: "类别",
prop: "type",
headerAlign: "center",
align: "center",
},
{ {
label: "单位", label: "单位",
prop: "unit", prop: "unit",
@ -93,7 +98,20 @@ export default {
dialogLogVisible: false, dialogLogVisible: false,
activeName: 'first', activeName: 'first',
tableData: [], tableData: [],
}
// ckTable: [
// {str1: '3', str2: '2025-04-09', str3: ''},
// {str1: '37', str2: '2025-04-03', str3: ''}
// ],
// rkTable: [
// {str1: '5',str2: '2025-03-19',str3: ''},
// {str1: '12',str2: '2025-03-19',str3: ''},
// ],
// bfTable: [
// {str1: '9',str2: '2025-03-19',str3: ''},
// {str1: '19',str2: '2025-03-19',str3: ''},
// ],
};
}, },
computed: { computed: {
...mapGetters(["userInfo", "permission"]), ...mapGetters(["userInfo", "permission"]),
@ -161,7 +179,27 @@ export default {
this.onLoad(this.page, this.query); this.onLoad(this.page, this.query);
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true this.loading = true;
// this.data.push({
// no: '00100001',
// name: '1',
// xh: '1',
// lb: '',
// unit: '11',
// number: '1',
// dj: '11',
// pice: '11'
// }, {
// no: '00100002',
// name: '2',
// xh: '2',
// lb: '',
// unit: '22',
// number: '2',
// dj: '11',
// pice: '22'
// })
this.loading = false
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
console.log(898989,res.data.result) console.log(898989,res.data.result)
this.data = res.data.result.list; this.data = res.data.result.list;

@ -58,7 +58,7 @@ export default {
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: true,
searchMenuSpan: 12, searchMenuSpan: 6,
border: true, border: true,
index: true, index: true,
selection: true, selection: true,

@ -87,7 +87,7 @@ export default {
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: true,
searchMenuSpan: 12, searchMenuSpan: 6,
border: true, border: true,
index: true, index: true,
selection: true, selection: true,

Loading…
Cancel
Save