|
@@ -319,14 +319,37 @@
|
|
|
<el-form-item :prop="'costControlDetailList.' + $index + '.accountSubjectsId'" :rules="rules.accountSubjectsId"
|
|
|
:inline-message="true" class="margin-b-0">
|
|
|
<el-tree-select v-model="row.accountSubjectsId" :data="accountSubjectsData" check-strictly :render-after-expand="false"
|
|
|
- node-key="id" :props="defaultProps" style="width:100%" disabled />
|
|
|
+ node-key="id" :props="defaultProps" style="width:100%" :disabled="getAccountSubjectsId" />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="核算项目名称" width="110" prop="accountSubjectsName" v-if="isShowAtt('accountSubjectsId','detailObj')">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-input v-model="row.accountSubjectsName" placeholder=" " :disabled="getAccountSubjectsId">
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="核算项目" width="100" prop="accountSubjectsName" v-if="isShowAtt('accountSubjectsId','detailObj')">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-input v-model="row.accountSubjectsName" placeholder=" " :disabled="getAccountSubjectsId">
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="记账金额" width="140" prop="money" v-if="isShowAtt('money','detailObj')">
|
|
|
+ <template #default="{ row, $index }">
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-form-item :prop="'costControlDetailList.' + $index + '.money'" :rules="rules.money" :inline-message="true" class="margin-b-0">
|
|
|
+ <el-input-number onmousewheel="return false;" v-model="row.money" placeholder=" " style="width: 100%" :precision="2"
|
|
|
+ :controls="false" :min="0" :disabled="getAccountSubjectsId" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="核算项目名称" width="110" prop="accountSubjectsName" v-if="isShowAtt('accountSubjectsId','detailObj')" />
|
|
|
- <el-table-column label="核算项目" width="100" prop="accountSubjectsName" v-if="isShowAtt('accountSubjectsId','detailObj')" />
|
|
|
- <el-table-column label="记账金额" width="100" prop="money" v-if="isShowAtt('money','detailObj')" />
|
|
|
<el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus()">
|
|
|
<template #default="{ $index }">
|
|
|
<el-button type="primary" link @click="handleDelete($index)">删除</el-button>
|
|
@@ -483,7 +506,7 @@ const formConfig = computed(() => {
|
|
|
prop: "voucherNo",
|
|
|
label: "记账凭证号",
|
|
|
itemType: "text",
|
|
|
- disabled: false,
|
|
|
+ disabled: !isHaveFinance.value || !isHaveAccount.value,
|
|
|
itemWidth: 25,
|
|
|
isShow: isShowAtt("voucherNo", "mainObj"),
|
|
|
},
|
|
@@ -959,11 +982,14 @@ const getDeptData = (val) => {
|
|
|
deptData.value = proxy.handleTree(res.data, "deptId");
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
+// 本期应付
|
|
|
const getCurrentPayableDisabled = ref(false);
|
|
|
+// 记账科目
|
|
|
+const getAccountSubjectsId = ref(false);
|
|
|
const changeCostType = (val) => {
|
|
|
currentCostTypeData.value = paymentTypeData.value.find((x) => x.value == val);
|
|
|
formData.data.tradeType = currentCostTypeData.value.tradeType;
|
|
|
+ // 本期应付
|
|
|
if (
|
|
|
currentCostTypeData.value.name.indexOf("备用金申请") != -1 ||
|
|
|
currentCostTypeData.value.name.indexOf("借款") != -1
|
|
@@ -972,6 +998,23 @@ const changeCostType = (val) => {
|
|
|
} else {
|
|
|
getCurrentPayableDisabled.value = true;
|
|
|
}
|
|
|
+ // 记帐科目
|
|
|
+ if (
|
|
|
+ currentCostTypeData.value.name.indexOf("备用金申请") != -1 ||
|
|
|
+ currentCostTypeData.value.name.indexOf("借款") != -1 ||
|
|
|
+ currentCostTypeData.value.name.indexOf("快递") != -1 ||
|
|
|
+ currentCostTypeData.value.name.indexOf("货款(预付)") != -1 ||
|
|
|
+ currentCostTypeData.value.name.indexOf("归还") != -1
|
|
|
+ ) {
|
|
|
+ getAccountSubjectsId.value = true;
|
|
|
+ } else {
|
|
|
+ if (isHaveAccount.value || isHaveFinance.value) {
|
|
|
+ getAccountSubjectsId.value = false;
|
|
|
+ } else {
|
|
|
+ getAccountSubjectsId.value = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (formData.data && formData.data.applyUserId) {
|
|
|
changApplyUserId(formData.data.applyUserId);
|
|
|
}
|
|
@@ -1638,13 +1681,25 @@ const getAllData = (businessId) => {
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
+// 普通表单
|
|
|
const isDisabled = ref(false);
|
|
|
+// 会计
|
|
|
+const isHaveAccount = ref(false);
|
|
|
+// 财务
|
|
|
+const isHaveFinance = ref(false);
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
formData.data.companyIdSet.push(proxy.useUserStore().user.companyId);
|
|
|
getDeptData(formData.data.companyId);
|
|
|
isDisabled.value = judgeStatus();
|
|
|
// formOption.disabled = judgeStatus();
|
|
|
+ console.log(proxy.useUserStore().roles, "WDAWDS");
|
|
|
+ if (proxy.useUserStore().roles.includes("accountant")) {
|
|
|
+ isHaveAccount.value = true;
|
|
|
+ }
|
|
|
+ if (proxy.useUserStore().roles.includes("cfo")) {
|
|
|
+ isHaveFinance.value = true;
|
|
|
+ }
|
|
|
if (route.query && route.query.businessId && route.query.processType) {
|
|
|
let businessId = route.query.businessId;
|
|
|
getAllData(businessId);
|