新购到货-新增1

This commit is contained in:
zzyuan 2024-11-06 16:46:12 +08:00
parent 1a16d8d016
commit 39a97186b0
2 changed files with 92 additions and 42 deletions

View File

@ -18,8 +18,24 @@
type="date" type="date"
placeholder="请选择到货日期" placeholder="请选择到货日期"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="物资厂家" prop="supplierId">
<el-select
v-model="maForm.supplierId"
placeholder="物资厂家"
clearable
filterable
style="width: 240px"
@change="changeSupplier"
>
<el-option
v-for="item in supplierList"
:key="item.supplierId"
:label="item.supplier"
:value="item.supplierId"
/>
</el-select>
</el-form-item>
<el-form-item label="出厂日期" prop="productionTime"> <el-form-item label="出厂日期" prop="productionTime">
<el-date-picker <el-date-picker
v-model="maForm.productionTime" v-model="maForm.productionTime"
@ -40,7 +56,6 @@
style="width: 240px" style="width: 240px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
@input="taxRateChange" @input="taxRateChange"
/> />
<span>%</span> <span>%</span>
</el-form-item> </el-form-item>
@ -85,7 +100,7 @@
:data="equipmentList" :data="equipmentList"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column <el-table-column
align="center" align="center"
label="序号" label="序号"
@ -106,37 +121,52 @@
/> />
<el-table-column align="center" label="单位" prop="unitName" /> <el-table-column align="center" label="单位" prop="unitName" />
<el-table-column <el-table-column
label="购置单价(元含税)" label="采购数量"
prop="purchasePrice" prop="purchaseNum"
align="center" align="center"
> >
<template v-slot="scope"> <template v-slot="scope">
<el-input-number <el-input-number
v-model="scope.row.purchasePrice" v-model="scope.row.purchaseNum"
controls-position="right" controls-position="right"
style="width: 100%" style="width: 100%"
:min="0" :min="0"
></el-input-number> ></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="购置单价(元含税)"
prop="purchaseTaxPrice"
align="center"
>
<template v-slot="scope">
<el-input-number
v-model="scope.row.purchaseTaxPrice"
controls-position="right"
style="width: 100%"
:min="0"
@change="purchaseTaxPriceChange(scope.row,scope.$index)"
></el-input-number>
</template>
</el-table-column>
<el-table-column <el-table-column
label="购置单价(元不含税)" label="购置单价(元不含税)"
prop="purchaseNoPrice" prop="purchasePrice"
align="center" align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number <el-input-number
v-model="scope.row.purchaseNoPrice" v-model="scope.row.purchasePrice"
controls-position="right" controls-position="right"
style="width: 100%" style="width: 100%"
:min="0" :min="0"
@input="purchaseNoPriceChange(scope.row,scope.$index)" @input="purchasePriceChange(scope.row,scope.$index)"
></el-input-number> ></el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column
label="是否为固定资产" label="是否为固定资产"
prop="productionTime" prop=""
align="center" align="center"
width="200" width="200"
> >
@ -147,10 +177,18 @@
filterable filterable
clearable clearable
> >
<el-option label="是" value="0"></el-option> <el-option label="是" value="0"></el-option>
<el-option label="否" value="1"></el-option> <el-option label="否" value="1"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> -->
<el-table-column label="物资厂家" prop="supplierId" width="200">
<template slot-scope="scope">
<el-select v-model="scope.row.supplierId" placeholder="物资厂家" filterable clearable style="width: 180px">
<el-option v-for="item in supplierList" :key="item.supplierId" :label="item.supplier"
:value="item.supplierId" />
</el-select>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="出厂日期" label="出厂日期"
@ -240,7 +278,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- <pagination <pagination
v-show="totalTwo>0" v-show="totalTwo>0"
:total="totalTwo" :total="totalTwo"
:page.sync="queryGt.pageNum" :page.sync="queryGt.pageNum"
@ -262,9 +300,10 @@ import {
equipmentTypeTree, equipmentTypeTree,
addPurchaseCheckInfo, addPurchaseCheckInfo,
updatePurchaseCheckInfo, updatePurchaseCheckInfo,
} from '@/api/purchase/goodsArrived' } from '@/api/purchase/goodsArrived';
import { getListFacturer } from '@/api/ma/supplier';
// import { getUserByRoleList } from '@/api/system/user' // import { getUserByRoleList } from '@/api/system/user'
// import { equipmentTypeTree, supplierInfoList } from '@/api/store/tools'
// import Treeselect from '@riophae/vue-treeselect' // import Treeselect from '@riophae/vue-treeselect'
// import '@riophae/vue-treeselect/dist/vue-treeselect.css' // import '@riophae/vue-treeselect/dist/vue-treeselect.css'
// import HoldingpoleDialog from '@/components/HoldingpoleDialog/index.vue' // import HoldingpoleDialog from '@/components/HoldingpoleDialog/index.vue'
@ -312,7 +351,7 @@ export default {
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
supplierList: [], supplierList: [],
// //
equipmentTypeList: [], equipmentTypeList: [],
@ -376,7 +415,7 @@ export default {
supplierId: '', supplierId: '',
}, },
maForm: { maForm: {
taxRate:0, taxRate:13,
purchaseTime: '', purchaseTime: '',
arrivalTime: '', arrivalTime: '',
purchaser: '', purchaser: '',
@ -418,7 +457,7 @@ export default {
}, },
deviceType: [], deviceType: [],
propsKey: 1000, propsKey: 1000,
taxRate:0, // taxRate:0,
} }
}, },
computed: { computed: {
@ -440,31 +479,34 @@ export default {
}, },
}, },
mounted() { mounted() {
this.equipmentType()
this.supplierInfoList()
if (this.isEdit) { if (this.isEdit) {
console.log('isEdit',this.isEdit) console.log('isEdit',this.isEdit)
this.taskId = this.editTaskId this.taskId = this.editTaskId
this.id = this.editId this.id = this.editId
this.getTaskInfo() this.getTaskInfo()
} }
// this.getUserList() // this.getUserList()
// this.getList(); // this.getList();
this.equipmentType()
// this.supplierInfoList()
}, },
methods: { methods: {
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.purchasePrice = item.purchaseNoPrice*(1 + val/100) item.purchaseTaxPrice = item.purchasePrice*(1 + val/100)
}) })
}, },
purchaseNoPriceChange(row,val){ purchaseTaxPriceChange(row,val){
this.equipmentList[val].purchasePrice = row.purchaseNoPrice*(1 + this.maForm.taxRate/100) // this.equipmentList[val].purchasePrice = (row.purchaseTaxPrice/(1 + this.maForm.taxRate/100)).toFixed(2)
row.purchasePrice = row.purchaseNoPrice*(1 + this.maForm.taxRate/100) row.purchasePrice = (row.purchaseTaxPrice/(1 + this.maForm.taxRate/100)).toFixed(2)
}, },
purchasePriceChange(row,val){
// this.equipmentList[val].purchaseTaxPrice = (row.purchasePrice*(1 + this.maForm.taxRate/100)).toFixed(2)
row.purchaseTaxPrice = (row.purchasePrice*(1 + this.maForm.taxRate/100)).toFixed(2)
},
getParentsById(list, id) { getParentsById(list, id) {
for (let i in list) { for (let i in list) {
if (list[i].typeId == id) { if (list[i].typeId == id) {
@ -488,9 +530,14 @@ export default {
this.userList = response.data this.userList = response.data
}) })
}, },
/** 机具厂家 */ /** 物资厂家 */
supplierInfoList() { supplierInfoList() {
supplierInfoList().then((response) => { let param = {
pageNum: 1,
pageSize: 100,
keyWord:undefined
}
getListFacturer(param).then((response) => {
this.supplierList = response.rows this.supplierList = response.rows
}) })
}, },
@ -512,8 +559,8 @@ export default {
item3.typeName item3.typeName
item4.specificationType = item4.specificationType =
item4.typeName item4.typeName
this.$set(item4, 'purchaseTaxPrice', 0)
this.$set(item4, 'purchasePrice', 0) this.$set(item4, 'purchasePrice', 0)
this.$set(item4, 'purchaseNoPrice', 0)
}) })
} }
}) })
@ -552,17 +599,18 @@ export default {
this.$set(row, 'createTime', null) this.$set(row, 'createTime', null)
this.$set(row, 'productionTime', '') this.$set(row, 'productionTime', '')
// this.$set(row, 'supplierId', '') // this.$set(row, 'supplierId', '')
this.$set(row, 'purchaseTaxPrice', 0)
this.$set(row, 'purchasePrice', 0) this.$set(row, 'purchasePrice', 0)
this.$set(row, 'purchaseNum', 1) this.$set(row, 'purchaseNum', 1)
this.equipmentList.unshift(row) this.equipmentList.unshift(row)
} }
}, },
// //
// changeSupplier(supplierId) { changeSupplier(supplierId) {
// this.equipmentList.forEach((item) => { this.equipmentList.forEach((item) => {
// this.$set(item, 'supplierId', supplierId) this.$set(item, 'supplierId', supplierId)
// }) })
// }, },
// //
changeTime(time) { changeTime(time) {
console.log(time) console.log(time)
@ -580,10 +628,11 @@ export default {
this.maForm.arrivalTime = response.data.purchaseCheckInfo.arrivalTime this.maForm.arrivalTime = response.data.purchaseCheckInfo.arrivalTime
// this.maForm.purchaser = response.data.purchaser // this.maForm.purchaser = response.data.purchaser
this.maForm.remark = response.data.purchaseCheckInfo.remark this.maForm.remark = response.data.purchaseCheckInfo.remark
this.maForm.taxRate = response.data.purchaseCheckInfo.taxRate
// this.maForm.purchaseNumber = response.data.purchaseNumber // this.maForm.purchaseNumber = response.data.purchaseNumber
this.maForm.productionTime = response.data.purchaseCheckInfo.productionTime this.maForm.productionTime = response.data.purchaseCheckInfo.productionTime
this.equipmentList = response.data.purchaseCheckDetailsList this.equipmentList = response.data.purchaseCheckDetailsList
console.log(this.equipmentList)
// this.loading = false; // this.loading = false;
}) })
}, },
@ -814,8 +863,9 @@ export default {
obj.supplierId = '' obj.supplierId = ''
obj.createTime = null obj.createTime = null
obj.productionTime = '' obj.productionTime = ''
obj.purchasePrice = 0 obj.purchaseTaxPrice = 0
obj.purchaseNum = '' obj.purchaseTaxPrice = 0
obj.purchaseNum = 1
tempList.push(obj) tempList.push(obj)
break break
} }

View File

@ -139,7 +139,7 @@
<el-table-column <el-table-column
label="采购价格(元不含税)" label="采购价格(元不含税)"
align="center" align="center"
prop="purchaseNoTaxPrice" prop="purchasePrice"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column <el-table-column