|
@@ -44,10 +44,20 @@
|
|
|
</template>
|
|
|
|
|
|
<template slot="goodsNum" slot-scope="{row}">
|
|
|
- <el-input-number v-if="row.$cellEdit" v-model="row.goodsNum" size="small" :controls="false" :precision="0"
|
|
|
- style="width: 100%" />
|
|
|
+ <el-input-number v-if="row.$cellEdit && whetherFinancing != 1" v-model="row.goodsNum" size="small"
|
|
|
+ :controls="false" :precision="0" style="width: 100%" @change="calculator2(row)"/>
|
|
|
<span v-else>{{ row.goodsNum }}</span>
|
|
|
</template>
|
|
|
+ <template slot="sendNumFinancing" slot-scope="{row}">
|
|
|
+ <el-input-number v-if="row.$cellEdit" v-model="row.sendNumFinancing" size="small" :controls="false"
|
|
|
+ :precision="0" style="width: 100%" @change="calculator(row)" />
|
|
|
+ <span v-else>{{ row.sendNumFinancing }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="sendNumHave" slot-scope="{row}">
|
|
|
+ <el-input-number v-if="row.$cellEdit" v-model="row.sendNumHave" size="small" :controls="false"
|
|
|
+ :precision="0" style="width: 100%" @change="calculator(row)" />
|
|
|
+ <span v-else>{{ row.sendNumHave }}</span>
|
|
|
+ </template>
|
|
|
<template slot="dot" slot-scope="{row}">
|
|
|
<!--使用allow-create属性即可通过在输入框中输入文字来创建新的条目。注意此时filterable必须为真。-->
|
|
|
<!--本例还使用了default-first-option属性, 在该属性打开的情况下,按下回车就可以选中当前选项列表中的第一个选项,-->
|
|
@@ -62,7 +72,7 @@
|
|
|
</template>
|
|
|
<template slot="price" slot-scope="{row}">
|
|
|
<el-input-number v-if="row.$cellEdit" v-model="row.price" size="small" :controls="false"
|
|
|
- style="width: 100%" />
|
|
|
+ style="width: 100%" @change="calculator2(row)"/>
|
|
|
<span v-else>{{ row.price }}</span>
|
|
|
</template>
|
|
|
|
|
@@ -103,6 +113,7 @@ export default {
|
|
|
name: "detailsPage",
|
|
|
data() {
|
|
|
return {
|
|
|
+ whetherFinancing: 0,
|
|
|
picihaolist: [], // 批次号数据
|
|
|
tableData: [],
|
|
|
// 上传附件的需要参数
|
|
@@ -282,39 +293,47 @@ export default {
|
|
|
value: "dot"
|
|
|
},
|
|
|
dicUrl: "/api/blade-sales-part/stockDesc/dotList",
|
|
|
- },
|
|
|
+ },
|
|
|
{
|
|
|
label: '库存数量',
|
|
|
prop: "inventory",
|
|
|
disabled: true,
|
|
|
- },
|
|
|
- // {
|
|
|
- // label: '参考库存融资',
|
|
|
- // prop: "inventoryFinancing",
|
|
|
- // width: 120,
|
|
|
- // disabled: true,
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '参考库存自有',
|
|
|
- // prop: "inventoryHave",
|
|
|
- // width: 120,
|
|
|
- // disabled: true,
|
|
|
- // },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '参考库存融资',
|
|
|
+ prop: "inventoryFinancing",
|
|
|
+ width: 120,
|
|
|
+ disabled: true,
|
|
|
+ hide: true,
|
|
|
+ showColumn: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '参考库存自有',
|
|
|
+ prop: "inventoryHave",
|
|
|
+ width: 120,
|
|
|
+ disabled: true,
|
|
|
+ hide: true,
|
|
|
+ showColumn: false,
|
|
|
+ },
|
|
|
{
|
|
|
label: '调拨数量',
|
|
|
prop: 'goodsNum',
|
|
|
disabled: false,
|
|
|
- },
|
|
|
- // {
|
|
|
- // label: '融资数量',
|
|
|
- // prop: 'sendNumFinancing',
|
|
|
- // disabled: false,
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '自有数量',
|
|
|
- // prop: 'sendNumHave',
|
|
|
- // disabled: false,
|
|
|
- // },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '融资数量',
|
|
|
+ prop: 'sendNumFinancing',
|
|
|
+ disabled: false,
|
|
|
+ hide: true,
|
|
|
+ showColumn: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '自有数量',
|
|
|
+ prop: 'sendNumHave',
|
|
|
+ disabled: false,
|
|
|
+ hide: true,
|
|
|
+ showColumn: false,
|
|
|
+ },
|
|
|
{
|
|
|
label: '单价',
|
|
|
prop: "price",
|
|
@@ -377,6 +396,19 @@ export default {
|
|
|
this.findObject(this.optionContacts.column, "pattern").label = '规格型号1'
|
|
|
}
|
|
|
})
|
|
|
+ isProcurement({ "param": "whether.financing" }).then(res => {
|
|
|
+ if (res.data.data == 1) {
|
|
|
+ this.whetherFinancing = res.data.data
|
|
|
+ this.findObject(this.optionContacts.column, "inventoryFinancing").hide = false
|
|
|
+ this.findObject(this.optionContacts.column, "inventoryFinancing").showColumn = true
|
|
|
+ this.findObject(this.optionContacts.column, "inventoryHave").hide = false
|
|
|
+ this.findObject(this.optionContacts.column, "inventoryHave").showColumn = true
|
|
|
+ this.findObject(this.optionContacts.column, "sendNumFinancing").hide = false
|
|
|
+ this.findObject(this.optionContacts.column, "sendNumFinancing").showColumn = true
|
|
|
+ this.findObject(this.optionContacts.column, "sendNumHave").hide = false
|
|
|
+ this.findObject(this.optionContacts.column, "sendNumHave").showColumn = true
|
|
|
+ }
|
|
|
+ })
|
|
|
this.key++
|
|
|
if (this.detailData.id) {
|
|
|
this.refresh()
|
|
@@ -702,6 +734,25 @@ export default {
|
|
|
|
|
|
}
|
|
|
},
|
|
|
+ calculator(row) {
|
|
|
+ if(row.sendNumFinancing>row.inventoryFinancing){
|
|
|
+ this.$set(row,'sendNumFinancing','0')
|
|
|
+ this.$message.error("融资数量不能大于参考库存融资");
|
|
|
+ }
|
|
|
+ if(row.sendNumHave>row.inventoryHave){
|
|
|
+ this.$set(row,'sendNumHave','0')
|
|
|
+ this.$message.error("自由数量不能大于参考库存自有");
|
|
|
+ }
|
|
|
+ row.goodsNum = Number(Number(row.sendNumFinancing) + Number(row.sendNumHave))
|
|
|
+ row.subTotalMoney = row.goodsNum * row.price
|
|
|
+ },
|
|
|
+ calculator2(row) {
|
|
|
+ if(row.goodsNum>row.inventory){
|
|
|
+ this.$set(row,'goodsNum','0')
|
|
|
+ this.$message.error("调拨数量不能大于库存");
|
|
|
+ }
|
|
|
+ row.subTotalMoney = row.goodsNum * row.price
|
|
|
+ },
|
|
|
// 导入按钮事件
|
|
|
tableDataHandle(arr) {
|
|
|
this.tableData = arr
|
|
@@ -712,15 +763,15 @@ export default {
|
|
|
price: item.price, // 单价
|
|
|
goodsName: item.cname,
|
|
|
goodsNum: item.goodsNum,
|
|
|
- sendNumHave: item.goodsNum,
|
|
|
- sendNumFinancing: item.goodsNum,
|
|
|
+ sendNumFinancing:this.whetherFinancing==1?item.goodsNum:0,
|
|
|
+ sendNumHave: '0',
|
|
|
brandName: item.brandName,
|
|
|
brandId: item.brandId,
|
|
|
goodsNo: item.code,
|
|
|
propertyName: item.specificationAndModel,
|
|
|
inventory: item.inventory,
|
|
|
- inventoryHave:item.inventoryHave,
|
|
|
- inventoryFinancing:item.inventoryFinancing,
|
|
|
+ inventoryHave:this.whetherFinancing==1?item.inventoryHave:0 ,
|
|
|
+ inventoryFinancing: this.whetherFinancing==1?item.inventoryFinancing:0,
|
|
|
pattern: item.brandItem,
|
|
|
goodsDescription: item.goodsDescription,
|
|
|
dot: item.dot,
|