complaintList.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  1. <template>
  2. <div class="mainBox">
  3. <!--搜索功能 start------------------------------------------------------------>
  4. <div class="layerBox_search">
  5. <div class="layerBoxLine">
  6. <el-row>
  7. <el-col :span="8">
  8. <div class="searchBox">
  9. <div class="searchTitle">类型:</div>
  10. <el-select v-model="getApiData.nature" placeholder="请选择.." @change="getNatureChildren">
  11. <el-option
  12. v-for="item in natureData"
  13. :key="item.id"
  14. :label="item.label"
  15. :value="item.value">
  16. </el-option>
  17. </el-select>
  18. </div>
  19. </el-col>
  20. <el-col :span="8">
  21. <div class="searchBox">
  22. <div class="searchTitle">状态:</div>
  23. <el-select v-model="getApiData.status" placeholder="请选择..">
  24. <el-option
  25. v-for="item in statusData"
  26. :key="item.value"
  27. :label="item.label"
  28. :value="item.value">
  29. </el-option>
  30. </el-select>
  31. </div>
  32. </el-col>
  33. </el-row>
  34. </div>
  35. </div>
  36. <div class="layerBoxNoBg">
  37. <div></div>
  38. <div>
  39. <el-button @click="clearSearchList">重置</el-button>
  40. <el-button type="primary" style="margin-right:20px" @click="getData()">搜索</el-button>
  41. </div>
  42. </div>
  43. <!--搜索功能 end------------------------------------------------------------>
  44. <!--表格内容 start------------------------------------------------------------>
  45. <div class="layerBox">
  46. <tableTitle :name="tableDivTitle"/>
  47. <el-row>
  48. <template>
  49. <el-table :data="tableData" style="width: 100%">
  50. <el-table-column fixed prop="id" label="编号" width="50"></el-table-column>
  51. <el-table-column prop="title" label="标题"></el-table-column>
  52. <el-table-column prop="nature_name" label="类型"></el-table-column>
  53. <!-- <el-table-column prop="nature_level_name" label="进度"></el-table-column>
  54. <el-table-column prop="type_name" label="类型"></el-table-column>
  55. <el-table-column prop="type_level_name" label="类型说明"></el-table-column> -->
  56. <el-table-column label="判决书">
  57. <template slot-scope="scope">
  58. {{ scope.row.judgment ? '有' : '无' }}
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="录音录像">
  62. <template slot-scope="scope">
  63. {{ scope.row.audio_and_video ? '有' : '无' }}
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="合同">
  67. <template slot-scope="scope">
  68. {{ scope.row.contract ? '有' : '无' }}
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="资质">
  72. <template slot-scope="scope">
  73. {{ scope.row.qualifications ? '有' : '无' }}
  74. </template>
  75. </el-table-column>
  76. <!-- <el-table-column prop="judgment" label="判决书"></el-table-column>
  77. <el-table-column prop="audio_and_video" label="录音录像"></el-table-column>
  78. <el-table-column prop="contract" label="合同"></el-table-column>
  79. <el-table-column prop="qualifications" label="资质"></el-table-column> -->
  80. <el-table-column prop="money" label="涉案标的额"></el-table-column>
  81. <el-table-column prop="name" label="姓名"></el-table-column>
  82. <el-table-column prop="mobile" label="电话"></el-table-column>
  83. <el-table-column prop="status_name" label="状态"></el-table-column>
  84. <el-table-column prop="created_at" label="创建时间"></el-table-column>
  85. <el-table-column fixed="right" label="操作" width="120" header-align="center">
  86. <template slot-scope="scope">
  87. <div class="listBtnBox">
  88. <div class="listEditBtn" @click="editRow(scope.row)"><i class="el-icon-edit-outline"></i>编辑</div>
  89. </div>
  90. </template>
  91. </el-table-column>
  92. </el-table>
  93. </template>
  94. </el-row>
  95. </div>
  96. <!--分页 start------------------------------------------------------------>
  97. <div class="alignBox">
  98. <el-row>
  99. <el-col :span="24">
  100. <el-pagination :current-page="getApiData.page" @size-change="handleSizeChange" @current-change="handleCurrentChange" :page-size="10" layout="total, prev, pager, next, jumper" :total="allCount"></el-pagination>
  101. </el-col>
  102. </el-row>
  103. </div>
  104. <!--分页 end------------------------------------------------------------>
  105. <!--表格内容 end------------------------------------------------------------>
  106. <!--弹出框start------------------------------------------------------------>
  107. <el-dialog title="编辑投诉" :visible.sync="windowStatus" :close-on-click-modal="false">
  108. <el-form :model="form" ref="form" :rules="formRules" autocomplete="off" label-position="left">
  109. <div class="formDiv">
  110. <el-form-item label="标题:" :label-width="formLabelWidth" prop="" class="custom-align-right">
  111. <el-input v-model="form.title" autocomplete="off" disabled></el-input>
  112. </el-form-item>
  113. <el-form-item label="类型:" :label-width="formLabelWidth" prop="" class="custom-align-right">
  114. <template>
  115. <div class="natureRadioBox">
  116. <div>
  117. <el-radio-group v-model="form.nature">
  118. <el-radio :label="item.id" v-for="item in windowNatureData" :key="item.id" @change="clearCheck">{{item.type_name}}</el-radio>
  119. </el-radio-group>
  120. </div>
  121. <!--民事-->
  122. <div v-if="form.nature==1" class="natureRadioBoxItem">
  123. <el-radio-group v-model="form.nature_level0">
  124. <el-radio :label="item.id" v-for="item in windowNatureData[0].children[0].children" :key="item.id">{{item.type_name}}</el-radio>
  125. </el-radio-group>
  126. </div>
  127. <div v-if="form.nature==1" class="natureRadioBoxItem">
  128. <el-radio-group v-model="form.nature_level1">
  129. <el-radio :label="item.id" v-for="item in windowNatureData[0].children[1].children" :key="item.id">{{item.type_name}}</el-radio>
  130. </el-radio-group>
  131. </div>
  132. <div class="natureRadioBoxItemOther" v-if="form.nature==1&&form.nature_level1==24">
  133. <el-input v-model="form.other" placeholder="请输入"></el-input>
  134. </div>
  135. <!--刑事-->
  136. <div v-if="form.nature==5" class="natureRadioBoxItem">
  137. <el-radio-group v-model="form.nature_level0">
  138. <el-radio :label="item.id" v-for="item in windowNatureData[1].children[0].children" :key="item.id">{{item.type_name}}</el-radio>
  139. </el-radio-group>
  140. </div>
  141. <div v-if="form.nature==5" class="natureRadioBoxItem">
  142. <el-radio-group v-model="form.nature_level1">
  143. <el-radio :label="item.id" v-for="item in windowNatureData[1].children[1].children" :key="item.id">{{item.type_name}}</el-radio>
  144. </el-radio-group>
  145. </div>
  146. <div class="natureRadioBoxItemOther" v-if="form.nature==5&&form.nature_level1==29">
  147. <el-input v-model="form.other" placeholder="请输入"></el-input>
  148. </div>
  149. <div v-if="form.nature_level0==14&&form.nature==5" class="natureRadioBoxItem">
  150. <el-radio-group v-model="form.nature_level3">
  151. <el-radio :label="item.id" v-for="item in windowNatureData[1].children[0].children[2].children" :key="item.id">{{item.type_name}}</el-radio>
  152. </el-radio-group>
  153. </div>
  154. <!--行政-->
  155. <div v-if="form.nature==104" class="natureRadioBoxItem">
  156. <el-radio-group v-model="form.nature_level0">
  157. <el-radio :label="item.id" v-for="item in windowNatureData[2].children[0].children" :key="item.id">{{item.type_name}}</el-radio>
  158. </el-radio-group>
  159. </div>
  160. <div class="natureRadioBoxItemOther" v-if="form.nature==15&&form.nature_level0==122">
  161. <el-input v-model="form.other" placeholder="请输入"></el-input>
  162. </div>
  163. <!--非讼-->
  164. <div v-if="form.nature==15" class="natureRadioBoxItem">
  165. <el-radio-group v-model="form.nature_level0">
  166. <el-radio :label="item.id" v-for="item in windowNatureData[3].children[0].children" :key="item.id">{{item.type_name}}</el-radio>
  167. </el-radio-group>
  168. </div>
  169. <div class="natureRadioBoxItemOther" v-if="form.nature==104&&form.nature_level0==36">
  170. <el-input v-model="form.other" placeholder="请输入"></el-input>
  171. </div>
  172. </div>
  173. </template>
  174. </el-form-item>
  175. <el-form-item label="详细说明:" :label-width="formLabelWidth" prop="" class="custom-align-right">
  176. <el-input type="textarea" v-model="form.describe" rows="8" class="custom-textarea" disabled placeholder="请输入详细说明"></el-input>
  177. </el-form-item>
  178. <el-form-item label="判决书:" :label-width="formLabelWidth" prop="" class="custom-align-right">
  179. <div v-if="form.judgment" @click="downloadFile(form.judgment,'判决书')" class="complaintListdownloadBtn">
  180. <i class="el-icon-download"></i>
  181. 下载
  182. </div>
  183. <div v-else>暂无数据</div>
  184. </el-form-item>
  185. <el-form-item label="录音录像:" :label-width="formLabelWidth" prop="" class="custom-align-right">
  186. <div v-if="form.audio_and_video" @click="downloadFile(form.audio_and_video,'录音录像')" class="complaintListdownloadBtn">
  187. <i class="el-icon-download"></i>
  188. 下载
  189. </div>
  190. <div v-else>暂无数据</div>
  191. </el-form-item>
  192. <el-form-item label="合同:" :label-width="formLabelWidth" prop="" class="custom-align-right">
  193. <div v-if="form.contract" @click="downloadFile(form.contract,'合同')" class="complaintListdownloadBtn">
  194. <i class="el-icon-download"></i>
  195. 下载
  196. </div>
  197. <div v-else>暂无数据</div>
  198. </el-form-item>
  199. <el-form-item label="资质:" :label-width="formLabelWidth" prop="" class="custom-align-right">
  200. <div v-if="form.qualifications" @click="downloadFile(form.qualifications,'资质')" class="complaintListdownloadBtn">
  201. <i class="el-icon-download"></i>
  202. 下载
  203. </div>
  204. <div v-else>暂无数据</div>
  205. </el-form-item>
  206. <el-form-item label="涉案标的金额:" :label-width="formLabelWidth" prop="" class="custom-align-right">
  207. <el-input v-model="form.money" autocomplete="off" disabled placeholder="请输入涉案标的金额"></el-input>
  208. </el-form-item>
  209. <el-form-item label="姓名:" :label-width="formLabelWidth" prop="" class="custom-align-right">
  210. <el-input v-model="form.name" autocomplete="off" disabled placeholder="请输入姓名"></el-input>
  211. </el-form-item>
  212. <el-form-item label="电话:" :label-width="formLabelWidth" prop="" class="custom-align-right">
  213. <el-input v-model="form.mobile" autocomplete="off" disabled placeholder="请输入电话"></el-input>
  214. </el-form-item>
  215. <el-form-item label="身份证号:" :label-width="formLabelWidth" prop="id_card" class="custom-align-right">
  216. <el-input v-model="form.id_card" autocomplete="off" disabled placeholder="请输入身份证号"></el-input>
  217. </el-form-item>
  218. <el-form-item label="期待学习法律:" :label-width="formLabelWidth" prop="" class="custom-align-right">
  219. <el-input v-model="form.like_remark" autocomplete="off" disabled placeholder="请输入期待学习法律"></el-input>
  220. </el-form-item>
  221. <el-form-item label="状态:" :label-width="formLabelWidth" prop="status" class="custom-align-right">
  222. <el-radio-group v-model="form.status">
  223. <!-- <el-radio label="100">待审核</el-radio> -->
  224. <el-radio label="101">已接案</el-radio>
  225. <el-radio label="102">已拒绝</el-radio>
  226. <el-radio label="103">已完结</el-radio>
  227. </el-radio-group>
  228. </el-form-item>
  229. <el-form-item label="备注信息:" :label-width="formLabelWidth" prop="" class="custom-align-right">
  230. <el-input type="textarea" v-model="form.reason" class="custom-textarea" placeholder="请输入备注信息"></el-input>
  231. </el-form-item>
  232. </div>
  233. </el-form>
  234. <div slot="footer" class="dialog-footer">
  235. <div>
  236. <el-button @click="closeWindow">取 消</el-button>
  237. <el-button type="primary" @click="editData">提交</el-button>
  238. </div>
  239. </div>
  240. </el-dialog>
  241. <!--弹出框2:外部表单弹出框 end------------------------------------------------------------>
  242. </div>
  243. </template>
  244. <script>
  245. //引入公用样式
  246. import '@/styles/global.less';
  247. //表格标题
  248. import tableTitle from './components/tableTitle';
  249. export default {
  250. components: {
  251. tableTitle,//表格标题
  252. },
  253. data() {
  254. //0.全局操作 start ------------------------------------------------------------>
  255. //表单验证
  256. const validateEmpty = (rule,value,callback) => {
  257. if (value == 0 || value == null) {
  258. callback(new Error('状态不能为空!'))
  259. } else {
  260. callback()
  261. }
  262. }
  263. const validateArray = (rule,value,callback) => {
  264. if (value.length == 0) {
  265. callback(new Error('该项不能为空!'))
  266. } else {
  267. callback()
  268. }
  269. }
  270. const validateNull = (rule,value,callback) => {
  271. callback()
  272. }
  273. let self = this;
  274. //0.全局操作 end ------------------------------------------------------------>
  275. return {
  276. //1.列表和分页相关 start ------------------------------------------------------------>
  277. tableDivTitle:"投诉举报",
  278. tableData: [],//列表
  279. allCount:0,//总条数
  280. editId:0,//要修改的网站id
  281. getApiData:{
  282. is_admin:1,//是否为管理员
  283. nature:"",//性质
  284. nature_level:"",//性质进度
  285. type:"",//类型
  286. type_level:"",//类型进度
  287. status:"",//状态
  288. page:1,//当前是第几页
  289. pageSize:10,//一共多少条
  290. },
  291. natureData:[],//所有性质
  292. netureLevelData:[],//所有进度
  293. typeData:[],//所有类型
  294. typeLevelData:[],//所有类型进度
  295. statusData:[],//所有状态
  296. //暂存所有进度
  297. allNetureLevelData:[],//性质
  298. allTypeLevelData:[],//类型
  299. //分页相关 end ------------------------------------------------------------>
  300. //2.弹出框设置 start ------------------------------------------------------------>
  301. //是否显示弹出窗口
  302. windowStatus:false,
  303. formLabelWidth: '120px',
  304. //弹出框设置 end ------------------------------------------------------------>
  305. //3.搜索相关 start ------------------------------------------------------------>
  306. //搜索相关 end ------------------------------------------------------------>
  307. //3.弹出框中的表单设置 start ------------------------------------------------------------>
  308. //3.1 表单收集的数据
  309. form: {
  310. title:"",//标题
  311. //nature:"",//性质
  312. //nature_level:"",//进度
  313. //type:"",//类型
  314. //type_level:"",//类型进度
  315. describe:"",//详细说明
  316. judgment:"",//判决书
  317. audio_and_video:"",//录音录像
  318. contract:"",//合同
  319. qualifications:"",//资质
  320. money:"",//涉案标的额
  321. name:"",//姓名
  322. id_card:"",//身份证
  323. status:"100",//状态
  324. like_remark:"",//你最想了解的法律知识
  325. reason:"",//备注信息
  326. //编辑性质和数字
  327. nature:0,//性质
  328. nature_level0:0,//进度
  329. nature_level1:0,//性质
  330. nature_level3:0,//类型进度
  331. //编辑类型和进度文字
  332. nature_name:"",//类型
  333. nature_name0:"",//进度
  334. nature_name1:"",//性质
  335. nature_name3:"",//类型进度
  336. other:""
  337. },
  338. windowNatureData:[],//所有性质与进度
  339. // windowNetureLevelData:[],//所有进度
  340. // windowTypeData:[],//所有类型
  341. // windowTypeLevelData:[],//所有类型进度
  342. windowStatusData:[],//所有状态
  343. //3.2表单验证规则
  344. formRules: {
  345. //性质不能为空
  346. nature:[{required:true,trigger:'blur',validator:validateEmpty}],
  347. //进度不能为空
  348. nature_level:[{required:true,trigger:'blur',validator:validateEmpty}],
  349. //类型不能为空
  350. type:[{required:true,trigger:'blur',validator:validateEmpty}],
  351. //类型进度不能为空
  352. type_level:[{required:true,trigger:'blur',validator:validateEmpty}],
  353. //状态不能为空
  354. status:[{required:true,trigger:'blur',validator:validateEmpty}],
  355. //身份证不能为空
  356. id_card:[{required:true,trigger:'blur',validator:validateNull}],
  357. },
  358. //弹出框中的表单设置 end ------------------------------------------------------------>
  359. }
  360. },
  361. methods: {
  362. //1.列表和分页相关 start ------------------------------------------------------------>
  363. //1.1 获取内容
  364. getData(){
  365. this.$store.dispatch('complaint/getComplaint',this.getApiData).then(res=> {
  366. console.log(res)
  367. let data = [];
  368. for(let item of res.data.rows){
  369. // item.judgment = item.judgment.length > 0 ? "有" : "没有";
  370. // item.audio_and_video = item.audio_and_video.length > 0 ? "有" : "没有";
  371. // item.contract = item.contract.length > 0 ? "有" : "没有";
  372. // item.qualifications = item.qualifications.length > 0 ? "有" : "没有";
  373. // 判断 item.status 的状态
  374. switch (item.status) {
  375. case 100:
  376. item.status = "";
  377. break;
  378. case 101:
  379. item.status = "已接案";
  380. break;
  381. case 102:
  382. item.status = "已拒绝";
  383. break;
  384. case 103:
  385. item.status = "已完结";
  386. break;
  387. default:
  388. item.status = "";
  389. break;
  390. }
  391. }
  392. this.tableData = res.data.rows;//放入数据
  393. this.allCount = res.data.count;//放入总条数
  394. })
  395. },
  396. //获取所有父级状态
  397. getStatus(){
  398. //获取性质和进度
  399. let getNature = {
  400. type:1
  401. }
  402. this.$store.dispatch('complaint/getLetterType',getNature).then(res=> {
  403. //格式化性质
  404. for(let item of res.data){
  405. let data = {
  406. value: item.id,
  407. label: item.type_name
  408. }
  409. //搜索栏
  410. this.natureData.push(data)
  411. //弹窗框
  412. //this.windowNatureData.push(data)
  413. }
  414. //暂存所有性质进度
  415. this.allNetureLevelData = res.data;
  416. //再窗口里面也存一份
  417. this.windowNatureData = res.data;
  418. })
  419. //获取类型和类型说明
  420. // let getType = {
  421. // type:2
  422. // }
  423. // this.$store.dispatch('complaint/getLetterType',getType).then(res=> {
  424. // for(let item of res.data){
  425. // let data = {
  426. // value: item.id,
  427. // label: item.type_name
  428. // }
  429. // //搜索栏
  430. // this.typeData.push(data)
  431. // //弹窗框
  432. // this.windowTypeData.push(data)
  433. // }
  434. // //暂存所有类型进度
  435. // this.allTypeLevelData = res.data;
  436. // })
  437. //获取状态
  438. let getStatus = {
  439. type:10
  440. }
  441. this.$store.dispatch('complaint/getLetterType',getStatus).then(res=> {
  442. for(let item of res.data){
  443. let data = {
  444. value: item.id,
  445. label: item.type_name
  446. }
  447. //搜索栏
  448. this.statusData.push(data)
  449. //弹窗框
  450. this.windowStatusData.push(data)
  451. }
  452. })
  453. },
  454. // 获取子进度 可优化 start---------------------------------------->
  455. //获取进度性质对应的子级状态
  456. getNatureChildren(val) {
  457. this.getApiData.nature_level = "";
  458. this.netureLevelData = [];
  459. console.log(val);
  460. // 从 allNetureLevelData 中找到 id 与 val 相同的对象
  461. const selectedItem = this.allNetureLevelData.find(item => item.id === val);
  462. console.log(selectedItem)
  463. for(let item of selectedItem.children){
  464. let data = {
  465. value: item.id,
  466. label: item.type_name
  467. }
  468. //搜索栏
  469. //this.netureLevelData.push(data)
  470. }
  471. },
  472. // getTypeChildren(val) {
  473. // this.getApiData.type_level = "";
  474. // this.typeLevelData = [];
  475. // console.log(val);
  476. // const selectedItem = this.allTypeLevelData.find(item => item.id === val);
  477. // console.log(selectedItem)
  478. // for(let item of selectedItem.children){
  479. // let data = {
  480. // value: item.id,
  481. // label: item.type_name
  482. // }
  483. // //搜索栏
  484. // this.typeLevelData.push(data)
  485. // }
  486. // },
  487. //弹出框中的
  488. // getWindowNatureChildren(val) {
  489. // this.form.nature_level = "";
  490. // this.windowNetureLevelData = [];
  491. // console.log(val);
  492. // // 从 allNetureLevelData 中找到 id 与 val 相同的对象
  493. // const selectedItem = this.allNetureLevelData.find(item => item.id === val);
  494. // console.log(selectedItem)
  495. // for(let item of selectedItem.children){
  496. // let data = {
  497. // value: item.id,
  498. // label: item.type_name
  499. // }
  500. // this.windowNetureLevelData.push(data)
  501. // }
  502. // },
  503. // getWindowTypeChildren(val) {
  504. // this.form.type_level = "";
  505. // this.windowTypeLevelData = [];
  506. // console.log(val);
  507. // const selectedItem = this.allTypeLevelData.find(item => item.id === val);
  508. // console.log(selectedItem)
  509. // for(let item of selectedItem.children){
  510. // let data = {
  511. // value: item.id,
  512. // label: item.type_name
  513. // }
  514. // //搜索栏
  515. // this.windowTypeLevelData.push(data)
  516. // }
  517. // },
  518. //回显数据
  519. // returnWindowNatureChildren(val) {
  520. // console.log(val);
  521. // const selectedItem = this.allNetureLevelData.find(item => item.id === val);
  522. // console.log(selectedItem)
  523. // for(let item of selectedItem.children){
  524. // let data = {
  525. // value: item.id,
  526. // label: item.type_name
  527. // }
  528. // this.windowNetureLevelData.push(data)
  529. // }
  530. // },
  531. // returnWindowTypeChildren(val) {
  532. // this.form.type_level = "";
  533. // this.windowTypeLevelData = [];
  534. // console.log(val);
  535. // const selectedItem = this.allTypeLevelData.find(item => item.id === val);
  536. // console.log(selectedItem)
  537. // for(let item of selectedItem.children){
  538. // let data = {
  539. // value: item.id,
  540. // label: item.type_name
  541. // }
  542. // //搜索栏
  543. // this.windowTypeLevelData.push(data)
  544. // }
  545. // },
  546. // 获取子进度 可优化 end---------------------------------------->
  547. //1.2 列表内容分页
  548. //直接跳转
  549. handleSizeChange(val) {
  550. this.getApiData.page = val;
  551. this.getData();
  552. },
  553. //1.3 点击分页
  554. handleCurrentChange(val) {
  555. this.getApiData.page = val;
  556. this.getData();
  557. },
  558. //1.4 重置按钮
  559. clearSearchList(){
  560. this.getApiData.is_admin = 1;
  561. this.getApiData.nature = "";
  562. this.getApiData.nature_level = "";
  563. this.netureLevelData = [];
  564. this.getApiData.type = "";
  565. this.getApiData.type_level = "";
  566. this.typeLevelData = [];
  567. this.getApiData.status = "";
  568. this.getApiData.page = 1;
  569. this.getApiData.pageSize = 10;
  570. this.getData();
  571. },
  572. //列表和分页相关 end ------------------------------------------------------------>
  573. //2.弹出框设置 start ------------------------------------------------------------>
  574. //2.1 打开弹出框
  575. openWindow() {
  576. //this.clearToServe();
  577. this.windowStatus = true;
  578. },
  579. //2.2 关闭弹出框
  580. closeWindow(){
  581. this.windowStatus = false;
  582. this.clearToServe();
  583. },
  584. //2.3 清空提交窗口
  585. clearToServe(){
  586. //重置窗口
  587. this.editId = "";
  588. this.form.title = "";
  589. this.form.nature = "";
  590. this.form.nature_level = "";
  591. this.form.type = "";
  592. this.form.type_level = "";
  593. this.form.describe = "";
  594. this.form.judgment = "";
  595. this.form.audio_and_video = "";
  596. this.form.contract = "";
  597. this.form.qualifications = "";
  598. this.form.money = "";
  599. this.form.name = "";
  600. this.form.id_card = "";
  601. this.form.like_remark = "";
  602. this.form.reason = "";
  603. },
  604. //弹出框设置 end ------------------------------------------------------------>
  605. //4.编辑 start ------------------------------------------------------------>
  606. downloadFile(data,name){
  607. let files = [];
  608. let fileName = name;
  609. if (!Array.isArray(data)) {
  610. data = [data];
  611. }
  612. console.log(data)
  613. for(let item of data){
  614. if(item.imgUrl){
  615. files.push(item.imgUrl);
  616. }else{
  617. files.push(item)
  618. }
  619. }
  620. //console.log(files)
  621. let getData = {
  622. files:files,
  623. fileName:fileName
  624. }
  625. this.$store.dispatch('complaint/downloadFile',getData).then(res=> {
  626. // console.log(res)
  627. // window.open(res.data.fileUrl, '_blank');
  628. const link = document.createElement('a');
  629. link.href = res.data.fileUrl;
  630. link.setAttribute('download', 'downloaded_file'); // You can set a default file name here
  631. document.body.appendChild(link);
  632. link.click();
  633. document.body.removeChild(link);
  634. })
  635. },
  636. //回显数据
  637. editRow(data){
  638. //先判断这条数据是否已经被其他人受理
  639. this.$store.dispatch('complaint/checkMeasure',{id:data.id}).then(res=> {
  640. if(res.code == 200){
  641. //列表里面已经有了,就不需要再请求了
  642. //开始回显数据
  643. this.openWindow();
  644. console.log(data)
  645. this.editId = data.id;
  646. this.form.title = data.title;
  647. //还原性质
  648. // this.form.nature = data.nature;
  649. // this.returnWindowNatureChildren(data.nature);
  650. // this.form.nature_level = data.nature_level;
  651. //还原类型
  652. // this.form.type = data.type;
  653. // this.returnWindowTypeChildren(data.type);
  654. // this.form.type_level = data.type_level;
  655. this.form.nature = data.nature;
  656. this.form.nature_level0 = data.nature_level0;
  657. this.form.nature_level1 = data.nature_level1;
  658. this.form.nature_level3 = data.nature_level3;
  659. //编辑类型和进度文字
  660. this.form.nature_name = data.nature_name;
  661. this.form.nature_name0 = data.nature_name0;
  662. this.form.nature_name1 = data.nature_name1;
  663. this.form.nature_name3 = data.nature_name3;
  664. this.form.other = data.other;
  665. //详细说明
  666. this.form.describe = data.describe;
  667. this.form.judgment = data.judgment;
  668. this.form.audio_and_video = data.audio_and_video;
  669. this.form.contract = data.contract;
  670. this.form.qualifications = data.qualifications;
  671. // if(data.judgment.length > 0){
  672. // this.form.judgment = data.judgment[0].fileSrc;
  673. // }
  674. // if(data.audio_and_video.length > 0){
  675. // this.form.audio_and_video = data.audio_and_video[0].fileSrc;
  676. // }
  677. // if(data.contract.length > 0){
  678. // this.form.contract = data.contract[0].fileSrc;
  679. // }
  680. // if(data.qualifications.length > 0){
  681. // this.form.qualifications = data.qualifications[0].fileSrc;
  682. // }
  683. this.form.money = data.money;
  684. this.form.id_card = data.id_card;
  685. this.form.like_remark = data.like_remark;
  686. this.form.reason = data.reason;
  687. switch (data.status) {
  688. case "待审核":
  689. this.form.status = "100";
  690. break;
  691. case "已接案":
  692. this.form.status = "101";
  693. break;
  694. case "已拒绝":
  695. this.form.status = "102";
  696. break;
  697. case "已完结":
  698. this.form.status = "103";
  699. break;
  700. default:
  701. this.form.status = "0"; // 可选:处理未定义的状态
  702. break;
  703. }
  704. console.log(this.form.status) //100
  705. this.form.name = data.name;
  706. this.form.mobile = data.mobile;
  707. }else{
  708. this.$message({
  709. type: 'warning',
  710. message: '该数据已经被其他人受理!'
  711. });
  712. }
  713. }).catch(() => {
  714. this.$message({
  715. type: 'warning',
  716. message: '网络错误,请重试!'
  717. });
  718. })
  719. },
  720. //清理单选状态
  721. clearCheck(){
  722. console.log("清理单选状态")
  723. this.form.nature_level1 = "";
  724. this.form.nature_level3 = "";
  725. this.form.nature_name = "";
  726. this.form.nature_name0 = "";
  727. this.form.nature_name1 = "";
  728. this.form.nature_name3 = "";
  729. this.form.other = "";
  730. },
  731. //提交编辑
  732. editData(){
  733. //判断什么时候需要需要提交other
  734. // if(this.form.nature_level1!=24||this.form.nature_level1!=29||this.form.nature_level0!=122||this.form.nature_level0!=36){
  735. // this.form.other = "";
  736. // }
  737. let data = {
  738. id:this.editId,
  739. //提交编辑
  740. nature:this.form.nature,
  741. nature_level0:this.form.nature_level0,
  742. nature_level1:this.form.nature_level1,
  743. nature_level3:this.form.nature_level3,
  744. // nature_name:this.form.nature_name,
  745. // nature_name0:this.form.nature_name0,
  746. // nature_name1:this.form.nature_name1,
  747. // nature_name3:this.form.nature_name3,
  748. other:this.form.other,
  749. mobile:this.form.mobile,
  750. type:this.form.type,
  751. type_level:this.form.type_level,
  752. status:this.form.status,
  753. reason:this.form.reason,
  754. is_admin:1 //必须,否则无法修改
  755. }
  756. //console.log(data)
  757. this.$refs.form.validate(valid => {
  758. if (valid) {
  759. this.$store.dispatch('complaint/upComplaint',data).then(res=> {
  760. console.log(res)
  761. this.closeWindow();
  762. this.$message({
  763. type: 'success',
  764. message: '修改成功!'
  765. });
  766. this.getData();
  767. })
  768. }
  769. })
  770. }
  771. //编辑 end ------------------------------------------------------------>
  772. },
  773. mounted(){
  774. //获取页面列表
  775. this.getData();
  776. //查询状态
  777. this.getStatus();
  778. }
  779. }
  780. </script>
  781. <style scoped lang="less">
  782. .natureRadioBox{
  783. .natureRadioBoxItem{
  784. border: 1px solid #dfe4ed;
  785. border-radius: 4px;
  786. padding: 10px 10px 0 10px;
  787. margin-bottom: 10px;
  788. background: #F5F7FA;
  789. label {
  790. margin-bottom: 10px;
  791. }
  792. }
  793. .natureRadioBoxItemOther{
  794. border: 1px solid #dfe4ed;
  795. border-radius: 4px;
  796. padding: 10px;
  797. margin-bottom: 10px;
  798. background: #F5F7FA;
  799. }
  800. }
  801. //表单微调 start------------------------------------------------------------>*/
  802. ::v-deep .natureRadioBoxItem .el-radio {
  803. margin-bottom: 10px !important;
  804. }
  805. ::v-deep .custom-form-item > .el-form-item__label {
  806. line-height: 140px !important;
  807. }
  808. ::v-deep .custom-textarea .el-textarea__inner {
  809. resize: none; /* 禁止用拖拽调整大小 */
  810. }
  811. ::v-deep .custom-align-right .el-form-item__label {
  812. text-align: right; /* 设置标签文字右对齐 */
  813. }
  814. ::v-deep .el-select-group__title {
  815. color: #909399;
  816. }
  817. ::v-deep .el-select {
  818. width: 100% !important;
  819. }
  820. </style>