123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- <template>
- <div class="page-container list-container">
- <!-- 功能按钮区 -->
- <div class="list-btns-container">
- <el-button type="primary" size="small" icon="Plus" @click="handleAdd"
- v-hasPermi="['business:examine:add']">新增</el-button>
- <el-button type="success" size="small" icon="Edit" :disabled="single" @click="handleUpdate"
- v-hasPermi="['business:examine:edit']">修改</el-button>
- <el-button type="danger" size="small" icon="Delete" :disabled="multiple" @click="handleDelete"
- v-hasPermi="['business:examine:remove']">删除</el-button>
- <el-button type="warning" size="small" icon="Download" @click="handleExport"
- v-hasPermi="['business:examine:export']">导出</el-button>
- <!--<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
- </div>
- <!-- 搜索区 -->
- <el-form class="list-search-container" size="small" :model="queryParams" ref="queryRef" :inline="true"
- label-width="68px">
- <el-form-item label="所属期:" prop="currentPeriod">
- <el-input v-model="queryParams.currentPeriod" placeholder="请输入所属期" clearable
- @keyup.enter="handleQuery" />
- </el-form-item>
- <el-form-item label="委托来源:" prop="entrustCome">
- <el-input v-model="queryParams.entrustCome" placeholder="请输入委托来源" clearable
- @keyup.enter="handleQuery" />
- </el-form-item>
- <el-form-item label="取消理由:" prop="cancelReason">
- <el-input v-model="queryParams.cancelReason" placeholder="请输入取消理由" clearable
- @keyup.enter="handleQuery" />
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
- <el-button icon="Refresh" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <!-- 列表区 -->
- <el-table v-loading="loading" :data="examineList" size="small" border height="100%"
- @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="客户名称" align="center" prop="companyName" />
- <el-table-column label="税号" align="center" prop="socialCreditCode" />
- <el-table-column label="项目" align="center" prop="taskName" />
- <el-table-column label="所属期" align="center" prop="currentPeriod">
- <template #default="scope">
- {{ scope.row.currentPeriod.substr(0, 7) }}
- </template>
- </el-table-column>
- <el-table-column label="提交时间" align="center" prop="createTime" />
- <el-table-column label="委托来源" align="center" prop="fromTenant" />
- <el-table-column label="取消理由" align="center" prop="cancelReason" />
- <el-table-column label="状态" align="center" prop="status">
- <template #default="scope">
- <div v-if="scope.row.status === 0" type="danger">待确认</div>
- <div v-else-if="scope.row.status === 1" type="success">已同意</div>
- <div v-else type="info">已拒绝</div>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
- <template #default="scope">
- <el-button link type="warning" size="small" icon="Edit" @click="handleUpdate(scope.row)"
- v-hasPermi="['business:examine:edit']">同意</el-button>
- <el-button link type="danger" size="small" icon="Delete" @click="handleDelete(scope.row)"
- v-hasPermi="['business:examine:remove']">拒绝</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- 分页 -->
- <pagination v-show="total>0" :total="total" v-model:page="queryParams.pageNum"
- v-model:limit="queryParams.pageSize" @pagination="getList" />
- <!-- 表单 -->
- <examine-form ref="examineRef" :get-list="getList"></examine-form>
- <el-dialog title="拒绝取消" v-model="cancelEntrust" width="720px" append-to-body size="small" draggable
- :close-on-click-modal="false">
- <el-form-item label="拒绝理由" prop="refuseReason" style="margin-top: 10px">
- <el-input v-model="form.refuseReason" type="textarea" placeholder="请输入取消理由" />
- </el-form-item>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" icon="Finished" size="small" @click="submitForm">确 定</el-button>
- <el-button icon="close" size="small" @click="cancelEntrust = false">取 消</el-button>
- </div>
- </template>
- </el-dialog>
- </div>
- </template>
- <script setup name="Examine">
- import { listExamine, delExamine, refuse } from "@/api/business/examine";
- import {
- okDelEntrust,
- } from "@/api/business/entrust/currentWorkOrder";
- const { proxy } = getCurrentInstance()
- /** 字典数组区 */
- /** 查询 对象 */
- const examineList = ref([]);
- const loading = ref(true);
- const ids = ref([])
- const single = ref(true);
- const cancelEntrust = ref(false);
- const multiple = ref(true);
- const total = ref(0);
- /** 查询对象 */
- const queryParams = ref({
- pageNum: 1,
- pageSize: 10,
- currentPeriod: null,
- entrustCome: null,
- cancelReason: null,
- status: null,
- })
- const form = ref({});
- /*********************** 方法区 ****************************/
- /** 查询企业租户列表 */
- function getList() {
- loading.value = true;
- listExamine(queryParams.value).then(response => {
- examineList.value = response.rows;
- total.value = response.total;
- loading.value = false;
- });
- }
- /** 搜索按钮操作 */
- function handleQuery() {
- queryParams.value.pageNum = 1;
- getList();
- }
- /** 重置按钮操作 */
- function resetQuery() {
- proxy.resetForm("queryRef");
- handleQuery();
- }
- // 多选框选中数据
- function handleSelectionChange(selection) {
- ids.value = selection.map(item => item.id);
- single.value = selection.length != 1;
- multiple.value = !selection.length;
- }
- /** 新增按钮操作 */
- function handleAdd() {
- proxy.$refs.examineRef.open()
- }
- /** 修改按钮操作 */
- function handleUpdate(row) {
- proxy.$modal
- .confirm("确定同意么?")
- .then((_) => {
- const entrust = {
- workMonth: row.currentPeriod,
- workOrderIds: [row.workOrderId],
- examineId: row.id
- };
- okDelEntrust(entrust).then((res) => {
- proxy.$modal.msgSuccess("同意成功");
- getList();
- });
- })
- .catch((_) => { });
- }
- function submitForm() {
- if(form.value.refuseReason == null){
- proxy.$modal.msgError("请填写拒绝理由");
- return;
- }
- console.log(23,form.value);
- refuse(form.value).then((res) => {
- proxy.$modal.msgSuccess("操作成功");
- getList();
- cancelEntrust.value = false;
- });
- }
- /** 删除按钮操作 */
- function handleDelete(row) {
- cancelEntrust.value = true;
- form.value.id = row.id
- console.log(form.value);
-
- }
- /** 导出按钮操作 */
- function handleExport() {
- proxy.download('business/examine/export', {
- ...queryParams.value
- }, `examine_${new Date().getTime()}.xlsx`)
- }
- getList();
- </script>
|