代码提交

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

@ -12,12 +12,24 @@
</el-button>
</template>
</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>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import { getList, add, remove, update } from "@/api/materials/list";
export default {
data() {
return {
@ -54,24 +66,41 @@ export default {
column: [
{
label: "物资名称",
prop: "name",
prop: "materialName",
search: true,
},
// {
// label: "",
// prop: "ge",
// },
{
label: "规格/型号",
prop: "xh",
prop: "model",
},
{
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: "单位",
prop: "dj",
prop: "unit",
},
]
},
@ -131,7 +160,6 @@ export default {
this.tableData = this.bfTable
}
},
searchReset() {
this.query = {};
this.onLoad(this.page);
@ -159,41 +187,47 @@ export default {
refreshChange() {
this.onLoad(this.page, this.query);
},
//
rowSave(row, done, loading) {
// add(row).then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
// }, error => {
// window.console.log(error);
// 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();
// });
add(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("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
return remove(row.id.toString());
})
.then(() => {
this.onLoad(this.page);
@ -201,40 +235,50 @@ export default {
type: "success",
message: "操作成功!"
});
done();
})
.catch(action => {
if (action !== 'cancel') {
this.$message({
type: "error",
message: "操作失败"
});
}
});
},
remove(){
},
onLoad(page, params = {}) {
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.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 => {
// 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
// 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"
: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">
@refresh-change="refreshChange" @on-load="onLoad" >
<template slot-scope="scope" slot="menu">
</template>
@ -13,7 +13,7 @@
</div>
</template>
<script>
import { getList, remove } from "@/api/report/report";
import { getList } from "@/api/purchaseOrders/index";
import { mapGetters } from "vuex";
export default {
@ -51,28 +51,32 @@ export default {
column: [
{
label: "采购单号",
prop: "no",
prop: "purchaseNo",
search: true,
},
{
label: "采购时间",
prop: "name",
label: "物资Id",
prop: "materialId",
},
{
label: "物品名称",
prop: "number",
label: "规格型号",
prop: "model",
},
{
label: "型号",
prop: "number",
label: "类别",
prop: "type",
},
{
label: "单位",
prop: "unit",
},
{
label: "数量",
prop: "number",
prop: "num",
},
{
label: "金额",
prop: "pice",
prop: "money",
}
]
},
@ -81,18 +85,18 @@ export default {
activeName: 'first',
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: '部门三'},
],
// 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: {
@ -162,33 +166,33 @@ export default {
},
onLoad(page, params = {}) {
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.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 => {
// const data = res.data.data;
// this.page.total = data.total;
// this.data = data.records;
// this.loading = false;
// this.selectionClear();
// });
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
console.log(898989,res.data.result)
this.data = res.data.result.list;
this.loading = false;
this.page.total = res.data.result.total;
// this.selectionClear();
});
}
}
};

Loading…
Cancel
Save