代码提交

master
taozi 4 months ago
parent 7ee3048269
commit f79bcbfbb1
  1. 15
      src/api/firstOrder/inbound.js
  2. 42
      src/api/materials/list.js
  3. 15
      src/api/purchaseOrders/index.js
  4. 168
      src/views/firstOrder/inbound.vue
  5. 2
      src/views/firstOrder/list.vue
  6. 174
      src/views/materials/index.vue
  7. 102
      src/views/purchaseOrders/index.vue

@ -0,0 +1,15 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
return request({
url: '/smartpark/onePutStorage/list',
method: 'get',
params: {
...params,
pageSize:size,
pageNum:current,
},
cryptoToken: false,
cryptoData: false
})
}

@ -0,0 +1,42 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
return request({
url: '/smartpark/material/list',
method: 'get',
params: {
...params,
pageSize: size,
pageNum: current,
},
cryptoToken: false,
cryptoData: false
})
}
export const add = (row) => {
return request({
url: '/smartpark/material/submit',
method: 'post',
data: row,
cryptoToken: false,
cryptoData: false
})
}
export const update = (row) => {
return request({
url: '/smartpark/material/submit',
method: 'post',
data: row,
cryptoToken: false,
cryptoData: false
})
}
export const remove = (ids) => {
return request({
url: '/smartpark/material/remove',
method: 'post',
params: { ids }, // 使用params而不是data,将参数放在URL查询参数中
cryptoToken: false,
cryptoData: false
})
}

@ -0,0 +1,15 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
return request({
url: '/smartpark/purchaseEnd/list',
method: 'get',
params: {
...params,
pageSize: size,
pageNum: current,
},
cryptoToken: false,
cryptoData: false
})
}

