页面样式调整

master
taozi 3 months ago
parent 9f67ac2f03
commit 2c06b569c9
  1. 22
      src/api/firstOrder/list.js
  2. 3
      src/views/authority/role.vue
  3. 179
      src/views/firstOrder/components/recordDialog.vue
  4. 147
      src/views/firstOrder/list.vue
  5. 25
      src/views/materials/expend.vue
  6. 18
      src/views/secondOrder/components/recordDialog.vue
  7. 1
      src/views/secondOrder/list.vue
  8. 2
      src/views/secondOrder/outbound.vue

@ -13,15 +13,25 @@ export const getList = (current, size, params) => {
cryptoData: false cryptoData: false
}) })
} }
export const recordList = (current, size, params) => { // export const recordList = (current, size, params) => {
// return request({
// url: '/smartpark/inventoryRecord/list',
// method: 'get',
// params: {
// ...params,
// pageSize:size,
// pageNum:current,
// },
// cryptoToken: false,
// cryptoData: false
// })
// }
export const recordList = ( params) => {
console.log(params,'api')
return request({ return request({
url: '/smartpark/inventoryRecord/list', url: '/smartpark/inventoryRecord/list',
method: 'get', method: 'get',
params: { params: params,
...params,
pageSize:size,
pageNum:current,
},
cryptoToken: false, cryptoToken: false,
cryptoData: false cryptoData: false
}) })

@ -158,7 +158,7 @@ export default {
editBtn: false, // editBtn: false, //
delBtn: false, // delBtn: false, //
labelWidth: 120, labelWidth: 120,
searchLabelWidth: 120, searchLabelWidth: 80,
menuWidth: 350, menuWidth: 350,
dialogWidth: 600, dialogWidth: 600,
dialogClickModal: false, dialogClickModal: false,
@ -285,6 +285,7 @@ export default {
}, },
], ],
}, },
], ],
}, },
data: [], data: [],

@ -0,0 +1,179 @@
<template>
<el-dialog
:title="purchaseTitle"
append-to-body
:visible.sync="openShow"
width="50%"
@close="closeDialog"
:style="{ height: '600px' }"
>
<el-tabs v-model="transactionType" @tab-click="handleTabClick">
<el-tab-pane label="入库" name="2"></el-tab-pane>
<el-tab-pane label="出库" name="1"></el-tab-pane>
</el-tabs>
<avue-crud
:data="data"
:option="dynamicOption"
v-model:page="page"
@on-load="onLoad"
@current-change="currentChange"
@size-change="sizeChange"
@search-change="searchChange"
@search-reset="searchReset"
:page.sync="page"
></avue-crud>
</el-dialog>
</template>
<script>
import { recordList } from "@/api/firstOrder/list";
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
rowData: {
type: Object,
default: () => ({}),
},
},
data() {
return {
openShow: false,
transactionType: "1",
tableData: [],
purchaseTitle: "记录",
data: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0,
},
loading: false,
query: {},
};
},
computed: {
dynamicOption() {
const showPriceColumn = this.rowData.type === 'NY' && this.transactionType === '1';
const columns = [
{
label: "数量",
prop: "quantity",
hide: false,
},
{
label: "操作人",
prop: "operatorName",
hide: false,
},
{
label: "时间",
prop: "operationTime",
type: "date",
format: "yyyy-MM-dd HH:mm:ss",
valueFormat: "yyyy-MM-dd HH:mm:ss",
hide: false,
},
{
label: "部门",
prop: "departmentName",
hide: false,
},
{
label: "单价",
prop: "money",
hide: !showPriceColumn,
},
];
return {
header: false,
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 6,
border: true,
index: true,
selection: false,
viewBtn: false,
addBtn: false,
editBtn: false,
delBtn: false,
dialogClickModal: false,
menu: false,
printBtn: false,
refreshBtn: false,
gridBtn: false,
gridBackgroundImage: false,
gridSpan: false,
filterBtn: false,
columnBtn: false,
menuAlign: "left",
searchMenuPosition: "right",
column: columns,
};
}
},
mounted() {
this.openShow = this.showDialog;
console.log("一级出入库记录 rowData", this.rowData);
},
methods: {
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
handleTabClick() {
this.tableData = [];
this.page.currentPage = 1;
this.onLoad(this.page);
},
closeDialog() {
this.openShow = false;
this.$emit("closeDialog");
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
this.onLoad(this.page);
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad(this.page);
},
onLoad(page, params = {}) {
this.loading = true;
const query_ = {
oneFromId: this.rowData.id,
transactionType: this.transactionType,
currentPage: page.currentPage,
pageSize: page.pageSize,
...params,
};
console.log("query_", query_);
recordList(query_)
.then((res) => {
this.data = res.data.result.list;
this.page.total = res.data.result.total;
})
.finally(() => {
this.loading = false;
});
},
},
};
</script>

