|
@@ -132,11 +132,15 @@
|
|
|
append-to-body
|
|
|
width="80%">
|
|
|
<span>
|
|
|
- <avue-crud :data="dialogData" :option="dialogOption"
|
|
|
+ <avue-crud :data="dialogData"
|
|
|
+ :option="dialogOption"
|
|
|
:page.sync="dialogPage"
|
|
|
:search.sync="params"
|
|
|
ref="dialogCrud"
|
|
|
+ @resetColumn="resetColumnTwo('dialogCrud','dialogOption','dialogOptionList',2.1)"
|
|
|
+ @saveColumn="saveColumnTwo('dialogCrud','dialogOption','dialogOptionList',2.1)"
|
|
|
@refresh-change="refreshChangeTwo"
|
|
|
+ @search-change="searchChangeTwo"
|
|
|
@on-load="dialogOnLoad">
|
|
|
<template slot="menuLeft">
|
|
|
<el-tabs v-model="activeName" @tab-click="tabHandle">
|
|
@@ -144,30 +148,33 @@
|
|
|
<el-tab-pane label="已选定数据" name="importStaging"/>
|
|
|
</el-tabs>
|
|
|
</template>
|
|
|
+ <template slot="corpNameSearch">
|
|
|
+ <crop-select v-model="params.corpId" corpType="GYS"/>
|
|
|
+ </template>
|
|
|
<template slot-scope="scope" slot="menu">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- size="small"
|
|
|
- @click.stop="importStagList(scope.row, scope.index)"
|
|
|
- v-if="activeName == 'searchList'"
|
|
|
- :disabled=" goodsListSave.findIndex(item => item.id == scope.row.id) !== -1 "
|
|
|
- >选择
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- size="small"
|
|
|
- @click.stop="removeStagList(scope.row, scope.index)"
|
|
|
- v-else
|
|
|
- >移除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="small"
|
|
|
+ @click.stop="importStagList(scope.row, scope.index)"
|
|
|
+ v-if="activeName == 'searchList'"
|
|
|
+ :disabled=" goodsListSave.findIndex(item => item.id == scope.row.id) !== -1 "
|
|
|
+ >选择
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ size="small"
|
|
|
+ @click.stop="removeStagList(scope.row, scope.index)"
|
|
|
+ v-else
|
|
|
+ >移除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
</avue-crud>
|
|
|
</span>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
|
|
+ <el-button type="primary" :disabled="goodsListSave.length === 0" @click="confirmImport">导 入</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -175,7 +182,7 @@
|
|
|
|
|
|
<script>
|
|
|
import option from "./config/mainList.json";
|
|
|
-import {getList, remove, gainUser, listXS} from "@/api/exportTrade/purchaseContract";
|
|
|
+import {getList, remove, gainUser, listXS,generatePurchaseBill} from "@/api/exportTrade/purchaseContract";
|
|
|
import detailPage from "./detailsPage.vue";
|
|
|
import { defaultDate } from "@/util/date";
|
|
|
import { IntegerFormat } from "@/util/validate";
|
|
@@ -197,7 +204,8 @@ export default {
|
|
|
pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
|
|
|
},
|
|
|
activeName: 'searchList',
|
|
|
- dialogOption: {
|
|
|
+ dialogOption: {},
|
|
|
+ dialogOptionList: {
|
|
|
searchShow: true,
|
|
|
searchMenuSpan: 16,
|
|
|
border: true,
|
|
@@ -213,48 +221,69 @@ export default {
|
|
|
tip: false,
|
|
|
column: [{
|
|
|
label: "销售单号",
|
|
|
- prop: "orderNo",
|
|
|
- search:false,
|
|
|
+ prop: "billNo",
|
|
|
+ search: true,
|
|
|
+ searchSpan: 8,
|
|
|
overHidden: true
|
|
|
}, {
|
|
|
label: "销售日期",
|
|
|
prop: "businesDate",
|
|
|
+ searchProp: "businesDateList",
|
|
|
+ width: 100,
|
|
|
+ type: "date",
|
|
|
+ searchSpan: 8,
|
|
|
+ searchRange: true,
|
|
|
+ search: true,
|
|
|
+ searchDefaultTime: ["00:00:00", "23:59:59"],
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
overHidden: true
|
|
|
}, {
|
|
|
label: "供应商",
|
|
|
- prop: "corpId",
|
|
|
+ prop: "corpName",
|
|
|
+ searchSpan: 8,
|
|
|
+ search: true,
|
|
|
overHidden: true
|
|
|
}, {
|
|
|
label: "交货日期",
|
|
|
- prop: "corpId",
|
|
|
+ prop: "plannedDeliveryDate",
|
|
|
+ searchProp: "plannedDeliveryDateList",
|
|
|
+ width: 100,
|
|
|
+ type: "date",
|
|
|
+ searchSpan: 8,
|
|
|
+ searchRange: true,
|
|
|
+ search: true,
|
|
|
+ searchDefaultTime: ["00:00:00", "23:59:59"],
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
overHidden: true
|
|
|
}, {
|
|
|
label: "采购员",
|
|
|
- prop: "corpId",
|
|
|
+ prop: "carry",
|
|
|
overHidden: true
|
|
|
}, {
|
|
|
label: "产品名称",
|
|
|
- prop: "corpId",
|
|
|
+ prop: "cname",
|
|
|
overHidden: true
|
|
|
}, {
|
|
|
label: "产品编号",
|
|
|
- prop: "corpId",
|
|
|
+ prop: "code",
|
|
|
overHidden: true
|
|
|
}, {
|
|
|
label: "产品类别",
|
|
|
- prop: "corpId",
|
|
|
+ prop: "priceCategory",
|
|
|
overHidden: true
|
|
|
}, {
|
|
|
label: "产品型号",
|
|
|
- prop: "corpId",
|
|
|
+ prop: "itemType",
|
|
|
overHidden: true
|
|
|
}, {
|
|
|
label: "数量",
|
|
|
- prop: "corpId",
|
|
|
+ prop: "orderQuantity",
|
|
|
overHidden: true
|
|
|
}, {
|
|
|
label: "采购数",
|
|
|
- prop: "corpId",
|
|
|
+ prop: "purchaseQuantity",
|
|
|
overHidden: true
|
|
|
}]
|
|
|
},
|
|
@@ -279,9 +308,9 @@ export default {
|
|
|
components: { detailPage },
|
|
|
async created() {
|
|
|
this.option = await this.getColumnData(this.getColumnName(2), option);
|
|
|
+ this.dialogOption = await this.getColumnData(this.getColumnName(2.1), this.dialogOptionList);
|
|
|
this.getWorkDicts("payment_term").then(res => {
|
|
|
- this.findObject(this.option.column, "paymentType").dicData =
|
|
|
- res.data.data;
|
|
|
+ this.findObject(this.option.column, "paymentType").dicData = res.data.data;
|
|
|
});
|
|
|
gainUser().then(res => {
|
|
|
this.findObject(this.option.column, "createUser").dicData = res.data.data;
|
|
@@ -394,7 +423,56 @@ export default {
|
|
|
this.goodsListSave.push(row);
|
|
|
},
|
|
|
refreshChangeTwo(){
|
|
|
- this.onLoad(this.page);
|
|
|
+ this.dialogOnLoad(this.page);
|
|
|
+ },
|
|
|
+ searchChangeTwo(params,done){
|
|
|
+ done()
|
|
|
+ this.dialogOnLoad(this.page);
|
|
|
+ },
|
|
|
+ //自定义列保存
|
|
|
+ async saveColumnTwo(ref, option, optionBack, code) {
|
|
|
+ /**
|
|
|
+ * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
+ * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
+ * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
+ */
|
|
|
+ const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+//自定义列重置
|
|
|
+ async resetColumnTwo(ref, option, optionBack, code) {
|
|
|
+ this[option] = this[optionBack];
|
|
|
+ const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ confirmImport(){
|
|
|
+ let ids = this.goodsListSave.map(item => {return item.id})
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '加载中',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(255,255,255,0.7)'
|
|
|
+ });
|
|
|
+ generatePurchaseBill({ids:ids.join(',')}).then(res=>{
|
|
|
+ this.$message.success("导入成功")
|
|
|
+ this.detailData = {
|
|
|
+ form: res.data.data
|
|
|
+ };
|
|
|
+ loading.close()
|
|
|
+ this.dialogVisible = false
|
|
|
+ setTimeout(() => {
|
|
|
+ this.show = false;
|
|
|
+ }, 200);
|
|
|
+ }).catch(()=>{
|
|
|
+ loading.close()
|
|
|
+ })
|
|
|
},
|
|
|
dialogOnLoad(page, params) {
|
|
|
this.dialogLoading = true;
|