@ -3,7 +3,7 @@
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page" <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page"
:permission="permissionList" @search-change="searchChange" @search-reset="searchReset" :permission="permissionList" @search-change="searchChange" @search-reset="searchReset"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad" > @refresh-change="refreshChange" @on-load="onLoad">
<!-- @row-click="rowSelect" --> <!-- @row-click="rowSelect" -->
<template slot-scope="scope" slot="menuLeft"> <template slot-scope="scope" slot="menuLeft">
<el-button size="small" plain @click.stop="handleDesign()">新增入库单 <el-button size="small" plain @click.stop="handleDesign()">新增入库单
@ -12,12 +12,13 @@
</el-button> </el-button>
</template> </template>
<template slot-scope="scope" slot="caigoudanmingcheng"> <template slot-scope="scope" slot="caigoudanmingcheng">
<el-button type="text" @click.stop="purchaseFn(scope.row)" v-if="scope.row.caigoudanmingcheng!=''">{{scope.row.caigoudanmingcheng}}</el-button> <el-button type="text" @click.stop="purchaseFn(scope.row)" v-if="scope.row.caigoudanmingcheng != ''">{{
scope.row.caigoudanmingcheng }}</el-button>
<span v-else></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>
<el-button type="text" v-if="scope.row.str7==1" @click.stop="handleEdit(scope.row)">编辑</el-button> <el-button type="text" v-if="scope.row.str7 == 1" @click.stop="handleEdit(scope.row)">编辑</el-button>
</template> </template>
</avue-crud> </avue-crud>
<!-- 新增 --> <!-- 新增 -->
@ -26,12 +27,13 @@
</inDialog> </inDialog>
<!-- 采购单详情 --> <!-- 采购单详情 -->
<purchaseDialog :showDialog="purchaseOpen" v-if="purchaseOpen" @closeDialog="closeDialog" :purchaseTitle="purchaseTitle"></purchaseDialog> <purchaseDialog :showDialog="purchaseOpen" v-if="purchaseOpen" @closeDialog="closeDialog"
:purchaseTitle="purchaseTitle"></purchaseDialog>
</basic-container> </basic-container>
</template> </template>
<script> <script>
import { getList, remove } from "@/api/report/report"; import { getList } from "@/api/firstOrder/inbound";
import { mapGetters } from "vuex"; 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';
@ -70,72 +72,97 @@ export default {
gridSpan: false, gridSpan: false,
filterBtn: false, filterBtn: false,
columnBtn: false, columnBtn: false,
menuWidth:120, menuWidth: 120,
menu:true, menu: true,
column: [ column: [
{ {
label: "采购单名称", label: "采购单名称",
prop: "caigoudanmingcheng", prop: "purchaseEneInfo",
width:180, width: 180,
}, },
{ {
label: "仓库类型", label: "仓库名称",
prop: "str1", prop: "warehouseName",
}, },
{ {
label: "入库单号", label: "入库单号",
prop: "str2", prop: "orderNo",
width: 110
}, },
{ {
label: "入库时间", label: "入库日期",
prop: "str3", prop: "inDate",
search: true, search: true,
type: "date", type: "datetime",
searchRange:true, searchRange: true,
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: "结束时间", endPlaceholder: "结束时间",
format: 'yyyy-MM-DD HH:mm:ss',
valueFormat: 'yyyy-MM-DD HH:mm:ss',
width: 120,
searchParam: 'startTime',
searchEndParam: 'endTime'
}, },
{ {
label: "入库人", label: "入库人",
prop: "str4", prop: "inOperatorName",
search: true, search: true,
}, },
{ {
label: "审批人", label: "来源",
prop: "str5", prop: "source",
search: false,
},
{
label: "事由",
prop: "reason",
search: false,
}, },
{ {
label: "来源", label: "物资类型",
prop: "str6", prop: "materialType",
search: false, search: false,
type: 'select',
// dicData:[{
// label: '',
// value: '1'
// },
// {
// label: '',
// value: '2'
// }]
},
{
label: "审批人员",
prop: "approverName",
}, },
{ {
label: "审批状态", label: "状态",
prop: "str7", prop: "status",
type:'select', type: 'select',
dicData:[ // dicData:[
{ // {
label:'暂存', // label:'',
value:1 // value:1
}, // },
{ // {
label:'待审批', // label:'',
value:2 // value:1
}, // },
{ // {
label:'已审批', // label:'',
value:3 // value:2
}, // },
] // ]
}, },
] ]
}, },
data: [{ data: [{
caigoudanmingcheng:"2025年第一季度采购单", caigoudanmingcheng: "2025年第一季度采购单",
str1: '类型一', str1: '类型一',
str2: '00000001', str2: '00000001',
str3: '2025-03-01', str3: '2025-03-01',
@ -144,7 +171,7 @@ export default {
str6: '采购', str6: '采购',
str7: '1', str7: '1',
}, { }, {
caigoudanmingcheng:"2025年第二季度采购单", caigoudanmingcheng: "2025年第二季度采购单",
str1: '类型二', str1: '类型二',
str2: '00000002', str2: '00000002',
str3: '2025-03-02', str3: '2025-03-02',
@ -153,7 +180,7 @@ export default {
str6: '采购', str6: '采购',
str7: '2', str7: '2',
}, { }, {
caigoudanmingcheng:"", caigoudanmingcheng: "",
str1: '类型三', str1: '类型三',
str2: '00000002', str2: '00000002',
str3: '2025-03-02', str3: '2025-03-02',
@ -162,7 +189,7 @@ export default {
str6: '单项', str6: '单项',
str7: '3', str7: '3',
}, { }, {
caigoudanmingcheng:"", caigoudanmingcheng: "",
str1: '类型三', str1: '类型三',
str2: '00000002', str2: '00000002',
str3: '2025-03-02', str3: '2025-03-02',
@ -174,9 +201,9 @@ export default {
inDialogVisible: false, inDialogVisible: false,
inDialogTiltle: '入库', inDialogTiltle: '入库',
inDialogType: '',// inDialogType: '',//
purchaseOpen:false, purchaseOpen: false,
purchaseTitle:'', purchaseTitle: '',
inTitle:'', inTitle: '',
}; };
}, },
computed: { computed: {
@ -198,29 +225,29 @@ export default {
} }
}, },
methods: { methods: {
handleDesign() { handleDesign() {
this.inDialogVisible = true this.inDialogVisible = true
this.inDialogType = 'add' this.inDialogType = 'add'
this.inDialogTiltle = '新增入库' this.inDialogTiltle = '新增入库'
}, },
// //
handleDetails(row){ handleDetails(row) {
this.inDialogVisible = true this.inDialogVisible = true
this.inDialogType = 'details' this.inDialogType = 'details'
this.inDialogTiltle = '详情' this.inDialogTiltle = '详情'
}, },
// //
handleEdit(){ handleEdit() {
this.inDialogVisible = true this.inDialogVisible = true
this.inDialogType = 'edit' this.inDialogType = 'edit'
this.inDialogTiltle = '编辑' this.inDialogTiltle = '编辑'
}, },
// //
purchaseFn(row){ purchaseFn(row) {
this.purchaseOpen = true this.purchaseOpen = true
this.purchaseTitle = row.caigoudanmingcheng+'详情' this.purchaseTitle = row.caigoudanmingcheng + '详情'
}, },
closeDialog(){ closeDialog() {
this.purchaseOpen = false this.purchaseOpen = false
}, },
@ -287,10 +314,37 @@ export default {
refreshChange() { refreshChange() {
this.onLoad(this.page, this.query); this.onLoad(this.page, this.query);
}, },
// onLoad(page, params = {}) {
// this.loading = true;
// getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
// console.log(89122229,res.data.result)
// // const data = res.data.data;
// this.data = res.data.result.list;
// this.loading = false;
// this.page.total = res.data.result.total;
// // this.selectionClear();
// });
// }
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
const queryParams = {
this.loading = false ...params,
...this.query,
pageSize: page.pageSize,
pageNum: page.currentPage
};
if (queryParams.inDate && Array.isArray(queryParams.inDate)) {
queryParams.startTime = queryParams.inDate[0];
queryParams.endTime = queryParams.inDate[1];
delete queryParams.inDate;
}
console.log("处理后的参数:", queryParams);
getList(page.currentPage, page.pageSize, queryParams).then(res => {
this.data = res.data.result.list;
this.loading = false;
this.page.total = res.data.result.total;
});
} }
} }
}; };

@ -230,7 +230,7 @@ export default {
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)
// 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;
this.page.total = res.data.result.total; this.page.total = res.data.result.total;
// this.selectionClear(); // this.selectionClear();

@ -12,12 +12,24 @@
</el-button> </el-button>
</template> </template>
</avue-crud> --> </avue-crud> -->
<avue-crud :option="option" v-model="form" :data="data" @row-del="rowDel" @on-load="onLoad" @row-update="rowUpdate" @row-save="rowSave"></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>
<script> <script>
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { getList, add, remove, update } from "@/api/materials/list";
export default { export default {
data() { data() {
return { return {
@ -54,24 +66,41 @@ export default {
column: [ column: [
{ {
label: "物资名称", label: "物资名称",
prop: "name", prop: "materialName",
search: true, search: true,
}, },
// {
// label: "",
// prop: "ge",
// },
{ {
label: "规格/型号", label: "规格/型号",
prop: "xh", prop: "model",
}, },
{ {
label: "类别", label: "类别",
prop: "lb", prop: "materialType",
type: 'select',
dicData: [{
label: '易耗品',
value: 1
}, {
label: '耐用品',
value: 2
}],
props: {
label: 'label',
value: 'value'
},
formatter: (row, value, label, column) => {
// valuelabel
const typeMap = {
1: '易耗品',
2: '耐用品'
};
return typeMap[value] || value;
},
dataType: 'number'
}, },
{ {
label: "单位", label: "单位",
prop: "dj", prop: "unit",
}, },
] ]
}, },
@ -131,7 +160,6 @@ export default {
this.tableData = this.bfTable this.tableData = this.bfTable
} }
}, },
searchReset() { searchReset() {
this.query = {}; this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
@ -159,41 +187,47 @@ export default {
refreshChange() { refreshChange() {
this.onLoad(this.page, this.query); this.onLoad(this.page, this.query);
}, },
//
rowSave(row, done, loading) { rowSave(row, done, loading) {
// add(row).then(() => { add(row).then(() => {
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功!" message: "操作成功!"
}); });
done(); done();
// }, error => { }, error => {
// window.console.log(error); window.console.log(error);
// loading(); loading();
// }); });
},
rowUpdate(row, index, done, loading){
debugger
// update(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
// }, error => {
// window.console.log(error);
loading();
// });
}, },
rowDel(row) { //
rowUpdate(row, index, done, loading) {
update(row).then(() => {
this.onLoad(this.page)
this.$message({
type: "success",
message: "操作成功!"
})
done(row)
},error => {
window.console.log(error);
loading();
})
},
//
rowDel(row, index, done) {
this.$confirm("确定将选择数据删除?", { this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
return remove(row.id); return remove(row.id.toString());
}) })
.then(() => { .then(() => {
this.onLoad(this.page); this.onLoad(this.page);
@ -201,40 +235,50 @@ export default {
type: "success", type: "success",
message: "操作成功!" message: "操作成功!"
}); });
done();
})
.catch(action => {
if (action !== 'cancel') {
this.$message({
type: "error",
message: "操作失败"
});
}
}); });
},
remove(){
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
this.data.push({ // this.data.push({
no: '00100001', // no: '00100001',
name: '物资1', // name: '1',
xh: '1', // xh: '1',
lb: '易耗品', // lb: '',
unit: '11', // unit: '11',
number: '1', // number: '1',
dj: '11', // dj: '11',
pice: '11' // pice: '11'
}, { // }, {
no: '00100002', // no: '00100002',
name: '物资2', // name: '2',
xh: '2', // xh: '2',
lb: '耐用品', // lb: '',
unit: '22', // unit: '22',
number: '2', // number: '2',
dj: '11', // dj: '11',
pice: '22' // pice: '22'
}) // })
this.loading = false
//
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
// const data = res.data.data;
//
this.data = res.data.result.list; //
this.loading = false
this.page.total = res.data.result.total; //
// this.selectionClear();
});
this.loading = false this.loading = false
// getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
// const data = res.data.data;
// this.page.total = data.total;
// this.data = data.records;
// this.loading = false;
// this.selectionClear();
// });
} }
} }
}; };

