Newer
Older
KaiFengPC / src / views / project / projectInformation / todoDon.vue
@zhangdeliang zhangdeliang on 23 May 8 KB 初始化项目
  1. <template>
  2. <div class="water-analysis-page">
  3. <el-table :key="isFlag" :data="tableData" v-loading="tableLoading" max-height="500">
  4. <el-table-column type="index" width="55" label="序号" />
  5. <el-table-column :label="i.lable" :prop="i.value" show-overflow-tooltip v-for="i in projectInformationCloum">
  6. <template #default="{ row }" v-if="i.value == 'projectName'">
  7. <span @click="onCheck(row, 2, '详情')" class="projectName"> {{ row.projectName }}</span>
  8. </template>
  9. <template #default="{ row }" v-if="i.value == 'projectStatus'">
  10. <dict-tag :options="project_status" :value="row.projectStatus" />
  11. </template>
  12. <template #default="{ row }" v-if="i.value == 'valuation'"> {{ row.valuation || 0 }}(万元) </template>
  13. <template #default="{ row }" v-if="i.value == 'projectProgress'"> {{ row.projectProgress || 0 }}% </template>
  14. <template #default="{ row }" v-if="i.value == 'completeTotalInvest'"> {{ row.completeTotalInvest || 0 }}万元 </template>
  15. <template #default="{ row }" v-if="i.value == 'completeSpongeInvest'"> {{ row.completeSpongeInvest || 0 }}万元 </template>
  16. <template #default="{ row }" v-if="i.value == 'startTime'">
  17. {{ row.startTime.substring(0, 10) }}
  18. </template>
  19. <template #default="{ row }" v-if="i.value == 'status'">
  20. <span style="color: red" v-if="row.fromStatus">驳回</span>
  21. <dict-tag v-else :options="dangerous_status" :value="row.status" />
  22. </template>
  23. <template #default="{ row }" v-if="i.value == 'constructUnit'">
  24. <dict-tag :options="unit_list" :value="row.constructUnit" />
  25. {{ unit_listM(row.constructUnit) }}
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="操作" width="280">
  29. <template #default="{ row }">
  30. <el-button link type="primary" icon="View" @click="onCheck(row, 2, '详情')">详情</el-button>
  31. <!-- <el-button link type="success" plain icon="DArrowRight" @click="onCheck(row, 6, '转交')"
  32. >转交</el-button
  33. > -->
  34. <el-button v-show="FormList.belong == 1" link type="warning" icon="Edit" @click="onCheck(row, 5, '修改')">修改</el-button>
  35. <el-button v-show="FormList.belong == 1" icon="Delete" link type="danger" @click="onCheck(row, 4, '删除')">删除</el-button>
  36.  
  37. <!-- <el-button link type="danger" @click="onCheck(row, 3)">删除</el-button> -->
  38. </template>
  39. </el-table-column>
  40. </el-table>
  41. <pagination
  42. v-show="totals > 0"
  43. :total="totals"
  44. v-model:page="FormList.pageNum"
  45. v-model:limit="FormList.pageSize"
  46. @pagination="getInfoList(FormList)"
  47. />
  48. </div>
  49. <el-dialog v-model="visible" :title="'项目信息' + title" :modal-append-to-body="false" :close-on-click-modal="false" width="92%">
  50. <tableDalgo ref="tableDalgoRef" @onModalClose="onModalClose" v-if="visible"></tableDalgo>
  51. <template #footer>
  52. <div class="dialog-footer">
  53. <el-button v-show="typeList.type != 2" type="primary" @click="submit">保存</el-button>
  54. <el-button @click="visible = false">关闭</el-button>
  55. </div>
  56. </template>
  57. </el-dialog>
  58. <el-dialog v-model="editvisible" title="项目信息修改" :modal-append-to-body="false" :close-on-click-modal="false" width="80%">
  59. <addDalg ref="tableDalgoRef" :typeList="typeList" @onModalClose="onModalClose" v-if="editvisible"></addDalg>
  60. <template #footer>
  61. <div class="dialog-footer">
  62. <el-button v-show="typeList.type != 2" type="primary" @click="submit">保存</el-button>
  63. <el-button @click="editvisible = false">关闭</el-button>
  64. </div>
  65. </template>
  66. </el-dialog>
  67. <el-dialog v-model="zjtdialgo" title="项目信息转交" :modal-append-to-body="false" :close-on-click-modal="false" width="50%">
  68. <el-form label-width="auto" ref="ruleForm" :model="FormList" :key="isKey">
  69. <el-form-item label="接收人:" props="dealUsers">
  70. <el-select clearable v-model="FormList.dealUsers" style="width: 100%" class="m-2" placeholder="指定处理人" size="mini">
  71. <el-option v-for="item in personList" :key="item.userId" :label="item.nickName" :value="item.userId" />
  72. </el-select>
  73. </el-form-item>
  74.  
  75. <el-form-item label="转交原因:" props="supplement">
  76. <el-input v-model="FormList.supplement" type="textarea" placeholder="转交原因" />
  77. </el-form-item>
  78. <el-form-item label="项目资料是否已经上传平台:" props="supplement">
  79. <el-radio-group v-model="FormList.Istable" class="ml-4">
  80. <el-radio label="1" size="large"></el-radio>
  81. <el-radio label="2" size="large"></el-radio>
  82. </el-radio-group>
  83. </el-form-item>
  84. </el-form>
  85. <template #footer>
  86. <el-button type="primary" @click="contentClick(true)">保存</el-button>
  87. <el-button @click="zjtdialgo = false">关闭</el-button>
  88. </template>
  89. </el-dialog>
  90. </template>
  91. <script setup>
  92. import { getInfo, projectInfoDelete, projectInfoGet, projectInfoAdd, userList } from '@/api/project/projectInformation';
  93. import { projectInformationCloum } from '@/utils/cloums';
  94.  
  95. const personList = ref([]);
  96. import { ElMessage, ElMessageBox } from 'element-plus';
  97. import tableDalgo from './tableDalgo.vue';
  98. import { formatMonths } from '@/utils';
  99. const ruleForm = ref(null);
  100. const { proxy } = getCurrentInstance();
  101. const { project_status, dangerous_status } = proxy.useDict('project_status', 'dangerous_status');
  102. import { projectCompany } from '@/api/project/projectTable';
  103. import addDalg from './addDalg.vue';
  104.  
  105. let visible = ref(false);
  106. let isFlag = ref(1);
  107. let tableDalgoRef = ref();
  108. const title = ref();
  109. let zjtdialgo = ref(false);
  110. const FormList = ref({
  111. pageNum: 1,
  112. pageSize: 10,
  113. belong: '1',
  114. });
  115. const totals = ref(0);
  116. const unit_list = ref([]);
  117. const editvisible = ref(false);
  118. //动态组件
  119. let dataForm = reactive({
  120. date: formatMonths(new Date()),
  121. tableData: '',
  122. tableDateTwo: '',
  123. tableLoading: true,
  124. });
  125. let { date, tableData, tableDateTwo, tableLoading } = toRefs(dataForm);
  126. //获取列表数据
  127. const getInfoList = async prams => {
  128. FormList.value.belong = prams.belong;
  129. tableLoading.value = true;
  130. let { data, total } = await getInfo(prams);
  131. tableData.value = data;
  132. totals.value = total;
  133. tableLoading.value = false;
  134. };
  135. defineExpose({ getInfoList });
  136. let typeList = ref({});
  137. const onCheck = (row, ty, t) => {
  138. title.value = t;
  139. projectInfoGet(row.id).then(({ code, data }) => {
  140. if (code == 200) {
  141. typeList.value = { ...data, type: ty };
  142. if (ty == 3 || ty == 2) {
  143. visible.value = true;
  144. } else if (ty == 4) {
  145. ElMessageBox.confirm(`您确定删除项目信息吗?`, '提示', {
  146. confirmButtonText: '确定',
  147. cancelButtonText: '取消',
  148. type: 'warning',
  149. }).then(() => {
  150. projectInfoDeleteM(typeList.value);
  151. });
  152. } else if (ty == 5) {
  153. editvisible.value = true;
  154. } else if (ty == 6) {
  155. zjtdialgo.value = true;
  156. }
  157. }
  158. });
  159. };
  160. provide('typeList1', typeList);
  161. //删除
  162. const projectInfoDeleteM = async id => {
  163. let { dealUsers, workflowUserId } = id;
  164. if (dealUsers?.length > 0 && Array.isArray(dealUsers)) {
  165. typeList.value.dealUsers = dealUsers?.join(',');
  166. }
  167. if (workflowUserId?.length > 0 && Array.isArray(workflowUserId)) {
  168. typeList.value.workflowUserId = workflowUserId.join(',');
  169. }
  170. typeList.value.operation = 'delete';
  171. typeList.value.content = JSON.stringify([
  172. { type: 'new', projectInfo: { ...typeList.value } },
  173. { type: 'old', projectInfo: { ...typeList } },
  174. ]);
  175. projectInfoAdd(typeList.value).then(({ code }) => {
  176. if (code == 200) {
  177. ElMessage({
  178. message: '删除成功',
  179. type: 'success',
  180. });
  181. getInfoList(FormList.value);
  182. }
  183. });
  184. };
  185. //撤回操作
  186. const Returncnfiorm = async id => {
  187. let { code } = await projectInfoDelete(id);
  188. };
  189. function onModalClose() {
  190. visible.value = false;
  191. editvisible.value = false;
  192. getInfoList(FormList.value);
  193. }
  194. function submit() {
  195. tableDalgoRef.value.submit();
  196. }
  197. const projectCompanyM = async () => {
  198. let { data } = await projectCompany();
  199. unit_list.value = data;
  200. };
  201. function unit_listM(v) {
  202. console.log('unit_listunit_list', unit_list.value, v);
  203. let arr = unit_list.value.filter(i => {
  204. return v == i.id;
  205. });
  206. return arr[0]?.makeCompanyName;
  207. }
  208.  
  209. const userListM = async () => {
  210. let { data } = await userList();
  211. personList.value = data;
  212. };
  213. // 转交
  214. function contentClick(v) {}
  215. onMounted(() => {
  216. projectCompanyM();
  217. userListM();
  218. });
  219. </script>
  220. <style lang="scss" scoped>
  221. .water-analysis-page {
  222. padding: 20px;
  223. height: 90vh;
  224. :deep .el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active {
  225. font-size: 18px;
  226. color: rgb(255, 255, 255);
  227. background-color: rgb(22, 132, 252);
  228. border-left: 1px solid rgb(22, 132, 252);
  229. }
  230. }
  231. </style>