新购驳回编辑操作修改

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