|
@@ -41,7 +41,7 @@
|
|
|
<el-button size="large" type="warning" hc-btn @click="cycleClick">
|
|
|
查看报表
|
|
|
</el-button>
|
|
|
- <el-button size="large" type="danger" hc-btn>
|
|
|
+ <el-button size="large" type="danger" hc-btn :disabled="tableCheckedKeys.length < 1" @click="batchDel">
|
|
|
批量删除
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -53,7 +53,7 @@
|
|
|
<el-button size="small" type="primary" @click="editRowClick(row)">
|
|
|
修改
|
|
|
</el-button>
|
|
|
- <el-button size="small" type="danger">
|
|
|
+ <el-button size="small" type="danger" @click="delRowClick(row)">
|
|
|
删除
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -126,7 +126,7 @@
|
|
|
</HcDrawer>
|
|
|
|
|
|
<!-- 新增结算单 -->
|
|
|
- <HcDialog is-to-body bg-color="white" is-table widths="80%" title="新增结算单" :padding="false" :show="rowModal" :loading="addLoaing" @save="rowModalSave" @close="rowModalClose">
|
|
|
+ <HcDialog is-to-body bg-color="white" is-table widths="80%" :title="addTitle" :padding="false" :show="rowModal" :loading="addLoaing" @save="rowModalSave" @close="rowModalClose">
|
|
|
<div class="hc-settle-dialog-box">
|
|
|
<div id="settle-dialog-tree" class="hc-settle-dialog-tree">
|
|
|
<el-scrollbar>
|
|
@@ -135,6 +135,7 @@
|
|
|
</div>
|
|
|
<div id="settle-dialog-table" class="hc-settle-dialog-table">
|
|
|
<div class="dialog-table-header">
|
|
|
+ <i class="ri-asterisk" style="color:red;line-height: 40px;padding-right: 5px;" />
|
|
|
<div class="w-44">
|
|
|
<el-select v-model="jqnumber" block clearable placeholder="请选择结算期数" size="large">
|
|
|
<el-option v-for="item in numberOptions" :key="item.id" :label="item.number" :value="item.number" />
|
|
@@ -227,6 +228,7 @@ import split from 'split.js'
|
|
|
import settleApi from '~api/settle/index.js'
|
|
|
import { arrToId, getArrValue } from 'js-fast-way'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
+import { delMessageV2 } from '~com/message/index.js'
|
|
|
const useAppState = useAppStore()
|
|
|
const projectId = ref(useAppState.getProjectId)
|
|
|
//树节点被点击
|
|
@@ -304,6 +306,7 @@ const drawerClose = () => {
|
|
|
//弹窗
|
|
|
const rowModal = ref(false)
|
|
|
const formModel = ref({})
|
|
|
+const addTitle = ref('新增结算单')
|
|
|
|
|
|
// 初始化设置拖动分割线
|
|
|
const splitvar = ref(null)
|
|
@@ -362,6 +365,7 @@ const treeNodeTap1 = ({ node, data }) => {
|
|
|
const addRowClick = () => {
|
|
|
formModel.value = {}
|
|
|
rowModal.value = true
|
|
|
+ addTitle.value = '新增结算单'
|
|
|
searchForm1.value.type = '1'
|
|
|
rowagreementIds.value = ''
|
|
|
searchForm1.value.number = ''
|
|
@@ -374,17 +378,57 @@ const addRowClick = () => {
|
|
|
|
|
|
//编辑
|
|
|
const rowagreementIds = ref('')
|
|
|
+const editId = ref('')
|
|
|
const editRowClick = (row) => {
|
|
|
rowagreementIds.value = row.agreementIds
|
|
|
searchForm1.value.type = row.type.toString()
|
|
|
changType( searchForm1.value.type)
|
|
|
- jqnumber.value = row.stageId
|
|
|
+ jqnumber.value = row.stage
|
|
|
+ editId.value = row.id
|
|
|
+ addTitle.value = '修改结算单'
|
|
|
formModel.value = {}
|
|
|
rowModal.value = true
|
|
|
nextTick(() => {
|
|
|
setSplitDom()
|
|
|
})
|
|
|
}
|
|
|
+//删除协议
|
|
|
+const delRowClick = (row)=>{
|
|
|
+ delMessageV2(async (action, instance, done) => {
|
|
|
+ if (action === 'confirm') {
|
|
|
+ instance.confirmButtonLoading = true
|
|
|
+ removeRow(row.id)
|
|
|
+ instance.confirmButtonLoading = false
|
|
|
+ done()
|
|
|
+ } else {
|
|
|
+ done()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+//批量删除
|
|
|
+const batchDel = ()=>{
|
|
|
+ const ids = arrToId(tableCheckedKeys.value)
|
|
|
+ delMessageV2(async (action, instance, done) => {
|
|
|
+ if (action === 'confirm') {
|
|
|
+ instance.confirmButtonLoading = true
|
|
|
+ removeRow(ids)
|
|
|
+ instance.confirmButtonLoading = false
|
|
|
+ done()
|
|
|
+ } else {
|
|
|
+ done()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+const removeRow = async (id)=>{
|
|
|
+ const { error, code } = await settleApi.remove( { ids:id })
|
|
|
+ //判断状态
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message?.success('删除成功')
|
|
|
+ getTableData()
|
|
|
+ } else {
|
|
|
+ window.$message?.error('删除失败')
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
//保存
|
|
|
const addLoaing = ref(false)
|
|
@@ -410,10 +454,13 @@ const rowModalSave = async () => {
|
|
|
stage:stage,
|
|
|
stageId:stageId,
|
|
|
agreementIds:agreementIds,
|
|
|
+ id:editId.value,
|
|
|
})
|
|
|
addLoaing.value = false
|
|
|
if (!error && code === 200) {
|
|
|
window.$message.success(msg)
|
|
|
+ getTableData()
|
|
|
+ rowModal.value = false
|
|
|
|
|
|
}
|
|
|
}
|