@ -5,52 +5,32 @@
: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">
<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" <recordDialog v-if="recordShow" :showDialog="recordShow" @closeDialog="closeDialog" :rowData="rowData">
:append-to-body="true" > </recordDialog>
<el-tabs v-model="transactionType" @tab-click="handleTabClick">
<el-tab-pane label="入库" name="1"></el-tab-pane>
<el-tab-pane label="出库" name="2"></el-tab-pane>
</el-tabs>
<el-table :data="tableData" style="width: 100%">
<el-table-column type="index" width="50"> </el-table-column>
<el-table-column prop="quantity" label="数量">
</el-table-column>
<el-table-column prop="money" label="单价" v-if="transactionType === '1' && currentRow && currentRow.type === 'NY'">
</el-table-column>
<el-table-column prop="operatorName" label="操作人" >
</el-table-column>
<el-table-column prop="operationTime" label="时间" :formatter="formatTime" width="200">
</el-table-column>
<el-table-column prop="departmentName" label="部门"> </el-table-column>
</el-table>
<div style="margin-top: 10px; text-align: right;">
<el-pagination
background
@size-change="handleLogSizeChange"
@current-change="handleLogCurrentChange"
:current-page="logPage.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="logPage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="logPage.total"
></el-pagination>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import recordDialog from "./components/recordDialog.vue";
import { getList, recordList } from "@/api/firstOrder/list"; import { getList, recordList } from "@/api/firstOrder/list";
export default { export default {
components: {
recordDialog,
},
data() { data() {
return { return {
rowData: {}, //
recordShow: false, //
form: {}, form: {},
selectionList: [], selectionList: [],
query: {}, query: {},
@ -204,93 +184,40 @@ export default {
this.tableData = []; this.tableData = [];
}, },
methods: { methods: {
formatTime(row, column, cellValue) { //
if (!cellValue) return ''; closeDialog() {
const date = new Date(cellValue); this.recordShow = false;
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
async handleLog(row) {
this.dialogLogVisible = true;
this.currentRow = row;
this.logPage.currentPage = 1;
this.loadTransactionData();
}, },
handleLog(row) {
handleTabClick() { console.log(228998)
this.logPage.currentPage = 1 this.recordShow = true;
this.loadTransactionData(); this.rowData = row;
console.log(22298766)
}, },
// async loadTransactionData() { formatTime(row, column, cellValue) {
// if (!this.currentRow) return; if (!cellValue) return '';
// const params = { const date = new Date(cellValue);
// oneFromId: this.currentRow.id, const year = date.getFullYear();
// transactionType: this.transactionType const month = String(date.getMonth() + 1).padStart(2, '0');
// }; const day = String(date.getDate()).padStart(2, '0');
// const pageNum = this.page.currentPage; const hours = String(date.getHours()).padStart(2, '0');
// const pageSize = this.page.pageSize; const minutes = String(date.getMinutes()).padStart(2, '0');
// this.loading = true; const seconds = String(date.getSeconds()).padStart(2, '0');
// try { return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
// const res = await recordList(
// pageNum,
// pageSize,
// 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;
// } catch (error) {
// this.$message.error(error.message);
// } finally {
// this.loading = false;
// }
// },
async loadTransactionData() {
if (!this.currentRow) return;
const params = {
oneFromId: this.currentRow.id,
transactionType: this.transactionType
};
const pageNum = this.logPage.currentPage;
const pageSize = this.logPage.pageSize;
this.loading = true;
try {
const res = await recordList(
pageNum,
pageSize,
Object.assign({}, this.query, params)
);
this.logPage.total = res.data.result.total;
if (this.transactionType === "1") {
this.ckTable = res.data.result.list;
} else {
this.rkTable = res.data.result.list;
}
this.tableData = res.data.result.list;
} catch (error) {
this.$message.error(error.message);
} finally {
this.loading = false;
}
}, },
handleLogSizeChange(pageSize) { handleLogSizeChange(pageSize) {
this.logPage.pageSize = pageSize; this.logPage.pageSize = pageSize;
this.logPage.currentPage = 1; // this.logPage.currentPage = 1; //
this.loadTransactionData();
}, },
// //
handleLogCurrentChange(currentPage) { handleLogCurrentChange(currentPage) {
this.logPage.currentPage = currentPage; this.logPage.currentPage = currentPage;
this.loadTransactionData();
}, },
searchReset() { searchReset() {
this.query = {}; this.query = {};
@ -338,4 +265,4 @@ export default {
}; };
</script> </script>
<style></style> <style lang="scss" scoped></style>

@ -88,10 +88,10 @@ export default {
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: true,
searchMenuSpan: 12, searchMenuSpan: 18,
border: true, border: true,
index: true, index: true,
selection: true, // selection: true,
viewBtn: false, viewBtn: false,
addBtn: false, addBtn: false,
editBtn: false, editBtn: false,
@ -108,7 +108,7 @@ export default {
columnBtn: false, columnBtn: false,
menuAlign: "left", menuAlign: "left",
searchMenuPosition: "right", searchMenuPosition: "right",
menuWidth: 100, menuWidth: 140,
column: [ column: [
{ {
label: "编号", label: "编号",
@ -116,30 +116,13 @@ export default {
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
}, },
// {
// label: "",
// prop: "str8",
// search: true,
// type: "select",
// headerAlign: "center",
// align: "center",
// dicData: [
// {
// label: "",
// value: 0,
// },
// {
// label: "",
// value: 1,
// },
// ],
// },
{ {
label: "名称", label: "名称",
prop: "materialName", prop: "materialName",
search: true, search: true,
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
searchLabelWidth: 50
}, },
{ {
label: "规格型号", label: "规格型号",

@ -18,6 +18,10 @@
@on-load="onLoad" @on-load="onLoad"
@current-change="currentChange" @current-change="currentChange"
@size-change="sizeChange" @size-change="sizeChange"
@search-change="searchChange"
@search-reset="searchReset"
:page.sync="page"
></avue-crud> ></avue-crud>
</el-dialog> </el-dialog>
</template> </template>
@ -79,7 +83,7 @@ export default {
label: "数量", label: "数量",
prop: "quantity", prop: "quantity",
}, },
{ {
label: "单价", label: "单价",
prop: "money", prop: "money",
}, },
@ -104,7 +108,17 @@ export default {
console.log("二级出入库记录 rowData", this.rowData); console.log("二级出入库记录 rowData", this.rowData);
}, },
methods: { methods: {
handleTabClick() { searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
},
searchReset() {
this.query = {};
this.onLoad(this.page);
},
handleTabClick() {
this.tableData = []; this.tableData = [];
let query_ = {}; let query_ = {};
this.page.currentPage = 1 this.page.currentPage = 1

@ -86,6 +86,7 @@ export default {
search: true, search: true,
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
searchLabelWidth: 50
}, },
{ {
label: "存货编号", label: "存货编号",

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

Loading…
Cancel
Save