This commit is contained in:
zmj 2024-03-21 18:01:06 +08:00
parent 433acfacef
commit d792a9665e
3 changed files with 27 additions and 26 deletions

View File

@ -1,7 +1,7 @@
{
"editor.formatOnSave": true,
"[vue]": {
"editor.defaultFormatter": "Vue.volar"
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {

View File

@ -239,8 +239,8 @@ import projectTable from '@/components/project/index.vue'
import suppliertable from '@/components/supplier/index.vue'
import subpackageTable from '@/components/subpackage_budget_detail/index.vue'
import { useDictData } from '@/hooks/useDictOptions'
import { paymentplanLists } from '@/api/paymentplan'
import { apiSubcontractingContractDetailLists } from '@/api/subcontracting_contract_detail'
import { paymentplanLists,paymentplanDelete } from '@/api/paymentplan'
import { apiSubcontractingContractDetailLists,apiSubcontractingContractDetailDelete } from '@/api/subcontracting_contract_detail'
import { apiSubcontractingContractAdd, apiSubcontractingContractEdit, apiSubcontractingContractDetail } from '@/api/subcontracting_contract'
let props = defineProps({
project: Object
@ -279,15 +279,16 @@ const handleAdd = (row: any) => {
paymentList.splice(index + 1, 0, {});
};
const handleDelete = (row: any) => {
if (paymentList.length <= 1) return
const handleDelete = async(row: any) => {
if(row.id) await paymentplanDelete({id:row.id})
// row
const index = paymentList.indexOf(row);
paymentList.splice(index, 1);
};
const handleDelete1 = (row: any) => {
const handleDelete1 = async(row: any) => {
if(row.id) await apiSubcontractingContractDetailDelete({id:row.id})
// row
const index = subcontractList.indexOf(row);
subcontractList.splice(index, 1);
@ -299,26 +300,29 @@ const popupTitle = computed(() => {
//
const procurementList = (id) => {
apiSubcontractingContractDetailLists({ 'page_no': 1, 'page_size': 5000, 'contract_id': id }).then((res) => {
const data = res.lists.map((item: any) => ({
'id': item.id,
'subpackage_budget_id': item.subpackage_budget_id,
'work_type': item.work_type,
'work_content': item.work_content,
'project_features': item.project_features,
'unit': item.unit,
'num': item.num,
'price': item.price,
'tax_rate': dictData.tax_rate.find((items) => items.name == item.tax_rate)
}))
subcontractList.splice(0, subcontractList.length, ...data);
apiSubcontractingContractDetailLists({'contract_id': id }).then((res) => {
// const data = res.lists.map((item: any) => ({
// 'id': item.id,
// 'subpackage_budget_id': item.subpackage_budget_id,
// 'work_type': item.work_type,
// 'work_content': item.work_content,
// 'project_features': item.project_features,
// 'unit': item.unit,
// 'num': item.num,
// 'price': item.price,
// 'tax_rate': dictData.tax_rate.find((items) => items.name == item.tax_rate)
// }))
// subcontractList.splice(0, subcontractList.length, ...data);
Object.assign(subcontractList,res.lists)
})
}
//
const paymentplanList = (id: any) => {
paymentplanLists({ 'page_no': 1, 'page_size': 5000, 'contract_type': 1, 'contract_id': id }).then((res) => {
paymentplanLists({ 'contract_id': id }).then((res) => {
const data = res.lists.map((item: any) => ({
id:item.id,
'period': item.period,
'pay_date': item.pay_date,
'amount': item.amount,
@ -402,10 +406,6 @@ const retention_money = computed(() => {
})
//
const formRules = reactive<any>({
@ -429,6 +429,8 @@ const setFormData = async (data: Record<any, any>) => {
supplier_name.value = data.supplier_name
supplier_code.value = data.supplier_code
}
const getDetail = async (row: Record<string, any>) => {

View File

@ -24,8 +24,7 @@
@click="handleDelete(selectData)">
删除
</el-button> -->
<export-data class="ml-2.5 float-right" :fetch-fun="apiSubcontractingContractDetailLists"
:params="queryParams" :page-size="pager.size" />
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />