取消使用滞货

This commit is contained in:
chenjianan
2019-03-28 17:53:38 +08:00
parent 40e88b96cd
commit cecb319b45
2 changed files with 51 additions and 23 deletions

View File

@@ -183,7 +183,7 @@ export function saveOrder(num1, num2, num3) {
} }
}) })
} }
// 编辑询价单 // 使用滞货
export function submitUseInventory(...params) { export function submitUseInventory(...params) {
return request({ return request({
url: '', url: '',
@@ -195,3 +195,15 @@ export function submitUseInventory(...params) {
} }
}) })
} }
// 取消使用滞货
export function cancelUseInventory(...params) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购管理_取消使用滞货',
param: `物料流水号=${params[0]}&取消数量=${params[1]}&组件零件流水号=${params[2]}`
}
})
}

View File

@@ -97,9 +97,14 @@
{{ Number(scope.row.使用滞货数量) }} {{ Number(scope.row.使用滞货数量) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="使用滞货" align="center" min-width="100"> <el-table-column label="使用滞货" align="center" min-width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="useInventory(scope.row)">使用滞货</el-button> <el-tooltip class="item" effect="dark" content="使用滞货" placement="top-start">
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1||Number(scope.row.滞货数量)===0" icon="el-icon-goods" plain type="primary" size="mini" @click="useInventory(scope.row)"/>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="取消使用滞货" placement="top-start">
<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1||Number(scope.row.使用滞货数量)===0" icon="el-icon-sold-out" plain type="danger" size="mini" @click="cancelUseInventory(scope.row)"/>
</el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="滞货数量" align="center" min-width="80"> <el-table-column label="滞货数量" align="center" min-width="80">
@@ -568,9 +573,10 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="dialogVisible4" title="使用滞货" center style="min-height: 300px;" width="400px"> <el-dialog :visible.sync="dialogVisible4" title="使用滞货" center style="min-height: 300px;" width="460px">
<span>使用滞货数量:</span> <span>使用滞货数量:</span>
<el-input-number :min="0" :max="maxUseNumber" v-model="useNumber" controls-position="right"/> <el-input-number :min="0" :max="maxUseNumber" v-model="useNumber" controls-position="right"/>
<div style="margin-top: 10px;color: red">注意:若设置待询价物料全部使用滞货,则将不可再取消使用滞货</div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible4=false">取消</el-button> <el-button size="small" @click="dialogVisible4=false">取消</el-button>
<el-button :disabled="Number(useNumber)===0" type="primary" size="small" @click="submitUseInventory">确定</el-button> <el-button :disabled="Number(useNumber)===0" type="primary" size="small" @click="submitUseInventory">确定</el-button>
@@ -581,7 +587,8 @@
<script> <script>
import { searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet, import { searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange, saveOrder, submitUseInventory } from '@/api/PurchasingCenter/CreateInquirySheet' createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange, saveOrder,
submitUseInventory, cancelUseInventory } from '@/api/PurchasingCenter/CreateInquirySheet'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { exportExcelMethod } from './exportExcel' import { exportExcelMethod } from './exportExcel'
@@ -689,7 +696,8 @@ export default {
maxUseNumber: '', maxUseNumber: '',
dialogVisible4: false, dialogVisible4: false,
backlogGroupPartNum: '', backlogGroupPartNum: '',
backlogMaterialNum: '' backlogMaterialNum: '',
cancelNum: 0
} }
}, },
computed: { computed: {
@@ -704,16 +712,37 @@ export default {
}, },
methods: { methods: {
submitUseInventory() { submitUseInventory() {
this.$confirm('该操作不可逆,确定使用滞货?', '提示', { submitUseInventory(this.backlogMaterialNum, this.useNumber, this.backlogGroupPartNum).then(response => {
console.log(response.data)
if (response.data[0].result === '1') {
this.searchTable11()
this.dialogVisible4 = false
this.$message.success('操作成功')
} else { this.$message.error('操作失败') }
})
},
useInventory(row) { // 使用滞货
console.log(row)
this.useNumber = 0
row.滞货数量 < row.待询价数量 ? this.maxUseNumber = Number(row.滞货数量) : this.maxUseNumber = Number(row.待询价数量)
this.backlogMaterialNum = row.物料流水号
this.backlogGroupPartNum = row.组件零件流水号
this.dialogVisible4 = true
},
cancelUseInventory(row) { // 取消使用滞货
console.log(row)
this.backlogMaterialNum = row.物料流水号
this.backlogGroupPartNum = row.组件零件流水号
this.cancelNum = row.使用滞货数量
this.$confirm('确定取消使用滞货?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
submitUseInventory(this.backlogMaterialNum, this.useNumber, this.backlogGroupPartNum).then(response => { console.log(this.backlogMaterialNum, this.cancelNum, this.backlogGroupPartNum)
console.log(response.data) cancelUseInventory(this.backlogMaterialNum, this.cancelNum, this.backlogGroupPartNum).then(response => {
if (response.data[0].result === '1') { if (response.data[0].result === '1') {
this.searchTable11() this.searchTable11()
this.dialogVisible4 = false
this.$message.success('操作成功') this.$message.success('操作成功')
} else { this.$message.error('操作失败') } } else { this.$message.error('操作失败') }
}) })
@@ -721,14 +750,6 @@ export default {
this.$message.info('已取消操作') this.$message.info('已取消操作')
}) })
}, },
useInventory(row) { // 使用滞货
console.log(row)
this.useNumber = 0
this.maxUseNumber = Number(row.滞货数量)
this.backlogMaterialNum = row.物料流水号
this.backlogGroupPartNum = row.组件零件流水号
this.dialogVisible4 = true
},
saveOrder() { // 保存询价单 saveOrder() { // 保存询价单
const orderNumGroup = [] const orderNumGroup = []
const numGroup = [] const numGroup = []
@@ -751,12 +772,10 @@ export default {
return row['供货商'] === value return row['供货商'] === value
}, },
searchTable11() { // 查询标准件和外购件列表 searchTable11() { // 查询标准件和外购件列表
console.log(this.materialStatusValue)
let check1 let check1
this.materialName ? check1 = 1 : check1 = 0 this.materialName ? check1 = 1 : check1 = 0
searchMaterial(this.pageCurrent11, this.pageSize11, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.materialName, this.id).then(response => { searchMaterial(this.pageCurrent11, this.pageSize11, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.materialName, this.id).then(response => {
this.tableData11 = response.data.rows this.tableData11 = response.data.rows
console.log(response.data.rows)
this.total11 = response.data.total this.total11 = response.data.total
}) })
}, },
@@ -772,7 +791,6 @@ export default {
searchTable12() { // 查询基本件列表 searchTable12() { // 查询基本件列表
searchPart(this.pageCurrent12, this.pageSize12, this.materialStatusValue[this.materialStatusValue.length - 1], this.id).then(response => { searchPart(this.pageCurrent12, this.pageSize12, this.materialStatusValue[this.materialStatusValue.length - 1], this.id).then(response => {
this.tableData12 = response.data.rows this.tableData12 = response.data.rows
console.log(response.data.rows)
this.total12 = response.data.total this.total12 = response.data.total
}) })
}, },
@@ -954,7 +972,6 @@ export default {
handleSelectionChange1(val) { // 标准件和外购件多选 handleSelectionChange1(val) { // 标准件和外购件多选
this.groupPartNum = [] this.groupPartNum = []
this.allNum = [] this.allNum = []
console.log(val)
for (let i = 0; i < val.length; i++) { for (let i = 0; i < val.length; i++) {
this.groupPartNum[i] = val[i].组件零件流水号 this.groupPartNum[i] = val[i].组件零件流水号
this.allNum[i] = val[i].待询价数量 this.allNum[i] = val[i].待询价数量
@@ -1105,7 +1122,6 @@ export default {
this.supplierExport = row.供应商名称 this.supplierExport = row.供应商名称
this.orderExport = row.询价单编号 this.orderExport = row.询价单编号
searchSheetDetail(row.询价单流水号).then(response => { searchSheetDetail(row.询价单流水号).then(response => {
console.log(response.data)
this.tableData3 = response.data this.tableData3 = response.data
}) })
}, },