|
|
@@ -9,7 +9,7 @@
|
|
|
<div class="add-customer-btn">
|
|
|
<el-button type="info" @click="getData" size="small">刷新资料
|
|
|
</el-button>
|
|
|
- <el-button type="primary" size="small" :disabled="form.status>0" v-if="detailData.status == 3"
|
|
|
+ <el-button type="primary" size="small" :disabled="form.status>0" v-if="form.status == 0 || form.status"
|
|
|
class="el-button--small-yh " @click.stop="openEdit">编辑
|
|
|
</el-button>
|
|
|
<el-button type="primary" @click="editCustomer" :loading="subLoading" v-if="detailData.status != 3"
|
|
|
@@ -38,15 +38,15 @@
|
|
|
<avue-form ref="form" class="trading-form" v-model="form" :option="option">
|
|
|
<template slot="purchaserId">
|
|
|
<crop-select ref="purchaser" v-model="form.purchaserId" corpType="KH" :refresh="false"
|
|
|
- @getCorpData="getKHData" :disabled="form.status > 0"></crop-select>
|
|
|
+ @getCorpData="getKHData" :disabled="detailData.status == 1"></crop-select>
|
|
|
</template>
|
|
|
<template slot="corpId">
|
|
|
<crop-select ref="corpId" v-model="form.corpId" corpType="GYS" :refresh="false" @getCorpData="getGYSData"
|
|
|
- :disabled="form.status > 0"></crop-select>
|
|
|
+ :disabled="detailData.status == 1"></crop-select>
|
|
|
</template>
|
|
|
<template slot="storageId">
|
|
|
<el-cascader v-model="form.storageId" :options="storagetreeList" :show-all-levels="false"
|
|
|
- :disabled="form.status > 0" :props="{ checkStrictly: true, emitPath: false, label: 'title' }"
|
|
|
+ :disabled="detailData.status == 1" :props="{ checkStrictly: true, emitPath: false, label: 'title' }"
|
|
|
clearable @change="storagetreeChange">
|
|
|
</el-cascader>
|
|
|
</template>
|
|
|
@@ -155,13 +155,58 @@
|
|
|
class="el-dialogDeep"
|
|
|
:visible.sync="dialogVisible"
|
|
|
append-to-body
|
|
|
- width="80%">
|
|
|
+ width="80%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ @close="closeGoods"
|
|
|
+ top="5vh">
|
|
|
<span>
|
|
|
- <avue-crud :option="tableOptionTwo" ref="crudTwo" :data="dialogList" @selection-change="selectionChange" @saveColumn="saveColumnTwo" @resetColumn="resetColumnTwo"></avue-crud>
|
|
|
+<!-- <avue-crud :option="tableOptionTwo" ref="crudTwo" :data="dialogList" @selection-change="selectionChange" @saveColumn="saveColumnTwo" @resetColumn="resetColumnTwo" @search-change="searchChange"></avue-crud>-->
|
|
|
+ <avue-crud
|
|
|
+ :option="tableOptionTwo"
|
|
|
+ :table-loading="loading"
|
|
|
+ :data="dialogList"
|
|
|
+ ref="crudTwo"
|
|
|
+ :search.sync="search"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ @row-click="rowClick"
|
|
|
+ :page.sync="page"
|
|
|
+ @on-load="onLoad"
|
|
|
+ @saveColumn="saveColumnTwo"
|
|
|
+ @resetColumn="resetColumnTwo"
|
|
|
+ :cell-style="cellStyle">
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <el-tabs v-model="activeName" @tab-click="tabHandle">
|
|
|
+ <el-tab-pane label="查询结果" name="searchList"></el-tab-pane>
|
|
|
+ <el-tab-pane label="已选定数据" name="importStaging"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </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>
|
|
|
+ </avue-crud>
|
|
|
</span>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="confirmImport">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="confirmImport">导 入</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
@@ -195,14 +240,30 @@ export default {
|
|
|
name: "detailsPageEdit",
|
|
|
data() {
|
|
|
return {
|
|
|
+ activeName: 'searchList',
|
|
|
checkData: {},
|
|
|
+ search:{},
|
|
|
+ page: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ pageList: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ loading: false,
|
|
|
dialogVisible: false,
|
|
|
dialogList:[],
|
|
|
+ goodsList:[],
|
|
|
checkDialog: false,
|
|
|
form: {},
|
|
|
checkScheduleDialog: false,
|
|
|
tableOption: {},
|
|
|
tableOptionTwo: {},
|
|
|
+ // 商品列表暂存
|
|
|
+ goodsListSave: [],
|
|
|
option: {
|
|
|
disabled: false,
|
|
|
menuBtn: false,
|
|
|
@@ -318,13 +379,24 @@ export default {
|
|
|
}
|
|
|
],
|
|
|
span: 6
|
|
|
+ },{
|
|
|
+ label: "计划出库数量",
|
|
|
+ prop: "purchaseQuantity",
|
|
|
+ value:0,
|
|
|
+ minRows: 1,
|
|
|
+ span: 6
|
|
|
+ },{
|
|
|
+ label: "计划品名",
|
|
|
+ prop: "planGoodsName",
|
|
|
+ minRows: 1,
|
|
|
+ span: 6
|
|
|
},
|
|
|
{
|
|
|
label: "备注",
|
|
|
prop: "orderRemark",
|
|
|
type: "textarea",
|
|
|
minRows: 1,
|
|
|
- span: 24
|
|
|
+ span: 18
|
|
|
},
|
|
|
]
|
|
|
},
|
|
|
@@ -356,20 +428,23 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
form: {
|
|
|
- handler() {
|
|
|
- if (this.form.status > 0) {
|
|
|
- this.$set(this.option, 'disabled', true)
|
|
|
- // this.$set(this.findObject(this.tableOption.column, "remarks"),'disabled',true)
|
|
|
- } else {
|
|
|
- this.$set(this.option, 'disabled', false)
|
|
|
- }
|
|
|
- }
|
|
|
+ // handler() {
|
|
|
+ // if (this.form.status > 0) {
|
|
|
+ // this.$set(this.option, 'disabled', true)
|
|
|
+ // // this.$set(this.findObject(this.tableOption.column, "remarks"),'disabled',true)
|
|
|
+ // } else {
|
|
|
+ // this.$set(this.option, 'disabled', false)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
|
if (this.detailData.status == 3) {
|
|
|
this.option.disabled = true;
|
|
|
}
|
|
|
+ if (this.detailData.status == 1) {
|
|
|
+ this.option.disabled = true;
|
|
|
+ }
|
|
|
if (this.detailData.id) {
|
|
|
this.getDetail(this.detailData.id);
|
|
|
}
|
|
|
@@ -392,22 +467,53 @@ export default {
|
|
|
this.getAllWorkDicts()
|
|
|
},
|
|
|
methods: {
|
|
|
+ closeGoods() {
|
|
|
+ this.selectionList = [];
|
|
|
+ this.treeDeptId = "";
|
|
|
+ this.reData = null;
|
|
|
+ this.activeName = 'searchList';
|
|
|
+ this.goodsListSave = [];
|
|
|
+ },
|
|
|
+ importStagList(row, index) {
|
|
|
+ this.goodsListSave.push(row);
|
|
|
+ },
|
|
|
+ removeStagList(row, index) {
|
|
|
+ this.goodsListSave.splice(row.$index, 1)
|
|
|
+ },
|
|
|
+ rowClick(row) {
|
|
|
+ this.$refs.crudTwo.toggleSelection([this.goodsList[row.$index]]);
|
|
|
+ },
|
|
|
+ // 标签页切换
|
|
|
+ tabHandle(data) {
|
|
|
+ console.log(data)
|
|
|
+ if (data.name == 'searchList') {
|
|
|
+ this.dialogList = this.goodsList;
|
|
|
+ this.page.total = this.pageList.total
|
|
|
+ } else if (data.name == 'importStaging') {
|
|
|
+ this.dialogList = this.goodsListSave;
|
|
|
+ this.page.total = 0
|
|
|
+ }
|
|
|
+ },
|
|
|
selectionChange(list){
|
|
|
this.selectionList = list
|
|
|
},
|
|
|
confirmImport(){
|
|
|
- for (let item in this.selectionList){
|
|
|
- for (let li of this.itemsVOList){
|
|
|
- if (this.selectionList[item].billNo == li.billNo) return this.$message.warning('第'+Number(Number(item)+1)+'条已存在,请勿重复导入!')
|
|
|
+ let data = []
|
|
|
+ for (let it in this.goodsListSave){
|
|
|
+ for (let item in this.goodsListSave){
|
|
|
+ for (let li of this.itemsVOList){
|
|
|
+ if (this.goodsListSave[item].billNo == li.billNo) return this.$message.warning('第'+Number(Number(item)+1)+'条已存在,请勿重复导入!')
|
|
|
+ }
|
|
|
}
|
|
|
- this.itemsVOList.push({
|
|
|
- ...this.selectionList[item],
|
|
|
- srcItemId:this.selectionList[item].id,
|
|
|
+ data.push({
|
|
|
+ ...this.goodsListSave[it],
|
|
|
+ srcItemId:this.goodsListSave[it].id,
|
|
|
$cellEdit: true
|
|
|
})
|
|
|
- delete this.itemsVOList[this.itemsVOList.length-1].id
|
|
|
+ delete data[data.length-1].id
|
|
|
}
|
|
|
- this.selectionList = []
|
|
|
+ this.itemsVOList = this.itemsVOList.concat(data)
|
|
|
+ this.goodsListSave = []
|
|
|
this.dialogVisible = false
|
|
|
},
|
|
|
check() {
|
|
|
@@ -450,6 +556,7 @@ export default {
|
|
|
getStorage() {
|
|
|
getStorage({storageTypeId: this.form.storageId}).then(res => {
|
|
|
this.findObject(this.tableOption.column, "storageId").dicData = res.data;
|
|
|
+ this.findObject(this.tableOptionTwo.column, "storageId").dicData = res.data;
|
|
|
})
|
|
|
},
|
|
|
storagetreeChange(row) {
|
|
|
@@ -485,13 +592,7 @@ export default {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
- scanningCodeAddPc({
|
|
|
- storageId:this.form.storageId,
|
|
|
- purchaserId:this.form.purchaserId
|
|
|
- }).then(res=>{
|
|
|
- this.dialogList = res.data.data.records
|
|
|
- this.dialogVisible = true
|
|
|
- })
|
|
|
+ this.dialogVisible = true
|
|
|
// this.itemsVOList.push({$cellEdit: true});
|
|
|
// this.getStorage()
|
|
|
} else {
|
|
|
@@ -560,11 +661,17 @@ export default {
|
|
|
delete res.data.data.createUserName
|
|
|
delete res.data.data.sysNo
|
|
|
delete res.data.data.status
|
|
|
+ delete res.data.data.vehicleShipNumber
|
|
|
+ delete res.data.data.stockUser
|
|
|
+ delete res.data.data.purchaseQuantity
|
|
|
+ delete res.data.data.planGoodsName
|
|
|
res.data.data.stockTime = getCurrentDate()
|
|
|
res.data.data.itemsVOList.forEach(e => {
|
|
|
e.storageInQuantity = e.balanceNumber
|
|
|
e.srcItemId = e.id
|
|
|
delete e.id
|
|
|
+ delete e.forklift
|
|
|
+ delete e.carry
|
|
|
})
|
|
|
this.form = res.data.data;
|
|
|
this.itemsVOList = res.data.data.itemsVOList.filter(item => item.isIssue == 3);
|
|
|
@@ -580,35 +687,35 @@ export default {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
- for (let i = 0; i < this.itemsVOList.length; i++) {
|
|
|
- if (validatenull(this.itemsVOList[i].storageId)) {
|
|
|
- return this.$message.error('请完善第' + (i + 1) + '行的库区')
|
|
|
- }
|
|
|
- if (validatenull(this.itemsVOList[i].itemId)) {
|
|
|
- return this.$message.error('请完善第' + (i + 1) + '行的品名')
|
|
|
- }
|
|
|
- if (validatenull(this.itemsVOList[i].itemType)) {
|
|
|
- return this.$message.error('请完善第' + (i + 1) + '行的品牌')
|
|
|
- }
|
|
|
- if (validatenull(this.itemsVOList[i].grade)) {
|
|
|
- return this.$message.error('请完善第' + (i + 1) + '行的等级')
|
|
|
- }
|
|
|
- if (validatenull(this.itemsVOList[i].billNo)) {
|
|
|
- return this.$message.error('请完善第' + (i + 1) + '行的捆包号')
|
|
|
- }
|
|
|
- if (validatenull(this.itemsVOList[i].sliceNumber)) {
|
|
|
- return this.$message.error('请完善第' + (i + 1) + '行的片数')
|
|
|
- }
|
|
|
- if (validatenull(this.itemsVOList[i].storageInQuantity)) {
|
|
|
- return this.$message.error('请完善第' + (i + 1) + '行的入库量')
|
|
|
- }
|
|
|
- if (validatenull(this.itemsVOList[i].unit)) {
|
|
|
- return this.$message.error('请完善第' + (i + 1) + '行的入库单位')
|
|
|
- }
|
|
|
- if (validatenull(this.itemsVOList[i].price)) {
|
|
|
- return this.$message.error('请完善第' + (i + 1) + '行的入库单价')
|
|
|
- }
|
|
|
- }
|
|
|
+ // for (let i = 0; i < this.itemsVOList.length; i++) {
|
|
|
+ // if (validatenull(this.itemsVOList[i].storageId)) {
|
|
|
+ // return this.$message.error('请完善第' + (i + 1) + '行的库区')
|
|
|
+ // }
|
|
|
+ // if (validatenull(this.itemsVOList[i].itemId)) {
|
|
|
+ // return this.$message.error('请完善第' + (i + 1) + '行的品名')
|
|
|
+ // }
|
|
|
+ // if (validatenull(this.itemsVOList[i].itemType)) {
|
|
|
+ // return this.$message.error('请完善第' + (i + 1) + '行的品牌')
|
|
|
+ // }
|
|
|
+ // if (validatenull(this.itemsVOList[i].grade)) {
|
|
|
+ // return this.$message.error('请完善第' + (i + 1) + '行的等级')
|
|
|
+ // }
|
|
|
+ // if (validatenull(this.itemsVOList[i].billNo)) {
|
|
|
+ // return this.$message.error('请完善第' + (i + 1) + '行的捆包号')
|
|
|
+ // }
|
|
|
+ // if (validatenull(this.itemsVOList[i].sliceNumber)) {
|
|
|
+ // return this.$message.error('请完善第' + (i + 1) + '行的片数')
|
|
|
+ // }
|
|
|
+ // if (validatenull(this.itemsVOList[i].storageInQuantity)) {
|
|
|
+ // return this.$message.error('请完善第' + (i + 1) + '行的入库量')
|
|
|
+ // }
|
|
|
+ // if (validatenull(this.itemsVOList[i].unit)) {
|
|
|
+ // return this.$message.error('请完善第' + (i + 1) + '行的入库单位')
|
|
|
+ // }
|
|
|
+ // if (validatenull(this.itemsVOList[i].price)) {
|
|
|
+ // return this.$message.error('请完善第' + (i + 1) + '行的入库单价')
|
|
|
+ // }
|
|
|
+ // }
|
|
|
this.itemsVOList.forEach((e, index) => {
|
|
|
e.sort = Number(index) + 1
|
|
|
})
|
|
|
@@ -637,8 +744,11 @@ export default {
|
|
|
if (status == "goBack") {
|
|
|
this.$emit("goBack");
|
|
|
}
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
+ if (!this.detailData.id){
|
|
|
+ this.detailData.id = res.data.data.id
|
|
|
+ }
|
|
|
+ this.getDetail(res.data.data.id)
|
|
|
+ }).finally(() => {
|
|
|
this.subLoading = false;
|
|
|
});
|
|
|
} else {
|
|
|
@@ -906,6 +1016,28 @@ export default {
|
|
|
this.$refs.crudTwo.$refs.dialogColumn.columnBox = false;
|
|
|
}
|
|
|
},
|
|
|
+ searchChange(params,done) {
|
|
|
+ this.onLoad(this.page,this.search);
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ //商品查询
|
|
|
+ onLoad(page, params = {}) {
|
|
|
+ let obj = this.deepClone(Object.assign(params, this.search));
|
|
|
+ this.loading = true;
|
|
|
+ scanningCodeAddPc({
|
|
|
+ storageId:this.form.storageId,
|
|
|
+ purchaserId:this.form.purchaserId,
|
|
|
+ ...obj
|
|
|
+ }).then(res=>{
|
|
|
+ this.dialogList = res.data.data.records
|
|
|
+ this.goodsList = res.data.data.records
|
|
|
+ this.page.total = res.data.data.total;
|
|
|
+ this.pageList.total = res.data.data.total;
|
|
|
+ this.activeName = 'searchList'
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
async resetColumnTwo() {
|
|
|
this.tableOptionTwo = tableOptionTwo;
|
|
|
const inSave = await this.delColumnData(
|