|
@@ -1,95 +1,47 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" label-width="68px">
|
|
|
- <el-row >
|
|
|
- <el-col :span="18">
|
|
|
- <el-form-item label="来源单据">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.source"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="btnQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="客户">
|
|
|
- <DrPopoverSelectV2
|
|
|
- size="mini"
|
|
|
- v-model="queryParams.customerName"
|
|
|
- valueKey= "name"
|
|
|
- referName="CUSTOMER_PARAM"
|
|
|
- :dataMapping="{
|
|
|
- customer: 'id',
|
|
|
- customerName: 'name',
|
|
|
- }"
|
|
|
- :source.sync="queryParams"
|
|
|
- >
|
|
|
- </DrPopoverSelectV2>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="物料">
|
|
|
- <DrPopoverSelectV2
|
|
|
- size="mini"
|
|
|
- v-model="queryParams.materialName"
|
|
|
- valueKey= "name"
|
|
|
- referName="MATERIAL_PARAM"
|
|
|
- :dataMapping="{
|
|
|
- material: 'id',
|
|
|
- materialName: 'name',
|
|
|
- }"
|
|
|
- :source.sync="queryParams"
|
|
|
- >
|
|
|
- </DrPopoverSelectV2>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item style="float:right">
|
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="btnQuery">搜索</el-button>
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="btnResetQuery">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
+ <el-card
|
|
|
+ v-loading="loading"
|
|
|
+ :body-style="{
|
|
|
+ height: '100%',
|
|
|
+ padding: 0,
|
|
|
+ display: 'flex',
|
|
|
+ 'flex-direction': 'column',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-super-search
|
|
|
+ v-model="params"
|
|
|
+ :size="size"
|
|
|
+ :dict="dict"
|
|
|
+ :columns="SearchColumns"
|
|
|
+ @reset="btnResetQuery"
|
|
|
+ @submit="getList(params, page)"
|
|
|
+ ></el-super-search>
|
|
|
|
|
|
- <el-table
|
|
|
- size="mini"
|
|
|
- v-loading="loading"
|
|
|
- :data="list"
|
|
|
- height="500px"
|
|
|
+ <el-super-ux-table
|
|
|
+ v-model="list"
|
|
|
+ :size="size"
|
|
|
+ :dict="dict"
|
|
|
+ :page="page"
|
|
|
+ :columns="TableColumns"
|
|
|
+ index
|
|
|
+ pagination
|
|
|
+ highlight-current-row
|
|
|
+ storage-key="ownerShipSuperTable"
|
|
|
+ @pagination="getList({ ...page, ...params })"
|
|
|
+ style="margin: 16px 0 0"
|
|
|
>
|
|
|
- <el-table-column label="序号" type="index" width="50" align="center" fixed/>
|
|
|
- <el-table-column show-overflow-tooltip width="200" label="来源单据" align="center" prop="source" />
|
|
|
- <el-table-column show-overflow-tooltip width="200" label="客户" align="center" prop="customerName" />、
|
|
|
- <el-table-column show-overflow-tooltip width="150" label="仓库" align="center" prop="warehouseName" />
|
|
|
- <el-table-column show-overflow-tooltip width="150" label="物料编码" align="center" prop="materialCode" />
|
|
|
- <el-table-column show-overflow-tooltip width="300" label="物料" align="center" prop="materialName" />
|
|
|
- <el-table-column show-overflow-tooltip width="150" label="可用量" align="center" prop="qty" />
|
|
|
- <el-table-column show-overflow-tooltip width="150" label="已用量" align="center" prop="usedQty" />
|
|
|
- <el-table-column show-overflow-tooltip width="150" label="预留数量" align="center" prop="reservedQty" />
|
|
|
- <el-table-column show-overflow-tooltip width="150" label="创建时间" align="center" prop="createTime" />
|
|
|
- <el-table-column
|
|
|
- width="250"
|
|
|
- label="操作"
|
|
|
- fixed="right"
|
|
|
- align="center"
|
|
|
- class-name="small-padding fixed-width"
|
|
|
- >
|
|
|
+ <ux-table-column fixed="right" title="操作" align="center" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
- size="mini"
|
|
|
+ :size="size"
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="btnUpdate(scope.row)"
|
|
|
- >修改</el-button>
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div class="paginationClass">
|
|
|
- <pagination
|
|
|
- v-show="total > 0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
- </div>
|
|
|
+ </ux-table-column>
|
|
|
+ </el-super-ux-table>
|
|
|
|
|
|
<!-- 添加或修改任务对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
|
|
@@ -135,26 +87,36 @@
|
|
|
</el-super-form> -->
|
|
|
|
|
|
<div slot="footer">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- @click="submitForm"
|
|
|
- v-loading="dialogLoading"
|
|
|
+ <el-button :size="size" type="primary" @click="submitForm"
|
|
|
>确 定</el-button
|
|
|
>
|
|
|
- <el-button size="mini" @click="cancel" v-loading="dialogLoading">取 消</el-button>
|
|
|
+ <el-button :size="size" @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- </div>
|
|
|
+ </el-card>
|
|
|
</template>
|
|
|
|
|
|
-
|
|
|
<script>
|
|
|
-import {materialList,getDetail,update} from '@/api/purchase/ownership.js'
|
|
|
-
|
|
|
+import { materialList, getDetail, update } from "@/api/purchase/ownership.js";
|
|
|
+import useColumns from "./columns";
|
|
|
+import { dicts } from "./dicts";
|
|
|
export default {
|
|
|
+ name: "ownerShip",
|
|
|
+ dicts: [...dicts],
|
|
|
+ components: {
|
|
|
+ ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
|
|
|
+ ElSuperSearch: () => import("@/components/super-search/index.vue"),
|
|
|
+ },
|
|
|
data() {
|
|
|
+ const { SearchColumns, TableColumns } = useColumns();
|
|
|
+ const params = this.$init.params(SearchColumns);
|
|
|
+ const page = this.$init.page();
|
|
|
return {
|
|
|
+ size: "mini",
|
|
|
+ SearchColumns,
|
|
|
+ TableColumns,
|
|
|
+ params,
|
|
|
+ page,
|
|
|
// 遮罩层
|
|
|
loading: false,
|
|
|
// 遮罩层
|
|
@@ -167,19 +129,8 @@ export default {
|
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
- // 查询参数
|
|
|
- queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- source: null,
|
|
|
- customer: null,
|
|
|
- customerName: null,
|
|
|
- material: null,
|
|
|
- materialName: null,
|
|
|
- },
|
|
|
// 表单参数
|
|
|
- form: {
|
|
|
- },
|
|
|
+ form: {},
|
|
|
//oldQty
|
|
|
oldQty: 0,
|
|
|
};
|
|
@@ -189,9 +140,12 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
/** 查询任务列表 */
|
|
|
- getList() {
|
|
|
+ getList(params, page) {
|
|
|
this.loading = true;
|
|
|
- materialList(this.queryParams).then(response => {
|
|
|
+ materialList({
|
|
|
+ ...params,
|
|
|
+ ...page,
|
|
|
+ }).then((response) => {
|
|
|
this.list = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
@@ -232,24 +186,10 @@ export default {
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
- /** 搜索按钮操作 */
|
|
|
- btnQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
/** 重置按钮操作 */
|
|
|
btnResetQuery() {
|
|
|
- // this.resetForm("queryForm");
|
|
|
- this.queryParams = {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- source: null,
|
|
|
- customer: null,
|
|
|
- customerName: null,
|
|
|
- material: null,
|
|
|
- materialName: null,
|
|
|
- };
|
|
|
- this.btnQuery();
|
|
|
+ this.params = this.$init.params(this.SearchColumns);
|
|
|
+ this.page = this.$init.page();
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
btnUpdate(row) {
|
|
@@ -257,9 +197,9 @@ export default {
|
|
|
this.reset();
|
|
|
this.form.source = row.source;
|
|
|
this.form.customerName = row.customerName;
|
|
|
- const id = row.id || this.ids
|
|
|
- getDetail(id).then(response => {
|
|
|
- this.form = {...this.form,...response.data};
|
|
|
+ const id = row.id || this.ids;
|
|
|
+ getDetail(id).then((response) => {
|
|
|
+ this.form = { ...this.form, ...response.data };
|
|
|
this.open = true;
|
|
|
this.title = "修改预留";
|
|
|
this.oldQty = this.form.qty || 0;
|
|
@@ -276,29 +216,28 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
//值改变后
|
|
|
- useFormQtyChange(val){
|
|
|
+ useFormQtyChange(val) {
|
|
|
let cha = val - this.oldQty;
|
|
|
this.form.usedQty = this.form.usedQty - cha;
|
|
|
this.oldQty = val;
|
|
|
},
|
|
|
- }
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
-.btn_grooup {
|
|
|
- margin-bottom: 10px;
|
|
|
- display: flex;
|
|
|
- justify-content: flex-end;
|
|
|
+<style scoped lang="scss">
|
|
|
+.el-card {
|
|
|
+ width: calc(100% - 32px);
|
|
|
+ height: calc(100vh - 32px);
|
|
|
+ margin: 16px;
|
|
|
+ padding: 16px;
|
|
|
+ border-radius: 8px;
|
|
|
+ overflow-y: auto;
|
|
|
+ overflow-x: hidden;
|
|
|
}
|
|
|
-.paginationClass {
|
|
|
- z-index: 500;
|
|
|
- position: fixed;
|
|
|
- bottom: 10px;
|
|
|
- right: 10px;
|
|
|
- width: 100%;
|
|
|
- line-height: var(--footer-height);
|
|
|
- color: #fff;
|
|
|
+
|
|
|
+.el-button-group + .el-button-group {
|
|
|
+ margin: 0 0 0 8px;
|
|
|
}
|
|
|
|
|
|
</style>
|