页面样式调整

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
})
}
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({
url: '/smartpark/inventoryRecord/list',
method: 'get',
params: {
...params,
pageSize:size,
pageNum:current,
},
params: params,
cryptoToken: false,
cryptoData: false
})

@ -158,7 +158,7 @@ export default {
editBtn: false, //
delBtn: false, //
labelWidth: 120,
searchLabelWidth: 120,
searchLabelWidth: 80,
menuWidth: 350,
dialogWidth: 600,
dialogClickModal: false,
@ -285,6 +285,7 @@ export default {
},
],
},
],
},
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"
@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="handleLog(scope.row)">记录
</el-button>
</template>
</avue-crud>
</basic-container>
<!-- 记录弹窗 -->
<el-dialog title="记录" :visible.sync="dialogLogVisible" width="50%" :close-on-click-modal="false"
:append-to-body="true" >
<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>
<!-- 记录 -->
<recordDialog v-if="recordShow" :showDialog="recordShow" @closeDialog="closeDialog" :rowData="rowData">
</recordDialog>
</div>
</template>
<script>
import recordDialog from "./components/recordDialog.vue";
import { getList, recordList } from "@/api/firstOrder/list";
export default {
components: {
recordDialog,
},
data() {
return {
rowData: {}, //
recordShow: false, //
form: {},
selectionList: [],
query: {},
@ -204,93 +184,40 @@ export default {
this.tableData = [];
},
methods: {
formatTime(row, column, cellValue) {
if (!cellValue) return '';
const date = new Date(cellValue);
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();
//
closeDialog() {
this.recordShow = false;
},
handleTabClick() {
this.logPage.currentPage = 1
this.loadTransactionData();
handleLog(row) {
console.log(228998)
this.recordShow = true;
this.rowData = row;
console.log(22298766)
},
// async loadTransactionData() {
// if (!this.currentRow) return;
// const params = {
// oneFromId: this.currentRow.id,
// transactionType: this.transactionType
// };
// const pageNum = this.page.currentPage;
// const pageSize = this.page.pageSize;
// this.loading = true;
// try {
// 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;
}
formatTime(row, column, cellValue) {
if (!cellValue) return '';
const date = new Date(cellValue);
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}`;
},
handleLogSizeChange(pageSize) {
this.logPage.pageSize = pageSize;
this.logPage.currentPage = 1; //
this.loadTransactionData();
},
//
handleLogCurrentChange(currentPage) {
this.logPage.currentPage = currentPage;
this.loadTransactionData();
},
searchReset() {
this.query = {};
@ -338,4 +265,4 @@ export default {
};
</script>
<style></style>
<style lang="scss" scoped></style>

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

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

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

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

Loading…
Cancel
Save