|
@@ -5,11 +5,11 @@
|
|
|
:search.sync="search" @search-change="searchChange" @current-change="currentChange"
|
|
|
@size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading"
|
|
|
@saveColumn="saveColumn" @resetColumn="resetColumn" :cell-style="cellStyle"
|
|
|
- @selection-change="selectionChange" @search-criteria-switch="searchCriteriaSwitch">
|
|
|
- <!-- <template slot="menuLeft">
|
|
|
+ @search-criteria-switch="searchCriteriaSwitch">
|
|
|
+ <template slot="menuLeft">
|
|
|
<el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newAdd()">创建单据
|
|
|
</el-button>
|
|
|
- </template> -->
|
|
|
+ </template>
|
|
|
<template slot-scope="{ row,index}" slot="menu">
|
|
|
<el-button type="text" icon="el-icon-delete" size="small" @click.stop="rowDel(row, index)">删除
|
|
|
</el-button>
|
|
@@ -19,13 +19,7 @@
|
|
|
end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd">
|
|
|
</el-date-picker>
|
|
|
</template>
|
|
|
- <template slot="purchaserIdSearch">
|
|
|
- <crop-select v-model="search.purchaserId" corpType="KH" :refresh="false"></crop-select>
|
|
|
- </template>
|
|
|
- <template slot="corpIdSearch">
|
|
|
- <crop-select v-model="search.corpId" corpType="GYS" :refresh="false"></crop-select>
|
|
|
- </template>
|
|
|
- <template slot-scope="{ row,index}" slot="purchaserId">
|
|
|
+ <template slot-scope="{ row,index}" slot="sysNo">
|
|
|
<span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 1)">{{ row.purchaser }}
|
|
|
</span>
|
|
|
</template>
|
|
@@ -35,6 +29,28 @@
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
+ <el-dialog title="入库列表页" :visible.sync="inStockVisible" width="70%" @close="close" append-to-body>
|
|
|
+ <span>
|
|
|
+ <avue-crud ref="crud2" v-model="form2" :data="itemData" :option="itemOption" :page.sync="page2" :search.sync="search2"
|
|
|
+ @search-change="searchChange2" @current-change="currentChange2" @size-change="sizeChange2"
|
|
|
+ @refresh-change="refreshChange2" @on-load="onLoad2" :table-loading="loading2"
|
|
|
+ :cell-style="cellStyle" @selection-change="selectionChange"
|
|
|
+ @search-criteria-switch="searchCriteriaSwitch2">
|
|
|
+ <template slot-scope="{ row,index}" slot="purchaserId">
|
|
|
+ <span>{{ row.purchaser }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row,index}" slot="corpId">
|
|
|
+ <span>{{ row.corpName }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </span>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="inStockVisible= false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="generate">生 成</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
<detail-page @goBack="goBack" :detailData="detailData" v-if="!show"></detail-page>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -42,26 +58,39 @@
|
|
|
<script>
|
|
|
import { getList, remove, getStoragetree } from "@/api/purchasingManagement/inStock";
|
|
|
import option from "./config/mainList.json";
|
|
|
+import itemOption from "./config/mainList2.json";
|
|
|
import detailPage from "./detailsPage";
|
|
|
import _ from "lodash";
|
|
|
export default {
|
|
|
name: "instock",
|
|
|
data() {
|
|
|
return {
|
|
|
+ itemOption: itemOption,
|
|
|
search: {},
|
|
|
+ search2: {},
|
|
|
form: {},
|
|
|
+ form2:{},
|
|
|
option: {},
|
|
|
dataList: [],
|
|
|
+ itemData: [],
|
|
|
page: {
|
|
|
pageSize: 20,
|
|
|
currentPage: 1,
|
|
|
total: 0,
|
|
|
pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
|
},
|
|
|
+ page2: {
|
|
|
+ pageSize: 20,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0,
|
|
|
+ pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
|
+ },
|
|
|
show: true,
|
|
|
detailData: {},
|
|
|
loading: false,
|
|
|
+ loading2: false,
|
|
|
searchShow: true,
|
|
|
+ inStockVisible: false,
|
|
|
selectionList: [],
|
|
|
};
|
|
|
},
|
|
@@ -69,6 +98,7 @@ export default {
|
|
|
async created() {
|
|
|
this.option = await this.getColumnData(this.getColumnName(190), option);
|
|
|
this.option.height = window.innerHeight - 210;
|
|
|
+ this.itemOption.height = window.innerHeight - 410;
|
|
|
this.getWorkDicts("approval_status").then(res => {
|
|
|
this.findObject(this.option.column, "status").dicData =
|
|
|
res.data.data;
|
|
@@ -81,6 +111,18 @@ export default {
|
|
|
this.findObject(this.option.column, "storageId").dicData =
|
|
|
res.data.data;
|
|
|
})
|
|
|
+ this.getWorkDicts("approval_status").then(res => {
|
|
|
+ this.findObject(this.itemOption.column, "status").dicData =
|
|
|
+ res.data.data;
|
|
|
+ });
|
|
|
+ this.getWorkDicts("CMY_business_type").then(res => {
|
|
|
+ this.findObject(this.itemOption.column, "businessType").dicData =
|
|
|
+ res.data.data;
|
|
|
+ });
|
|
|
+ getStoragetree().then(res => {
|
|
|
+ this.findObject(this.itemOption.column, "storageId").dicData =
|
|
|
+ res.data.data;
|
|
|
+ })
|
|
|
},
|
|
|
activated() {
|
|
|
console.log(this.show)
|
|
@@ -100,6 +142,14 @@ export default {
|
|
|
}
|
|
|
this.$refs.crud.getTableHeight();
|
|
|
},
|
|
|
+ searchCriteriaSwitch2(type) {
|
|
|
+ if (type) {
|
|
|
+ this.itemOption.height = this.itemOption.height - 191;
|
|
|
+ } else {
|
|
|
+ this.itemOption.height = this.itemOption.height + 191;
|
|
|
+ }
|
|
|
+ this.$refs.crud2.getTableHeight();
|
|
|
+ },
|
|
|
cellStyle() {
|
|
|
return "padding:0;height:40px;";
|
|
|
},
|
|
@@ -124,6 +174,17 @@ export default {
|
|
|
selectionChange(list) {
|
|
|
this.selectionList = list;
|
|
|
},
|
|
|
+ generate() {
|
|
|
+ if (this.selectionList.length == 1) {
|
|
|
+ this.detailData = {
|
|
|
+ generateId: this.selectionList[0].id,
|
|
|
+ }
|
|
|
+ this.show = false
|
|
|
+ this.inStockVisible = false
|
|
|
+ } else {
|
|
|
+ this.$message.error('请选择一条数据')
|
|
|
+ }
|
|
|
+ },
|
|
|
editOpen(row, status) {
|
|
|
this.detailData = {
|
|
|
id: row.id,
|
|
@@ -137,16 +198,28 @@ export default {
|
|
|
this.onLoad(this.page, params);
|
|
|
done();
|
|
|
},
|
|
|
+ searchChange2(params, done) {
|
|
|
+ this.page2.currentPage = 1;
|
|
|
+ this.onLoad2(this.page, params);
|
|
|
+ done();
|
|
|
+ },
|
|
|
currentChange(val) {
|
|
|
this.page.currentPage = val;
|
|
|
},
|
|
|
+ currentChange2(val) {
|
|
|
+ this.page2.currentPage = val;
|
|
|
+ },
|
|
|
sizeChange(val) {
|
|
|
this.page.currentPage = 1;
|
|
|
this.page.pageSize = val;
|
|
|
},
|
|
|
+ sizeChange2(val) {
|
|
|
+ this.page2.currentPage = 1;
|
|
|
+ this.page2.pageSize = val;
|
|
|
+ },
|
|
|
onLoad(page, params) {
|
|
|
let data = this.deepClone(Object.assign({}, params, this.search));
|
|
|
- data.billType = "CK"
|
|
|
+ data.billType = "PD"
|
|
|
this.loading = true;
|
|
|
getList(page.currentPage, page.pageSize, data)
|
|
|
.then(res => {
|
|
@@ -157,11 +230,27 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+ onLoad2(page, params) {
|
|
|
+ let data = this.deepClone(Object.assign({}, params, this.search2));
|
|
|
+ data.billType = "RK"
|
|
|
+ this.loading2 = true;
|
|
|
+ getList(page.currentPage, page.pageSize, data)
|
|
|
+ .then(res => {
|
|
|
+ this.itemData = res.data.data.records ? res.data.data.records : [];
|
|
|
+ this.page2.total = res.data.data.total;
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading2 = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
refreshChange() {
|
|
|
this.onLoad(this.page, this.search);
|
|
|
},
|
|
|
+ refreshChange2() {
|
|
|
+ this.onLoad2(this.page2, this.search2);
|
|
|
+ },
|
|
|
newAdd() {
|
|
|
- this.show = false;
|
|
|
+ this.inStockVisible = true;
|
|
|
},
|
|
|
goBack() {
|
|
|
if (this.$route.query.id) {
|
|
@@ -174,6 +263,9 @@ export default {
|
|
|
this.show = true;
|
|
|
this.onLoad(this.page, this.search);
|
|
|
},
|
|
|
+ close() {
|
|
|
+ this.$refs.crud2.refreshTable()
|
|
|
+ },
|
|
|
async saveColumn() {
|
|
|
const inSave = await this.saveColumnData(
|
|
|
this.getColumnName(190),
|