|
|
|
|
@ -2,7 +2,10 @@ |
|
|
|
|
<!-- 产品锁定审核 --> |
|
|
|
|
<div class="app-container"> |
|
|
|
|
<div class="search-box"> |
|
|
|
|
<el-form :inline="true" :model="enterForm"> |
|
|
|
|
<el-form |
|
|
|
|
:inline="true" |
|
|
|
|
:model="enterForm" |
|
|
|
|
> |
|
|
|
|
<el-form-item label="单据编号"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="enterForm.orderNo" |
|
|
|
|
@ -11,33 +14,40 @@ |
|
|
|
|
></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="单据状态"> |
|
|
|
|
<el-radio-group v-model="orderStatus" disabled> |
|
|
|
|
<el-radio-group |
|
|
|
|
v-model="orderStatus" |
|
|
|
|
disabled |
|
|
|
|
> |
|
|
|
|
<el-radio label="unLock">待解锁</el-radio> |
|
|
|
|
<el-radio label="lock">待锁定</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button type="primary" @click="queryTable">搜索</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="queryTable" |
|
|
|
|
>搜索</el-button> |
|
|
|
|
<el-button @click="resetQuery">重置</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
|
<div class="opt-box"> |
|
|
|
|
<div class="opt-box-right"> |
|
|
|
|
<el-button type="primary" @click="addLocation">提取</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="addLocation" |
|
|
|
|
>提取</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="saveLocation" |
|
|
|
|
:disabled="orderStatus !== 'lock'" |
|
|
|
|
>锁定</el-button |
|
|
|
|
> |
|
|
|
|
>锁定</el-button> |
|
|
|
|
|
|
|
|
|
<el-button |
|
|
|
|
:disabled="orderStatus !== 'unLock'" |
|
|
|
|
@click="delLocation" |
|
|
|
|
type="primary" |
|
|
|
|
>解锁</el-button |
|
|
|
|
> |
|
|
|
|
>解锁</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
@ -60,37 +70,37 @@ |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import { getTableHeader } from "@/api/system/table"; |
|
|
|
|
import { tableConfig } from "./config.js"; |
|
|
|
|
import extract from "./extract.vue"; |
|
|
|
|
import { lockOrUnLock, list } from "@/api/libraryManage/inventoryLock"; |
|
|
|
|
import { getTableHeader } from '@/api/system/table' |
|
|
|
|
import { tableConfig } from './config.js' |
|
|
|
|
import extract from './extract.vue' |
|
|
|
|
import { lockOrUnLock, list } from '@/api/libraryManage/inventoryLock' |
|
|
|
|
export default { |
|
|
|
|
components: { extract }, |
|
|
|
|
dicts: ["goods_unit"], |
|
|
|
|
dicts: ['goods_unit'], |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
enterForm: { |
|
|
|
|
orderNo: "", |
|
|
|
|
orderNo: '' |
|
|
|
|
}, |
|
|
|
|
orderStatus: "", |
|
|
|
|
orderStatus: '', |
|
|
|
|
queryData: [], |
|
|
|
|
goodsData: [], |
|
|
|
|
handleSelect: [], |
|
|
|
|
tableConfig: { |
|
|
|
|
config: [], |
|
|
|
|
config: [] |
|
|
|
|
}, |
|
|
|
|
tableForm: { |
|
|
|
|
config: [], |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
config: [] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
async created() { |
|
|
|
|
// this.tableConfig = tableConfig.call(this); |
|
|
|
|
getTableHeader("busin_lock_audit_list").then((res) => { |
|
|
|
|
this.tableConfig = tableConfig.call(this); |
|
|
|
|
let propList = this.updatePropList(res.data, this.tableConfig.config); |
|
|
|
|
this.tableConfig.config = propList; |
|
|
|
|
}); |
|
|
|
|
getTableHeader('busin_lock_audit_list').then((res) => { |
|
|
|
|
this.tableConfig = tableConfig.call(this) |
|
|
|
|
let propList = this.updatePropList(res.data, this.tableConfig.config) |
|
|
|
|
this.tableConfig.config = propList |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
watch: {}, |
|
|
|
|
mounted() {}, |
|
|
|
|
@ -98,7 +108,7 @@ export default { |
|
|
|
|
// 提取 |
|
|
|
|
addLocation() { |
|
|
|
|
// if (!this.enterForm.orderNo) return this.$message("单据编号必填!"); |
|
|
|
|
this.$refs.extract.dialogVisible = true; |
|
|
|
|
this.$refs.extract.dialogVisible = true |
|
|
|
|
}, |
|
|
|
|
// 获取商品信息 SD20220600002 |
|
|
|
|
async getExtractInfo(dataList) { |
|
|
|
|
@ -107,78 +117,88 @@ export default { |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
// 获取货主ids |
|
|
|
|
const { rows } = await list({ orderNo: dataList[0].orderNo }); |
|
|
|
|
this.tableForm.config = rows; |
|
|
|
|
const { rows } = await list({ orderNo: dataList[0].orderNo }) |
|
|
|
|
this.tableForm.config = rows |
|
|
|
|
|
|
|
|
|
this.goodsData = this.tableForm.config; |
|
|
|
|
this.goodsData = this.tableForm.config |
|
|
|
|
if (this.tableForm.config) { |
|
|
|
|
//Init是可以操作去锁定 Lock是已经锁定了 |
|
|
|
|
if (this.tableForm.config[0].orderStatus === "init") { |
|
|
|
|
this.orderStatus = "lock"; |
|
|
|
|
} else if (this.tableForm.config[0].orderStatus === "lock") { |
|
|
|
|
this.orderStatus = "unLock"; |
|
|
|
|
if (this.tableForm.config[0].orderStatus === 'init') { |
|
|
|
|
this.orderStatus = 'lock' |
|
|
|
|
} else if (this.tableForm.config[0].orderStatus === 'lock') { |
|
|
|
|
this.orderStatus = 'unLock' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 搜索 |
|
|
|
|
async queryTable() { |
|
|
|
|
this.queryData = []; |
|
|
|
|
this.queryData = [] |
|
|
|
|
this.goodsData.forEach((element) => { |
|
|
|
|
if (element.orderNo === this.enterForm.orderNo) { |
|
|
|
|
this.queryData.push(element); |
|
|
|
|
this.queryData.push(element) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.tableForm.config = this.queryData; |
|
|
|
|
}) |
|
|
|
|
this.tableForm.config = this.queryData |
|
|
|
|
}, |
|
|
|
|
// 重置按钮 |
|
|
|
|
resetQuery() { |
|
|
|
|
this.enterForm = {}; |
|
|
|
|
this.enterForm = {} |
|
|
|
|
}, |
|
|
|
|
// 表格复选框选中 |
|
|
|
|
handleselection(val) { |
|
|
|
|
this.handleSelect = val.map((ele) => ele.id); |
|
|
|
|
this.handleSelect = val.map((ele) => ele.id) |
|
|
|
|
}, |
|
|
|
|
// 锁定按钮 |
|
|
|
|
saveLocation() { |
|
|
|
|
this.$confirm("是否确认锁定所选明细?", "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
this.$confirm('是否确认锁定所选明细?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(async () => { |
|
|
|
|
this.lockOrUnLock("lock"); |
|
|
|
|
}); |
|
|
|
|
this.lockOrUnLock('lock') |
|
|
|
|
this.$message({ |
|
|
|
|
message: '锁定成功!', |
|
|
|
|
type: 'success' |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 解锁按钮 |
|
|
|
|
delLocation() { |
|
|
|
|
this.$confirm("是否确认解锁所选明细?", "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
this.$confirm('是否确认解锁所选明细?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(async () => { |
|
|
|
|
this.lockOrUnLock("unLock"); |
|
|
|
|
}); |
|
|
|
|
this.lockOrUnLock('unLock') |
|
|
|
|
this.$message({ |
|
|
|
|
message: '解锁成功!', |
|
|
|
|
type: 'success' |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
lockOrUnLock(status) { |
|
|
|
|
this.loading = true; |
|
|
|
|
let ids = this.tableForm.config.map((ele) => ele.id); |
|
|
|
|
this.loading = true |
|
|
|
|
let ids = this.tableForm.config.map((ele) => ele.id) |
|
|
|
|
let obj = { |
|
|
|
|
orderStatus: status, |
|
|
|
|
ids: ids, |
|
|
|
|
}; |
|
|
|
|
ids: ids |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
lockOrUnLock(obj) |
|
|
|
|
.then((res) => { |
|
|
|
|
if (res.code === 200) { |
|
|
|
|
this.tableData = res.rows; |
|
|
|
|
this.paging.total = res.total; |
|
|
|
|
this.tableData = res.rows |
|
|
|
|
this.paging.total = res.total |
|
|
|
|
} |
|
|
|
|
this.loading = false; |
|
|
|
|
|
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
this.loading = false; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped> |
|
|
|
|
|