index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. <template>
  2. <div>
  3. <div class="d-flex flex-between">
  4. <div>
  5. </div>
  6. <el-form label-width="100px" :inline="true">
  7. <el-form-item prop="state_value">
  8. <el-select class="mr10" v-model="state_value" placeholder="请选择类别">
  9. <el-option v-for="item in type_list" :key="item.value" :label="item.label" :value="item.value" ></el-option>
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item prop="keyword">
  13. <el-input placeholder="请输入搜索关键字" v-model="keyword" clearable @clear="getListData"></el-input>
  14. </el-form-item>
  15. <el-button type="primary" class="ml5" @click="getListData">搜索</el-button>
  16. <el-tooltip class="item" effect="dark" content="用户初次预览公文,需通过此按钮安转WPS预览组件。无组件支持,将出现不可预览公文情况。" placement="bottom-end">
  17. <el-button type="info" plain icon="el-icon-info" @click="initWpsAss" >wps组件初始化</el-button>
  18. </el-tooltip>
  19. </el-form>
  20. </div>
  21. <div v-if="false">
  22. <el-table :data="tableData" tooltip-effect="dark" v-loading="loading" style="width: 100%" @selection-change="handleSelectionChange">
  23. <el-table-column type="selection" align="center" width="55"></el-table-column>
  24. <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
  25. <el-table-column label="类型" prop="lb_name" show-overflow-tooltip></el-table-column>
  26. <el-table-column label="标题" prop="gw_title" show-overflow-tooltip></el-table-column>
  27. <el-table-column label="发文字号" prop="gw_zh" show-overflow-tooltip></el-table-column>
  28. <el-table-column label="发起人" prop="gw_fqr_name" show-overflow-tooltip></el-table-column>
  29. <el-table-column label="发起科室" prop="gw_fqks_name" show-overflow-tooltip></el-table-column>
  30. <el-table-column label="发起时间" prop="create_dateline" show-overflow-tooltip></el-table-column>
  31. <el-table-column label="当前步骤" >
  32. <template slot-scope="scope">
  33. {{scope.row.gw_bz!='' ? scope.row.gw_bz : '--'}}
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="当前审核人">
  37. <template slot-scope="scope">
  38. {{scope.row.gw_shr!='' ? scope.row.gw_shr : '--'}}
  39. </template>
  40. </el-table-column>
  41. <el-table-column label="状态" >
  42. <template slot-scope="scope">
  43. <div>{{scope.row.gw_status}}</div>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="操作" width="200">
  47. <template slot-scope="scope">
  48. <el-button type="text" v-if="scope.row.is_check=='0'" @click="handleCheck(scope.row)">审核</el-button>
  49. <el-button type="text" v-else @click="handleCheck(scope.row)">详情</el-button>
  50. </template>
  51. </el-table-column>
  52. </el-table>
  53. </div>
  54. <!-- 可拖拉table -->
  55. <div class="sortAbleTable" >
  56. <el-table :data="tableData" row-key="gw_id" border style="width: 100%">
  57. <el-table-column type="selection" align="center" width="55"></el-table-column>
  58. <el-table-column type="index" label="序号" width="100" align="center" />
  59. <el-table-column
  60. v-for="(item, index) in colList"
  61. align="center"
  62. show-overflow-tooltip
  63. :key="`col_${index}`"
  64. :prop="dropCol[index].prop"
  65. :label="item.label"
  66. :min-width="item.minWidth"
  67. >
  68. <template v-slot="scope">
  69. <span v-if="dropCol[index].prop == 'date'" style="color: blue">
  70. {{ scope.row[dropCol[index].prop] }}
  71. </span>
  72. <span v-else-if="dropCol[index].prop == 'gw_status'" :class="scope.row.gw_status_option_k=='4' ? 'red' : (scope.row.gw_status_option_k=='5' ? 'green' : '')">
  73. {{ scope.row[dropCol[index].prop] }}
  74. </span>
  75. <span v-else>
  76. {{ scope.row[dropCol[index].prop] }}
  77. </span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="操作" width="130px">
  81. <template slot-scope="scope">
  82. <el-button type="text" v-if="scope.row.is_check=='0'" @click="handleCheck(scope.row)">审核</el-button>
  83. <el-button type="text" v-else @click="handleCheck(scope.row)">详情</el-button>
  84. <el-button type="text" @click="downloadFj(scope.row)" v-if="scope.row.gw_fj">下载附件</el-button>
  85. </template>
  86. </el-table-column>
  87. </el-table>
  88. <footer class="flex-item-none" style="display: flex; justify-content: flex-end; margin-top: 30px">
  89. <el-pagination background layout="total,prev, pager, next" :page-size="limit" :total="total"
  90. :current-page.sync="cur_page" @current-change="handleCurrentChange"></el-pagination>
  91. </footer>
  92. </div>
  93. </div>
  94. </template>
  95. <script>
  96. import { dbfw_list, org_users } from "./itemApi";
  97. import { useUserStore } from "@/stores/user";
  98. const { real_name, dept_ids } = useUserStore();
  99. import Sortable from 'sortablejs';
  100. import colDrap from "../../../utils/drag";
  101. import { getFullUrl } from "@/utils/helper";
  102. import { download, download2,download3} from "@/utils/request";
  103. export default {
  104. name: "bbtj",
  105. data() {
  106. return {
  107. state_value: "",
  108. keyword: "",
  109. type_list: [
  110. {
  111. label: '全部',
  112. value:'0'
  113. },
  114. {
  115. label: '待审核',
  116. value:'1'
  117. },
  118. {
  119. label: '已审核',
  120. value:'2'
  121. }
  122. ],
  123. tableData: [],
  124. type_value: "",
  125. multipleSelection:[],
  126. limit: 10,
  127. total: 0,
  128. cur_page: 1,
  129. yearData:[{
  130. value: '2016',
  131. label: '2016年'
  132. }, {
  133. value: '2017',
  134. label: '2017年'
  135. }, {
  136. value: '2018',
  137. label: '2018年'
  138. }, {
  139. value: '2019',
  140. label: '2019年'
  141. }, {
  142. value: '2020',
  143. label: '2020年'
  144. },{
  145. value: '2021',
  146. label: '2021年'
  147. }, {
  148. value: '2022',
  149. label: '2022年'
  150. }, {
  151. value: '2023',
  152. label: '2023年'
  153. }, {
  154. value: '2024',
  155. label: '2024年'
  156. }, {
  157. value: '2025',
  158. label: '2025年'
  159. }, {
  160. value: '2026',
  161. label: '2026年'
  162. }, {
  163. value: '2027',
  164. label: '2027年'
  165. }, {
  166. value: '2028',
  167. label: '2028年'
  168. }, {
  169. value: '2029',
  170. label: '2029年'
  171. }, {
  172. value: '2030',
  173. label: '2030年'
  174. }],
  175. dialogFormVisible: false,
  176. showType:[],
  177. dialogForm: {
  178. bbmc: '',
  179. year: '',
  180. valiType:[]
  181. },
  182. rules_check: {
  183. bbmc: [
  184. { required: true, message: '请输入报表名称', trigger: 'blur'}
  185. ],
  186. year: [
  187. { required: true, message: '请选择年份', trigger: 'change'}
  188. ],
  189. valiType: [
  190. { type: 'array', required: true, message: '请选择类型', trigger: 'change' }
  191. ]
  192. },
  193. title: "",
  194. isEdit: false,
  195. id: "",
  196. loading: false,
  197. userList: [],
  198. //动态列数组
  199. colList: [
  200. {
  201. label: "类型",
  202. prop: "lb_name",
  203. minWidth: 100,
  204. },
  205. {
  206. label: "标题",
  207. prop: "gw_title",
  208. minWidth: 100,
  209. },
  210. {
  211. label: "发文字号",
  212. prop: "gw_zh",
  213. minWidth: 100,
  214. },
  215. {
  216. label: "发起人",
  217. prop: "gw_fqr_name",
  218. minWidth: 100,
  219. },
  220. {
  221. label: "发起科室",
  222. prop: "gw_fqks_name",
  223. minWidth: 100,
  224. },
  225. {
  226. label: "发起时间",
  227. prop: "create_dateline",
  228. minWidth: 100,
  229. },
  230. {
  231. label: "当前步骤",
  232. prop: "gw_bz",
  233. minWidth: 100,
  234. },
  235. {
  236. label: "当前审核人",
  237. prop: "gw_shr",
  238. minWidth: 100,
  239. },
  240. {
  241. label: "状态",
  242. prop: "gw_status",
  243. minWidth: 100,
  244. },
  245. ],
  246. //拖拽列
  247. dropCol: [
  248. {
  249. label: "类型",
  250. prop: "lb_name",
  251. minWidth: 100,
  252. },
  253. {
  254. label: "标题",
  255. prop: "gw_title",
  256. minWidth: 100,
  257. },
  258. {
  259. label: "发文字号",
  260. prop: "gw_zh",
  261. minWidth: 100,
  262. },
  263. {
  264. label: "发起人",
  265. prop: "gw_fqr_name",
  266. minWidth: 100,
  267. },
  268. {
  269. label: "发起科室",
  270. prop: "gw_fqks_name",
  271. minWidth: 100,
  272. },
  273. {
  274. label: "发起时间",
  275. prop: "create_dateline",
  276. minWidth: 100,
  277. },
  278. {
  279. label: "当前步骤",
  280. prop: "gw_bz",
  281. minWidth: 100,
  282. },
  283. {
  284. label: "当前审核人",
  285. prop: "gw_shr",
  286. minWidth: 100,
  287. },
  288. {
  289. label: "状态",
  290. prop: "gw_status",
  291. minWidth: 100,
  292. },
  293. ],
  294. fileFinalArr:[],
  295. };
  296. },
  297. mounted() {
  298. this.getListData();
  299. this.dropCol = colDrap(this.dropCol);
  300. },
  301. methods: {
  302. //初始化列表数据
  303. getListData() {
  304. this.loading = true;
  305. let transObj = {
  306. page: this.cur_page,
  307. limit: this.limit,
  308. keyword: this.keyword,
  309. my_check:1,
  310. gw_status:this.state_value,
  311. };
  312. dbfw_list(transObj).then((res) => {
  313. this.loading = false;
  314. this.tableData = res.data.page_data;
  315. this.cur_page = Number(res.data.page_now);
  316. this.total = Number(res.data.total_rows);
  317. });
  318. },
  319. initWpsAss() {
  320. let installLink = window.globalVariables.installLink;
  321. window.open(installLink, '_blank');
  322. },
  323. //多选
  324. handleSelectionChange(val) {
  325. this.multipleSelection = val;
  326. },
  327. //多选框选择
  328. handleCheckAllChange(val) {
  329. this.showType = val;
  330. this.dialogForm.valiType = val;
  331. },
  332. editData(item) {
  333. this.title = "编辑设置";
  334. this.isEdit = true;
  335. this.id = item.cbs_id;
  336. this.dialogForm.gzmc = item.cbs_name;
  337. this.dialogForm.sqr = item.cbs_sqr;
  338. this.dialogForm.cjsj = item.cbs_cjsj;
  339. this.dialogForm.yydx = item.cbs_yydx;
  340. this.dialogForm.btrqlx = item.cbs_btrqlx;
  341. this.dialogForm.btgzlx = item.cbs_btgzlx;
  342. this.dialogForm.zxbtsj = item.cbs_zxbtsj;
  343. this.dialogForm.btsjje = item.cbs_btsjje;
  344. this.dialogForm.shr = item.cbs_shr;
  345. this.dialogFormVisible = true;
  346. },
  347. delData(id) {
  348. let data = {
  349. cbs_id: id,
  350. };
  351. this.$confirm("确认删除该设置?", "提示", {
  352. confirmButtonText: "确定",
  353. cancelButtonText: "取消",
  354. type: "warning",
  355. })
  356. .then(() => {
  357. shsz_del(data).then((res) => {
  358. if (res.code == 1) {
  359. this.$message({
  360. message: "删除成功!",
  361. type: "success",
  362. });
  363. this.getListData();
  364. } else {
  365. this.$message({
  366. message: res.msg,
  367. type: "error",
  368. });
  369. }
  370. });
  371. })
  372. .catch(() => { });
  373. },
  374. //翻页
  375. handleCurrentChange(val) {
  376. this.cur_page = val;
  377. this.getListData();
  378. },
  379. //待办发文-审核
  380. handleCheck(item) {
  381. let chooseID=item.gw_id;
  382. this.$router.push({ name: "gwglxt_dbfw_sh", params: { id: chooseID } });
  383. },
  384. //下载附件
  385. downloadFj(item) {
  386. let geFj=item.gw_fj
  387. if (geFj != '') {//字段有值
  388. let ifOneB = geFj.indexOf(";");
  389. if (ifOneB != '-1') {//能找到,不止一个附件
  390. let muilArr = geFj.split(';');
  391. let flileArr = []
  392. muilArr.forEach(item => {
  393. let secSpil = item.split('|');
  394. flileArr.push({
  395. fileUrl: getFullUrl(secSpil[0]),
  396. fileName: secSpil[1]
  397. })
  398. })
  399. this.fileFinalArr = flileArr;
  400. } else {//只有一个
  401. let singleArr = geFj.split('|');
  402. this.fileFinalArr = [{
  403. fileUrl: getFullUrl(singleArr[0]),
  404. fileName: singleArr[1]
  405. }];
  406. }
  407. } else {
  408. this.fileFinalArr = [];
  409. }
  410. if(this.fileFinalArr.length>1){
  411. console.log('附件有多个~');
  412. return
  413. }else{
  414. download3(this.fileFinalArr[0].fileUrl, '', this.fileFinalArr[0].fileName);
  415. }
  416. },
  417. handleDetail(item){
  418. console.log('111')
  419. }
  420. },
  421. };
  422. </script>
  423. <style lang="scss" scoped>
  424. .red {
  425. color: red;
  426. }
  427. .blue {
  428. color: #4351FF;
  429. }
  430. .green{
  431. color:green;
  432. }
  433. .time-type-list {
  434. width: 100%;
  435. border-bottom: 1px solid #f3f3f3;
  436. margin-bottom: 20px;
  437. display: flex;
  438. li {
  439. position: relative;
  440. top: 2px;
  441. cursor: pointer;
  442. width: 50px;
  443. font-size: 14px;
  444. line-height: 30px;
  445. text-align: center;
  446. &+li {
  447. margin-left: 20px;
  448. }
  449. &.selected {
  450. color: #265cd4;
  451. border-bottom: 2px solid #265cd4;
  452. }
  453. }
  454. }
  455. </style>