新购驳回编辑操作修改

This commit is contained in:
zzyuan 2024-12-24 14:30:15 +08:00
parent 4cb92fe78b
commit f99df38248
1 changed files with 43 additions and 36 deletions

View File

@ -51,7 +51,6 @@
clearable
maxlength="50"
style="width: 240px"
@keyup.enter.native="handleQuery"
@input="taxRateChange"
/>
<span>%</span>
@ -125,7 +124,7 @@
<el-input
v-model.number="scope.row.purchaseNum"
controls-position="right" type="number"
style="width: 100%"
style="width: 100%" :disabled="scope.row.status!=1&&scope.row.status!=12"
:min="0" @input="(v)=>(scope.row.unitValue==1?scope.row.purchaseNum=Number(v.replace(/[^\d.]/g,'')) : scope.row.purchaseNum=Number(v.replace(/[^\d]/g,'')))"
></el-input>
</template>
@ -140,7 +139,7 @@
v-model="scope.row.purchaseTaxPrice"
controls-position="right"
style="width: 100%"
:min="0" :step="1"
:min="0" :step="1" :disabled="scope.row.status!=1&&scope.row.status!=12"
@change="purchaseTaxPriceChange(scope.row,scope.$index)"
></el-input-number>
</template>
@ -155,7 +154,7 @@
v-model="scope.row.purchasePrice"
controls-position="right"
style="width: 100%"
:min="0" :step="1"
:min="0" :step="1" :disabled="scope.row.status!=1&&scope.row.status!=12"
@input="purchasePriceChange(scope.row,scope.$index)"
></el-input-number>
</template>
@ -170,7 +169,7 @@
<el-select
v-model="scope.row.fixCode"
placeholder="固定资产"
filterable
filterable :disabled="scope.row.status!=1&&scope.row.status!=12"
clearable
>
<el-option label="是" value="1"></el-option>
@ -190,7 +189,7 @@
v-model="scope.row.productionTime"
style="width: 100%"
value-format="yyyy-MM-dd"
type="date"
type="date" :disabled="scope.row.status!=1&&scope.row.status!=12"
placeholder="出厂日期"
clearable
></el-date-picker>
@ -222,7 +221,7 @@
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
<el-button
size="mini"
type="text"
type="text" v-if="scope.row.status==1||scope.row.status==12"
icon="el-icon-delete"
style="color: red"
@click="handleDelete(scope.row)"
@ -447,7 +446,9 @@ export default {
taxRateChange(val){
this.maForm.taxRate = val.replace(/[^\d.]/g,'')
this.equipmentList.forEach(item=>{
item.purchaseTaxPrice = ((item.purchasePrice*(1 + val))/100).toFixed(10)
if(item.status==1||item.status==12){
item.purchaseTaxPrice = ((item.purchasePrice*(1 + this.maForm.taxRate/100))).toFixed(10)
}
})
},
//
@ -489,10 +490,8 @@ export default {
item3.children.length > 0
) {
item3.children.forEach((item4) => {
item4.maTypeName =
item3.typeName
item4.specificationType =
item4.typeName
item4.maTypeName = item3.typeName
item4.specificationType = item4.typeName
this.$set(item4, 'purchaseTaxPrice', 0)
this.$set(item4, 'purchasePrice', 0)
})
@ -504,14 +503,36 @@ export default {
})
//
let selectList = []
this.equipmentList.forEach((e) => {
selectList.push(
this.getParentsById(this.equipmentTypeList, e.typeId),
)
console.log(this.equipmentList)
this.equipmentList.forEach((e) => {
console.log(this.equipmentList)
selectList.push(this.getParentsById(this.equipmentTypeList, e.typeId, e.status))
})
this.deviceType = selectList
})
},
//
getParentsById(list, id, status) {
for (let i in list) {
if (list[i].typeId == id) {
console.log(id)
console.log(status)
if(status!=1&&status!=12){
list[i].disabled=true
}
//value
return [list[i].typeId]
}
if (list[i].children) {
let node = this.getParentsById(list[i].children, id, status)
if (node !== undefined) {
//
node.unshift(list[i].typeId)
return node
}
}
}
},
//
deviceTypeChange(val) {
const deviceTypeList =
@ -564,13 +585,15 @@ export default {
//
productionTimeChange(val){
this.equipmentList.forEach(item=>{
item.productionTime=val
if(item.status==1||item.status==12){
item.productionTime=val
}
})
},
//---
getTaskInfo() {
async getTaskInfo() {
// this.loading = true;
getPurchaseCheckInfo({taskId:this.taskId,id:this.id,statusList:[1]}).then((response) => {
await getPurchaseCheckInfo({taskId:this.taskId,id:this.id,statusList:[1]}).then((response) => {
this.maForm = response.data.purchaseCheckInfo
this.maForm.id = response.data.purchaseCheckInfo.id
this.maForm.taskId = response.data.purchaseCheckInfo.taskId
@ -757,23 +780,7 @@ export default {
this.dialogVisible = true
}
},
//
getParentsById(list, id) {
for (let i in list) {
if (list[i].typeId == id) {
//value
return [list[i].typeId]
}
if (list[i].children) {
let node = this.getParentsById(list[i].children, id)
if (node !== undefined) {
//
node.unshift(list[i].typeId)
return node
}
}
}
},
/** 删除按钮操作 */
handleDelete(row) {
// console.log(row.id)