dfa5e9c8d29d18de3499575b4792a7900f5d4a20.svn-base 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898
  1. <template>
  2. <div class="jcjl" style="width: 100%;height: 100%;">
  3. <el-table
  4. v-loading="loading"
  5. border
  6. :height="tableHeight1"
  7. :data="jiChaJiHuaResult"
  8. tooltip-effect="dark"
  9. style="width: 100%;"
  10. >
  11. <el-table-column
  12. header-align="center"
  13. align="center"
  14. min-width="100"
  15. prop="year"
  16. label="年度"
  17. show-overflow-tooltip
  18. ></el-table-column>
  19. <el-table-column
  20. header-align="center"
  21. align="center"
  22. min-width="100"
  23. prop="batch"
  24. label="稽察批次"
  25. show-overflow-tooltip
  26. ></el-table-column>
  27. <el-table-column
  28. header-align="center"
  29. align="center"
  30. min-width="100"
  31. prop="groupNm"
  32. label="组别"
  33. sortable
  34. show-overflow-tooltip
  35. ></el-table-column>
  36. <el-table-column
  37. header-align="center"
  38. align="center"
  39. min-width="200"
  40. label="开始时间"
  41. >
  42. <template slot-scope="scope">
  43. <el-date-picker
  44. style="width: 150px;padding: 0 0 0 30px;"
  45. v-model="scope.row.stTm"
  46. type="date"
  47. value-format="yyyy-MM-dd"
  48. placeholder="开始时间">
  49. </el-date-picker>
  50. </template>
  51. </el-table-column>
  52. <el-table-column
  53. header-align="center"
  54. align="center"
  55. min-width="200"
  56. label="结束时间"
  57. >
  58. <template slot-scope="scope">
  59. <el-date-picker
  60. style="width: 150px;padding: 0 0 0 30px;"
  61. v-model="scope.row.enTm"
  62. type="date"
  63. value-format="yyyy-MM-dd"
  64. placeholder="结束时间">
  65. </el-date-picker>
  66. </template>
  67. </el-table-column>
  68. <el-table-column
  69. header-align="center"
  70. align="center"
  71. min-width="250"
  72. label="稽察地点"
  73. prop="areas"
  74. show-overflow-tooltip
  75. >
  76. </el-table-column>
  77. <el-table-column
  78. header-align="center"
  79. align="center"
  80. min-width="200"
  81. label="稽察项目"
  82. show-overflow-tooltip
  83. >
  84. <template slot-scope="scope">
  85. <transition name="el-fade-in-linear">
  86. <div style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;" v-if="!scope.row.objList.length">
  87. <i class="el-icon-plus" style="cursor: pointer;" @click="objTypeClick(scope.$index, scope.row, 20)"></i>
  88. </div>
  89. </transition>
  90. <transition name="el-fade-in-linear">
  91. <div v-if="scope.row.objList.length" style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;">
  92. <span>{{scope.row['workersList']&&scope.row['objList'].length?testformatterArray(scope.row['objList'],'ojbNm'):''}}</span>
  93. <i style="margin-left: 5px; cursor: pointer;" class="el-icon-view" title="查看详情"@click="objTypeViewClick(scope.$index, scope.row, 20)"></i>
  94. <i style="margin-left: 5px; cursor: pointer;" class="el-icon-edit" @click="objTypeClick(scope.$index, scope.row, 20)"></i>
  95. <i style="margin-left: 5px; cursor: pointer;" class="el-icon-delete" @click="objTypeDelete(scope.$index, scope.row, 20)"></i>
  96. </div>
  97. </transition>
  98. </template>
  99. </el-table-column>
  100. <!--<el-table-column-->
  101. <!--header-align="center"-->
  102. <!--align="center"-->
  103. <!--min-width="100"-->
  104. <!--prop="workDpNm"-->
  105. <!--label="项目类型"-->
  106. <!--show-overflow-tooltip-->
  107. <!--&gt;</el-table-column>-->
  108. <el-table-column
  109. header-align="center"
  110. align="center"
  111. min-width="200"
  112. label="稽察组长"
  113. >
  114. <template slot-scope="scope">
  115. <transition name="el-fade-in-linear">
  116. <div style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;" v-if="!scope.row.special.length">
  117. <i class="el-icon-plus" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 20)"></i>
  118. </div>
  119. </transition>
  120. <transition name="el-fade-in-linear">
  121. <div v-if="scope.row.special.length" style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;">
  122. <span>{{scope.row['special']&&scope.row['special'].length?testformatterArray(scope.row['special'],'name'):''}}</span>
  123. <i style="margin-left: 5px; cursor: pointer;" class="el-icon-edit" @click="roleTypeClick(scope.$index, scope.row, 20)"></i>
  124. </div>
  125. </transition>
  126. </template>
  127. </el-table-column>
  128. <el-table-column
  129. header-align="center"
  130. align="center"
  131. min-width="200"
  132. label="助理"
  133. show-overflow-tooltip
  134. >
  135. <template slot-scope="scope">
  136. <transition name="el-fade-in-linear">
  137. <div style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;" v-if="!scope.row.aid.length">
  138. <i class="el-icon-plus" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 19)"></i>
  139. </div>
  140. </transition>
  141. <transition name="el-fade-in-linear">
  142. <div v-if="scope.row.aid.length" style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;">
  143. <span>{{scope.row['aid']&&scope.row['aid'].length?testformatterArray(scope.row['aid'],'name'):''}}</span>
  144. <i class="el-icon-edit" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 19)"></i>
  145. </div>
  146. </transition>
  147. </template>
  148. </el-table-column>
  149. <el-table-column
  150. header-align="center"
  151. align="center"
  152. min-width="200"
  153. label="前期专家"
  154. show-overflow-tooltip
  155. >
  156. <template slot-scope="scope">
  157. <transition name="el-fade-in-linear">
  158. <div style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;" v-if="!scope.row.qqzj.length">
  159. <i class="el-icon-plus" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 11)"></i>
  160. </div>
  161. </transition>
  162. <transition name="el-fade-in-linear">
  163. <div v-if="scope.row.qqzj.length" style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;">
  164. <span>{{scope.row['qqzj']&&scope.row['qqzj'].length?testformatterArray(scope.row['qqzj'],'name'):''}}</span>
  165. <i class="el-icon-edit" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 11)"></i>
  166. </div>
  167. </transition>
  168. </template>
  169. </el-table-column>
  170. <el-table-column
  171. header-align="center"
  172. align="center"
  173. min-width="150"
  174. label="建管专家"
  175. show-overflow-tooltip
  176. >
  177. <template slot-scope="scope">
  178. <transition name="el-fade-in-linear">
  179. <div style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;" v-if="!scope.row.jgzj.length">
  180. <i class="el-icon-plus" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 12)"></i>
  181. </div>
  182. </transition>
  183. <transition name="el-fade-in-linear">
  184. <div v-if="scope.row.jgzj.length" style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;">
  185. <span>{{scope.row['jgzj']&&scope.row['jgzj'].length?testformatterArray(scope.row['jgzj'],'name'):''}}</span>
  186. <i class="el-icon-edit" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 12)"></i>
  187. </div>
  188. </transition>
  189. </template>
  190. </el-table-column>
  191. <el-table-column
  192. header-align="center"
  193. align="center"
  194. min-width="150"
  195. label="计划专家"
  196. show-overflow-tooltip
  197. >
  198. <template slot-scope="scope">
  199. <transition name="el-fade-in-linear">
  200. <div style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;" v-if="!scope.row.jhzj.length">
  201. <i class="el-icon-plus" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 13)"></i>
  202. </div>
  203. </transition>
  204. <transition name="el-fade-in-linear">
  205. <div v-if="scope.row.jhzj.length" style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;">
  206. <span>{{scope.row['jhzj']&&scope.row['jhzj'].length?testformatterArray(scope.row['jhzj'],'name'):''}}</span>
  207. <i class="el-icon-edit" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 13)"></i>
  208. </div>
  209. </transition>
  210. </template>
  211. </el-table-column>
  212. <el-table-column
  213. header-align="center"
  214. align="center"
  215. min-width="150"
  216. label="财务专家"
  217. show-overflow-tooltip
  218. >
  219. <template slot-scope="scope">
  220. <transition name="el-fade-in-linear">
  221. <div style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;" v-if="!scope.row.cwzj.length">
  222. <i class="el-icon-plus" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 14)"></i>
  223. </div>
  224. </transition>
  225. <transition name="el-fade-in-linear">
  226. <div v-if="scope.row.cwzj.length" style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;">
  227. <span>{{scope.row['cwzj']&&scope.row['cwzj'].length?testformatterArray(scope.row['cwzj'],'name'):''}}</span>
  228. <i class="el-icon-edit" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 14)"></i>
  229. </div>
  230. </transition>
  231. </template>
  232. </el-table-column>
  233. <el-table-column
  234. header-align="center"
  235. align="center"
  236. min-width="150"
  237. label="质量专家"
  238. show-overflow-tooltip
  239. >
  240. <template slot-scope="scope">
  241. <transition name="el-fade-in-linear">
  242. <div style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;" v-if="!scope.row.zlzj.length">
  243. <i class="el-icon-plus" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 15)"></i>
  244. </div>
  245. </transition>
  246. <transition name="el-fade-in-linear">
  247. <div v-if="scope.row.zlzj.length" style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;">
  248. <span>{{scope.row['zlzj']&&scope.row['zlzj'].length?testformatterArray(scope.row['zlzj'],'name'):''}}</span>
  249. <i class="el-icon-edit" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 15)"></i>
  250. </div>
  251. </transition>
  252. </template>
  253. </el-table-column>
  254. <el-table-column
  255. header-align="center"
  256. align="center"
  257. min-width="150"
  258. label="安全专家"
  259. show-overflow-tooltip
  260. >
  261. <template slot-scope="scope">
  262. <transition name="el-fade-in-linear">
  263. <div style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;" v-if="!scope.row.aqzj.length">
  264. <i class="el-icon-plus" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 16)"></i>
  265. </div>
  266. </transition>
  267. <transition name="el-fade-in-linear">
  268. <div v-if="scope.row.aqzj.length" style="width:100%;height:100%;display:flex;flex-direction:row;justify-content:flex-end;align-items:center;">
  269. <span style="justify-content:flex-start;">{{scope.row['aqzj']&&scope.row['aqzj'].length?testformatterArray(scope.row['aqzj'],'name'):''}}</span>
  270. <i class="el-icon-edit" style="margin-left: 5px; cursor: pointer;" @click="roleTypeClick(scope.$index, scope.row, 16)"></i>
  271. </div>
  272. </transition>
  273. </template>
  274. </el-table-column>
  275. <el-table-column
  276. header-align="center"
  277. align="center"
  278. min-width="220"
  279. label="备注"
  280. >
  281. <template slot-scope="scope">
  282. <el-input
  283. style="width: 150px;padding: 0 0 0 30px;"
  284. v-model="scope.row.remark"
  285. size="small"
  286. @change="handleBzEdit(scope.$index, scope.row)">
  287. </el-input>
  288. </template>
  289. </el-table-column>
  290. <!--<el-table-column-->
  291. <!--header-align="center"-->
  292. <!--align="center"-->
  293. <!--min-width="120"-->
  294. <!--label="稽察组长联系"-->
  295. <!--&gt;</el-table-column>-->
  296. <el-table-column
  297. header-align="center"
  298. align="center"
  299. min-width="220"
  300. label="检测单位"
  301. >
  302. <template slot-scope="scope">
  303. <el-input
  304. style="width: 150px;padding: 0 0 0 30px;"
  305. v-model="scope.row.audUnits"
  306. size="small"
  307. @change="handleBzEdit(scope.$index, scope.row)">
  308. </el-input>
  309. </template>
  310. </el-table-column>
  311. <el-table-column
  312. header-align="center"
  313. align="center"
  314. min-width="220"
  315. label="稽察处别"
  316. >
  317. <template slot-scope="scope">
  318. <el-input
  319. style="width: 150px;padding: 0 0 0 30px;"
  320. v-model="scope.row.audCategory"
  321. size="small"
  322. @change="handleBzEdit(scope.$index, scope.row)">
  323. </el-input>
  324. </template>
  325. </el-table-column>
  326. </el-table>
  327. <!--<el-row style="margin-top: 15px;">-->
  328. <!--<el-col :span="24">-->
  329. <!--<el-button type="primary" size="medium" @click="addNewGroup">添加新组</el-button>-->
  330. <!--<el-button type="primary" size="medium" @click="delXzGroup">删除选中组</el-button>-->
  331. <!--<el-button type="primary" size="medium" @click="XzGroupLoction">选中组修改地点</el-button>-->
  332. <!--&lt;!&ndash;<el-button type="primary" size="medium" @click="XzGroupDelLoction">选中组中删除地点</el-button>&ndash;&gt;-->
  333. <!--&lt;!&ndash;<el-button type="primary" size="medium" @click="reallocate">重新分配(刷新)</el-button>&ndash;&gt;-->
  334. <!--&lt;!&ndash;<el-button type="primary" size="medium" @click="SingleRoleRefresh">单角色刷新</el-button>&ndash;&gt;-->
  335. <!--</el-col>-->
  336. <!--</el-row>-->
  337. <!--<el-row style="margin-top: 15px;">-->
  338. <!--<el-col :span="12">-->
  339. <!--<span>蓝色:历史稽察地规避失败,红色:地域规避失败,黄色:手动添加更改,粉色:被删除的人员</span>-->
  340. <!--</el-col>-->
  341. <!--<el-col :span="12" style="text-align: right;">-->
  342. <!--&lt;!&ndash;<el-button type="success" size="medium">导出Excel</el-button>&ndash;&gt;-->
  343. <!--</el-col>-->
  344. <!--</el-row>-->
  345. <!--</div>-->
  346. <el-dialog :close-on-click-modal="false" title="请选择要进行的操作" :visible.sync="XzRyJsVisible" width="40%" :modal-append-to-body="true" :append-to-body="true">
  347. <div style="text-align: center;">
  348. <span>请选择角色</span>
  349. <el-select v-model="XzJsType" clearable placeholder="请选择">
  350. <el-option :label="item.label" :value="item.value" v-for="(item,index) in XzJsTypeData" :key="index"></el-option>
  351. </el-select>
  352. </div>
  353. <div slot="footer" class="dialog-footer">
  354. <el-button type="danger" @click="XzRyJsVisible = false" size="medium">取 消</el-button>
  355. <el-button type="primary" @click="XzRyJsInfo" size="medium">确 定</el-button>
  356. </div>
  357. </el-dialog>
  358. <NewPersXzInfo v-if="addPersDialog" :roleTypes="roleType" :yearBatchId="rowData.yearBatchId" editAdd="editAdd" :rowData="rowData" :changeEdit="changeEdit" :changeDataList="changeDataList" @closeXzPers="closeXzPers"></NewPersXzInfo>
  359. <el-dialog :close-on-click-modal="false" title="请选择人员" :visible.sync="XzPersDialog" width="40%" :modal-append-to-body="true" :append-to-body="true">
  360. <div style="text-align: center;">
  361. <span>请选择人员</span>
  362. <el-select v-model="XzPers" clearable placeholder="请选择" multiple @change="changeDataClick" value-key="name">
  363. <el-option v-for="(item,index) in persListData" :label="item.name" :key="item.id" :value="item"></el-option>
  364. </el-select>
  365. </div>
  366. <div slot="footer" class="dialog-footer">
  367. <el-button type="danger" @click="XzPersDialog = false" size="medium">取 消</el-button>
  368. <el-button type="primary" @click="XzPersQd" size="medium">确 定</el-button>
  369. </div>
  370. </el-dialog>
  371. <!--确定稽察地点及原则-->
  372. <jiChaDiDian v-if="qdDdYzDialog" :persAreaId="persAreaId" @closeJcDdDialog="closeJcDdDialog" :changeUrl="changeUrl"></jiChaDiDian>
  373. <!--选中组修改地点-->
  374. <xuanZhongZuDiDian v-if="xZGroupDialog" :persAreaId="persAreaId" @closeXzGroupDdDialog="closeXzGroupDdDialog" :changeUrl="changeUrl" :multipleRowId="multipleRowId"></xuanZhongZuDiDian>
  375. <el-dialog :close-on-click-modal="false" title="请选择角色" :visible.sync="dialogRoleTypeVisible" width="40%" :modal-append-to-body="true" :append-to-body="true">
  376. <div style="text-align: center;">
  377. <span>请选择角色</span>
  378. <el-select v-model="roleTypeModel" clearable placeholder="请选择">
  379. <el-option :label="item.label" :value="item.value" v-for="(item,index) in roleTypeData" :key="index"></el-option>
  380. </el-select>
  381. </div>
  382. <div slot="footer" class="dialog-footer">
  383. <el-button type="danger" @click="dialogRoleTypeVisible = false" size="medium">取 消</el-button>
  384. <el-button type="primary" @click="roleTypeDetermine" size="medium">确 定</el-button>
  385. </div>
  386. </el-dialog>
  387. <!--稽察项目编辑-->
  388. <editDcdxInfo :nodeAreaList="nodeAreaList" :nodeRow="nodeRow" @closeDialog="closeDialog" v-if="editJcDialog"></editDcdxInfo>
  389. <!--稽察项目查看-->
  390. <viewDcdxInfo v-if="viewJcDialog" :groupId="groupId" @closeDialog="closeViewDialog"></viewDcdxInfo>
  391. <el-dialog :close-on-click-modal="false" title="请选择要删除的项目" :visible.sync="dialogObjTypeVisible" width="40%" :modal-append-to-body="true" :append-to-body="true">
  392. <div style="text-align: center;">
  393. <span>项目</span>
  394. <el-select v-model="objTypeModel" clearable placeholder="请选择">
  395. <el-option :label="item.ojbNm" :value="item.id" v-for="(item,index) in objTypeData" :key="index"></el-option>
  396. </el-select>
  397. </div>
  398. <div slot="footer" class="dialog-footer">
  399. <el-button type="danger" @click="dialogObjTypeVisible = false" size="medium">取 消</el-button>
  400. <el-button type="primary" @click="objTypeDetermine" size="medium">确 定</el-button>
  401. </div>
  402. </el-dialog>
  403. </div>
  404. </template>
  405. <script>
  406. import { dateFormat } from '../../utils/gw_date';
  407. import {
  408. formatterValueToLabel,
  409. formatterArrayToLabel
  410. } from "../../utils/gw_formatter.js";
  411. import request from '../../utils/gw_ajax_request'
  412. import NewPersXzInfo from './NewPersXzInfo'
  413. import jiChaDiDian from './jiChaDiDian'
  414. import xuanZhongZuDiDian from './xuanZhongZuDiDian'
  415. export default {
  416. name: "fenPeiDidian",
  417. props: ["distributionLocationResult","persAreaId","yearBatchId","jiChaJiHuaResults","form"],
  418. components:{
  419. NewPersXzInfo,
  420. jiChaDiDian,
  421. xuanZhongZuDiDian,
  422. editDcdxInfo:resolve => {require(['./editDcdxInfo_jc.vue'],resolve)},
  423. viewDcdxInfo:resolve => {require(['./viewDcdxInfo_jc.vue'],resolve)},
  424. },
  425. data(){
  426. return {
  427. loading:true,
  428. multipleSelection:[],
  429. jiChaJiHuaResult:[],
  430. tableHeight1: window.innerHeight * .7,
  431. XzRyJsVisible: false,
  432. XzJsType: "",
  433. XzJsTypeData:[
  434. // {
  435. // label:"查看人员信息",
  436. // value: "1"
  437. // },
  438. {
  439. label:"添加人员",
  440. value: "2"
  441. },
  442. {
  443. label:"更换人员",
  444. value: "3"
  445. },
  446. {
  447. label:"删除人员",
  448. value: "4"
  449. }
  450. ],
  451. addPersDialog: false,
  452. roleType: "",
  453. rowData: "",
  454. persListData:[],
  455. XzPersDialog: false,
  456. XzPers: [],
  457. changeEdit:"",
  458. changeDataList:[],
  459. qdDdYzDialog: false,
  460. changeUrl:"",
  461. xZGroupDialog: false,
  462. dialogRoleTypeVisible:false,
  463. roleTypeData:[
  464. {
  465. label:"前期专家",
  466. value: "11"
  467. },
  468. {
  469. label:"建管专家",
  470. value: "12"
  471. },
  472. {
  473. label:"计划专家",
  474. value: "13"
  475. },
  476. {
  477. label:"财务专家",
  478. value: "14"
  479. },
  480. {
  481. label:"质量专家",
  482. value: "15"
  483. },
  484. {
  485. label:"安全专家",
  486. value: "16"
  487. },
  488. {
  489. label:"助理",
  490. value: "19"
  491. },
  492. {
  493. label:"稽察组长",
  494. value: "20"
  495. }
  496. ],
  497. roleTypeModel: "",
  498. dialogObjTypeVisible: false,
  499. objTypeData:[],
  500. objTypeModel: "",
  501. multipleRowId:"",
  502. nodeAreaList:[],
  503. nodeRow:"",
  504. editJcDialog: false,
  505. viewJcDialog: false,
  506. groundId: ""
  507. }
  508. },
  509. create(){
  510. this.getTableListData();
  511. },
  512. computed:{
  513. userId:function(){
  514. return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
  515. },
  516. },
  517. methods:{
  518. getTableListData(){
  519. this.$nextTick(() =>{
  520. this.jiChaJiHuaResult = this.distributionLocationResult;
  521. console.log(this.jiChaJiHuaResult.length);
  522. console.log(this.jiChaJiHuaResult);
  523. this.getPerFl(this.jiChaJiHuaResult);
  524. this.jiChaJiHuaResult.forEach(item =>{
  525. if(item.stTm){
  526. item.stTm = dateFormat(item.stTm, "yyyy-MM-dd");
  527. }
  528. if(item.enTm){
  529. item.enTm = dateFormat(item.enTm, "yyyy-MM-dd");
  530. }
  531. });
  532. this.loading = false;
  533. })
  534. },
  535. getPerFl(arr){
  536. // 为列表分开稽察组长,助理,前期专家
  537. arr.forEach(element => {
  538. element["qqzj"] = [];//前期专家
  539. element["jgzj"] = [];//建管专家
  540. element["jhzj"] = [];//计划专家
  541. element["cwzj"] = [];//财务专家
  542. element["zlzj"] = [];//质量专家
  543. element["aqzj"] = [];//安全专家
  544. element["aid"] = [];//助理
  545. element["special"] = [];//稽察组长
  546. element["workersList"].forEach(per => {
  547. if (per.roleType == "11") {
  548. element["qqzj"].push(per);
  549. } else if (per.roleType == "12") {
  550. element["jgzj"].push(per);
  551. } else if (per.roleType == "13") {
  552. element["jhzj"].push(per);
  553. } else if (per.roleType == "14") {
  554. element["cwzj"].push(per);
  555. }else if (per.roleType == "15") {
  556. element["zlzj"].push(per);
  557. } else if (per.roleType == "16") {
  558. element["aqzj"].push(per);
  559. } else if (per.roleType == "19") {
  560. element["aid"].push(per);
  561. } else if (per.roleType == "20") {
  562. element["special"].push(per);
  563. }
  564. });
  565. });
  566. },
  567. //确定稽察地点及原则
  568. qrJcDd(){
  569. this.changeUrl = 'edit';
  570. this.qdDdYzDialog = true;
  571. },
  572. handleSelectionChange(val) {
  573. console.log(val);
  574. this.multipleSelection = val;
  575. },
  576. handleDdEdit(index, row) {
  577. console.log(index, row);
  578. },
  579. //备注
  580. handleBzEdit(index, row) {
  581. console.log(index, row);
  582. },
  583. //稽察组长编辑
  584. roleTypeClick(index, row, value){
  585. console.log(index, row, value);
  586. this.XzJsType = "";
  587. this.XzRyJsVisible = true;
  588. this.roleType = value;
  589. this.rowData = row;
  590. },
  591. //稽察项目编辑
  592. objTypeClick(index, row, value){
  593. console.log(index, row, value);
  594. if(row.areaList){
  595. this.nodeAreaList = row.areaList;
  596. }
  597. this.nodeRow = row;
  598. this.editJcDialog = true;
  599. },
  600. //稽察项目查看
  601. objTypeViewClick(index, row, value){
  602. this.groupId = row.id;
  603. console.log(index, row, value);
  604. this.viewJcDialog = true;
  605. },
  606. //稽察项目删除
  607. objTypeDelete(index, row, value){
  608. this.$confirm('此操作将删除该项目所有数据, 是否继续?', '提示', {
  609. confirmButtonText: '确定',
  610. cancelButtonText: '取消',
  611. type: 'warning'
  612. }).then(() => {
  613. console.log(index, row, value);
  614. this.$nextTick(()=>{
  615. this.objTypeData = row.objList;
  616. this.objTypeModel = "";
  617. this.dialogObjTypeVisible = true;
  618. })
  619. })
  620. },
  621. // 选择人员角色确定
  622. XzRyJsInfo(){
  623. if(this.XzJsType){
  624. this.XzPers = "";
  625. if(this.XzJsType == '2'){
  626. this.changeEdit = "add";
  627. this.addPersDialog = true;
  628. }else if(this.XzJsType == '3'){
  629. this.XzPersDialog = true;
  630. this.getPersList();
  631. }else if(this.XzJsType == '4'){
  632. this.XzPersDialog = true;
  633. this.getPersList();
  634. }
  635. this.XzRyJsVisible = false;
  636. }else{
  637. this.$message.warning("请选择角色");
  638. return;
  639. }
  640. },
  641. getPersList(){
  642. request.post(`/tac/worker/b/getWorkerbsListById`,{
  643. "roleType": this.roleType,
  644. "groupId": this.rowData.id
  645. }).then(res =>{
  646. if(res.success){
  647. this.persListData = res.data;
  648. }
  649. })
  650. },
  651. XzPersQd(){
  652. if(this.XzPers.length == "0"){
  653. this.$message.warning("请选择人员");
  654. return ;
  655. }
  656. if(this.XzJsType == '3'){
  657. this.changeEdit = "change";
  658. this.addPersDialog = true;
  659. }else if(this.XzJsType == '4'){
  660. if(this.changeDataList.length == "0"){
  661. this.$message.warning("请选择人员");
  662. }else{
  663. let obj = {
  664. "updateBs": this.changeDataList,
  665. "batchId": this.rowData.yearBatchId,
  666. "groupNm": this.rowData.groupNm,
  667. "groupId": this.rowData.id
  668. };
  669. request.post(`/tac/insp/year/batch/group/pers/updateGroupPers
  670. `,obj).then(res =>{
  671. if(res.success){
  672. this.$message.success("删除成功");
  673. this.XzPersDialog = false;
  674. this.refreshDistributionLocation();
  675. }else{
  676. this.$message.warning(res.message);
  677. }
  678. })
  679. }
  680. }
  681. },
  682. // closeXzRyDialog(){
  683. //
  684. // },
  685. //关闭稽察地点
  686. closeJcDdDialog(){
  687. this.qdDdYzDialog = false;
  688. this.refreshDistributionLocation();
  689. },
  690. //关闭选中组
  691. closeXzGroupDdDialog(){
  692. this.xZGroupDialog = false;
  693. this.refreshDistributionLocation();
  694. },
  695. closeXzPers(){
  696. this.addPersDialog = false;
  697. this.XzPersDialog = false;
  698. this.refreshDistributionLocation();
  699. },
  700. changeDataClick(item){
  701. console.log(item);
  702. this.changeDataList = item;
  703. },
  704. testformatterArray: function(
  705. arr,
  706. labelPropName,
  707. splitMark = ",",
  708. nonLabel = "",
  709. isAddNonLabel = true
  710. ) {
  711. let r = formatterArrayToLabel(
  712. arr,
  713. labelPropName,
  714. (splitMark = ","),
  715. (nonLabel = ""),
  716. (isAddNonLabel = true)
  717. );
  718. return r;
  719. },
  720. // 添加新组
  721. addNewGroup(){
  722. this.changeUrl = 'add';
  723. this.qdDdYzDialog = true;
  724. },
  725. // 删除选中组
  726. delXzGroup(){
  727. if(this.multipleSelection.length == 0){
  728. this.$message.warning("请选择组");
  729. return;
  730. }
  731. this.$confirm('确定要删除该组, 是否继续?', '提示', {
  732. confirmButtonText: '确定',
  733. cancelButtonText: '取消',
  734. type: 'warning'
  735. }).then(() => {
  736. let obj = {
  737. "groupList": this.multipleSelection
  738. }
  739. request.post(`/tac/insp/year/batch/group/deleteGroupList`,obj).then(res =>{
  740. if(res.success){
  741. this.$message.success("删除成功");
  742. this.refreshDistributionLocation();
  743. }else{
  744. this.$message.warning(res.message);
  745. }
  746. })
  747. }).catch(() => {
  748. this.$message({
  749. type: 'info',
  750. message: '已取消删除',
  751. duration: 1000
  752. });
  753. });
  754. },
  755. //选中组中添加地点
  756. XzGroupLoction(){
  757. if(this.multipleSelection.length == 0){
  758. this.$message.warning("请选择组");
  759. return;
  760. }else if(this.multipleSelection.length > 1){
  761. this.$message.warning("选中组修改地点不可多选");
  762. return;
  763. }
  764. this.multipleRowId = this.multipleSelection[0].id;
  765. this.xZGroupDialog = true;
  766. },
  767. //重新分配(刷新)
  768. reallocate(){
  769. if(this.jiChaJiHuaResult.length && this.jiChaJiHuaResults.length){
  770. this.$confirm('确定要重新分配, 是否继续?', '提示', {
  771. confirmButtonText: '确定',
  772. cancelButtonText: '取消',
  773. type: 'warning'
  774. }).then(() => {
  775. request.post(`/tac/worker/b/distributePers`,{
  776. "currPersId": this.userId,
  777. "prisId": this.persAreaId
  778. }).then(res =>{
  779. if(res.success){
  780. this.$message.success("重新分配成功");
  781. this.refreshDistributionLocation();
  782. }else{
  783. this.$message.error(res.message);
  784. }
  785. })
  786. }).catch(() => {
  787. this.$message({
  788. type: 'info',
  789. message: '已取消重新分配',
  790. duration: 1000
  791. });
  792. });
  793. }else{
  794. this.$message.warning("确定人选和分配地点不能为空");
  795. }
  796. },
  797. //单角色刷新
  798. SingleRoleRefresh(){
  799. if(this.jiChaJiHuaResult.length && this.jiChaJiHuaResults.length) {
  800. this.dialogRoleTypeVisible = true;
  801. }else{
  802. this.$message.warning("确定人选和分配地点不能为空");
  803. }
  804. },
  805. roleTypeDetermine(){
  806. // if(this.jiChaJiHuaResult.length && this.jiChaJiHuaResults.length){
  807. request.post(`/tac/worker/b/distributePers`,{
  808. "currPersId": this.userId,
  809. "prisId": this.persAreaId,
  810. "roleType": this.roleTypeModel
  811. }).then(res =>{
  812. if(res.success){
  813. this.$message.success("单角色刷新成功");
  814. this.dialogRoleTypeVisible = false;
  815. this.refreshDistributionLocation();
  816. }
  817. })
  818. // }
  819. },
  820. objTypeDetermine(){
  821. if(this.objTypeModel){
  822. request.post(`/tac/insp/year/batch/obj/cleanObjById`,{
  823. "id": this.objTypeModel,
  824. "ojbId": this.objTypeModel
  825. }).then(res =>{
  826. if(res.success){
  827. this.$message.success("删除成功");
  828. this.dialogObjTypeVisible = false;
  829. this.refreshDistributionLocation();
  830. }
  831. })
  832. }else{
  833. this.$message.warning("项目不能为空");
  834. }
  835. },
  836. // 刷新分配地点
  837. refreshDistributionLocation(){
  838. request.post(`/tac/insp/year/batch/group/getGroupList`,{
  839. // "yearBatchId": this.yearBatchId
  840. "year": this.form.year,
  841. "batch": this.form.batch,
  842. "persName": this.form.name
  843. }).then(res =>{
  844. if(res.success){
  845. this.$nextTick(() =>{
  846. this.jiChaJiHuaResult = res.data;
  847. this.getPerFl(this.jiChaJiHuaResult);
  848. this.jiChaJiHuaResult.forEach(item =>{
  849. item.inTm = dateFormat(item.inTm, "yyyy-MM-dd");
  850. })
  851. })
  852. }
  853. })
  854. },
  855. closeDialog(){
  856. this.editJcDialog = false;
  857. this.refreshDistributionLocation();
  858. },
  859. closeViewDialog(){
  860. this.viewJcDialog = false;
  861. this.refreshDistributionLocation();
  862. }
  863. },
  864. watch:{
  865. distributionLocationResult(n){
  866. this.jiChaJiHuaResult = n;
  867. this.getTableListData();
  868. }
  869. }
  870. }
  871. </script>
  872. <style lang="scss">
  873. .jcjl {
  874. input.el-input__inner {
  875. padding: 0 0 0 15px;
  876. }
  877. .el-table--scrollable-x .el-table__body-wrapper {
  878. overflow-x: auto;
  879. overflow-y: auto;
  880. }
  881. }
  882. </style>