@ -4,7 +4,7 @@
<avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page" <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page"
:permission="permissionList" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" :permission="permissionList" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad"> @refresh-change="refreshChange" @on-load="onLoad" >
<template slot-scope="scope" slot="menu"> <template slot-scope="scope" slot="menu">
</template> </template>
@ -13,7 +13,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getList, remove } from "@/api/report/report"; import { getList } from "@/api/purchaseOrders/index";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
export default { export default {
@ -51,28 +51,32 @@ export default {
column: [ column: [
{ {
label: "采购单号", label: "采购单号",
prop: "no", prop: "purchaseNo",
search: true, search: true,
}, },
{ {
label: "采购时间", label: "物资Id",
prop: "name", prop: "materialId",
}, },
{ {
label: "物品名称", label: "规格型号",
prop: "number", prop: "model",
}, },
{ {
label: "型号", label: "类别",
prop: "number", prop: "type",
},
{
label: "单位",
prop: "unit",
}, },
{ {
label: "数量", label: "数量",
prop: "number", prop: "num",
}, },
{ {
label: "金额", label: "金额",
prop: "pice", prop: "money",
} }
] ]
}, },
@ -81,18 +85,18 @@ export default {
activeName: 'first', activeName: 'first',
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: ''},
], // ],
}; };
}, },
computed: { computed: {
@ -162,33 +166,33 @@ export default {
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
this.data.push({ // this.data.push({
no: '00100001', // no: '00100001',
name: '物品1', // name: '1',
xh: '1', // xh: '1',
lb: '易耗品', // lb: '',
unit: '11', // unit: '11',
number: '1', // number: '1',
dj: '11', // dj: '11',
pice: '11' // pice: '11'
}, { // }, {
no: '00100002', // no: '00100002',
name: '物品2', // name: '2',
xh: '2', // xh: '2',
lb: '耐用品', // lb: '',
unit: '22', // unit: '22',
number: '2', // number: '2',
dj: '11', // dj: '11',
pice: '22' // pice: '22'
}) // })
this.loading = false 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 => {
// const data = res.data.data; console.log(898989,res.data.result)
// this.page.total = data.total; this.data = res.data.result.list;
// this.data = data.records; this.loading = false;
// this.loading = false; this.page.total = res.data.result.total;
// this.selectionClear(); // this.selectionClear();
// }); });
} }
} }
}; };

Loading…
Cancel
Save