index.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item :label="$t('开票日期')" label-width="50" prop="kprq">
  5. <el-date-picker
  6. v-model="chooseDate"
  7. @change="handleQuery"
  8. type="daterange"
  9. align="right"
  10. unlink-panels
  11. :range-separator="$t('至')"
  12. :start-placeholder="$t('开始日期')"
  13. :end-placeholder="$t('结束日期')"
  14. value-format="yyyy-MM-dd"
  15. :picker-options="pickerOptions">
  16. </el-date-picker>
  17. </el-form-item>
  18. <el-form-item :label="$t('签发班组')" label-width="50" prop="qfbz">
  19. <el-select v-model="queryParams.qfbz" :placeholder="$t('请选择') + $t('签发班组')" clearable size="small" @change="handleQuery">
  20. <el-option
  21. v-for="dict in qfbzOptions"
  22. :key="dict.dictValue"
  23. :label="dict.dictLabel"
  24. :value="dict.dictValue"
  25. />
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item :label="$t('新票/续票')" label-width="50" prop="xpxp">
  29. <el-select v-model="queryParams.xpxp" :placeholder="$t('请选择') + $t('新票/续票')" clearable size="small" @change="handleQuery">
  30. <el-option
  31. v-for="dict in xpxpOptions"
  32. :key="dict.dictValue"
  33. :label="dict.dictLabel"
  34. :value="dict.dictValue"
  35. />
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item :label="$t('火票级别')" label-width="50" prop="hpjb">
  39. <el-select v-model="queryParams.hpjb" :placeholder="$t('请选择') + $t('火票级别')" clearable size="small" @change="handleQuery">
  40. <el-option
  41. v-for="dict in hpjbOptions"
  42. :key="dict.dictValue"
  43. :label="dict.dictLabel"
  44. :value="dict.dictValue"
  45. />
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item :label="$t('作业票状态')" label-width="50" prop="zypzt">
  49. <el-select v-model="queryParams.zypzt" :placeholder="$t('请选择') + $t('作业票状态')" clearable size="small" @change="handleQuery">
  50. <el-option
  51. v-for="dict in zypztOptions"
  52. :key="dict.dictValue"
  53. :label="dict.dictLabel"
  54. :value="dict.dictValue"
  55. />
  56. </el-select>
  57. </el-form-item>
  58. <el-form-item :label="$t('限制空间许可证号')" label-width="50" prop="xzkjxkzh">
  59. <el-checkbox v-model="queryParams.xzkjxkzh" @change="handleQuery"></el-checkbox>
  60. </el-form-item>
  61. <el-form-item :label="$t('索引')" label-width="50" prop="tag">
  62. <el-select v-model="queryParams.tag" :placeholder="$t('请选择') + $t('索引')" filterable clearable size="small" @change="handleQuery">
  63. <el-option
  64. v-for="dict in tagOptions"
  65. :key="dict.tag"
  66. :label="dict.tag"
  67. :value="dict.tag"
  68. />
  69. </el-select>
  70. </el-form-item>
  71. <el-form-item>
  72. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
  73. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('重置') }}</el-button>
  74. </el-form-item>
  75. </el-form>
  76. <el-row :gutter="10" class="mb8">
  77. <el-col :span="1.5">
  78. <el-button
  79. type="primary"
  80. icon="el-icon-plus"
  81. size="mini"
  82. @click="handleAdd"
  83. v-hasPermi="['ehs:jobticket:add']"
  84. >{{ $t('新增') }}</el-button>
  85. </el-col>
  86. <!-- <el-col :span="1.5">
  87. <el-button
  88. type="success"
  89. icon="el-icon-edit"
  90. size="mini"
  91. :disabled="single"
  92. @click="handleUpdate"
  93. v-hasPermi="['ehs:jobticket:edit']"
  94. >{{ $t('修改') }}</el-button>
  95. </el-col>
  96. <el-col :span="1.5">
  97. <el-button
  98. type="danger"
  99. icon="el-icon-delete"
  100. size="mini"
  101. :disabled="multiple"
  102. @click="handleDelete"
  103. v-hasPermi="['ehs:jobticket:remove']"
  104. >{{ $t('删除') }}</el-button>
  105. </el-col>-->
  106. <el-col :span="1.5">
  107. <el-button
  108. type="warning"
  109. icon="el-icon-download"
  110. size="mini"
  111. @click="handleExport"
  112. v-hasPermi="['ehs:jobticket:export']"
  113. >{{ $t('导出') }}</el-button>
  114. </el-col>
  115. <el-col :span="1.5">
  116. <el-button
  117. type="primary"
  118. icon="el-icon-s-data"
  119. size="mini"
  120. @click="handleData"
  121. >{{ $t('数据分析') }}</el-button>
  122. </el-col>
  123. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  124. </el-row>
  125. <el-table v-loading="loading" :data="jobticketList"
  126. :height="clientHeight" border :cell-style="myclass"
  127. row-key="id"
  128. :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
  129. >
  130. <el-table-column :label="$t('开票日期')" align="center" prop="kprq" width="125">
  131. <template slot-scope="scope">
  132. <span>{{ parseTime(scope.row.kprq, '{y}-{m}-{d}') }}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column :label="$t('签发时间')" align="center" prop="qfsj" :show-overflow-tooltip="true"/>
  136. <el-table-column :label="$t('签发班组')" align="center" prop="qfbz" :formatter="qfbzFormat" />
  137. <el-table-column :label="$t('签发人')" align="center" prop="qfr" :show-overflow-tooltip="true"/>
  138. <el-table-column :label="$t('新票/续票')" align="center" prop="xpxp" width="100" :formatter="xpxpFormat" />
  139. <el-table-column :label="$t('延期许可证号')" align="center" prop="yqxkzh" width="100" :show-overflow-tooltip="true"/>
  140. <el-table-column :label="$t('危害工作许可证号')" align="center" prop="whgzxkzh" width="100" :show-overflow-tooltip="true"/>
  141. <el-table-column :label="$t('动火作业许可证号')" align="center" prop="dhzyxkzh" width="100" :show-overflow-tooltip="true"/>
  142. <el-table-column :label="$t('火票级别')" align="center" prop="hpjb" :formatter="hpjbFormat" />
  143. <el-table-column :label="$t('限制空间许可证号')" align="center" prop="xzkjxkzh" :show-overflow-tooltip="true"/>
  144. <el-table-column label="盲板作业许可证号" align="center" prop="mbzyxkzh" :show-overflow-tooltip="true"/>
  145. <el-table-column label="高处作业许可证号" align="center" prop="gczyxkzh" :show-overflow-tooltip="true"/>
  146. <el-table-column label="高处作业级别" align="center" prop="gczyjb" :formatter="gczyjbFormat"/>
  147. <el-table-column :label="$t('工作内容')" align="center" prop="content" width="300" :show-overflow-tooltip="true"/>
  148. <el-table-column :label="$t('BYC负责单位/联系人')" align="center" prop="byclxr" width="100" :show-overflow-tooltip="true"/>
  149. <el-table-column :label="$t('施工单位')" align="center" prop="sgdw" :show-overflow-tooltip="true"/>
  150. <el-table-column :label="$t('联系人')" align="center" prop="lxr" :show-overflow-tooltip="true"/>
  151. <el-table-column :label="$t('联系电话')" align="center" prop="lxdh" width="100" :show-overflow-tooltip="true"/>
  152. <el-table-column :label="$t('销票时间')" align="center" prop="xpsj" width="100">
  153. <template slot-scope="scope">
  154. <span>{{ parseTime(scope.row.xpsj, '{y}-{m}-{d}') }}</span>
  155. </template>
  156. </el-table-column>
  157. <el-table-column :label="$t('作业票状态')" align="center" prop="zypzt" width="200" :formatter="zypztFormat" >
  158. <template slot-scope="scope" v-if="scope.row.zypzt != null">
  159. <el-dropdown placement="bottom" trigger="click">
  160. <span class="el-dropdown-link">
  161. <span style=" font-size: 13px" v-if="scope.row.zypzt==10">{{"作业票未销"}}</span>
  162. <span style=" font-size: 13px" v-if="scope.row.zypzt==18">{{"作业票收回,作业票关闭"}}</span>
  163. <span style="font-size: 13px" v-if="scope.row.zypzt==16">{{"作业票延期"}}</span>
  164. <span style="font-size: 13px" v-if="scope.row.zypzt==20">{{"作业票作废"}}</span>
  165. <i class="el-icon-caret-bottom"></i>
  166. </span>
  167. <el-dropdown-menu slot="dropdown">
  168. <el-dropdown-item @click.native="statusWX(0, scope.row)">{{ $t('作业票未销') }}</el-dropdown-item>
  169. <el-dropdown-item @click.native="statusGBSH(0, scope.row)">{{ $t('作业票关闭,作业票收回') }}</el-dropdown-item>
  170. <el-dropdown-item @click.native="statusYQ(0, scope.row)">{{ $t('作业票延期') }}</el-dropdown-item>
  171. <el-dropdown-item @click.native="statusZF(0, scope.row)">{{ $t('作业票作废') }}</el-dropdown-item>
  172. </el-dropdown-menu>
  173. </el-dropdown>
  174. </template>
  175. </el-table-column>
  176. <el-table-column :label="$t('检查/存档人')" align="center" prop="jccdr" :show-overflow-tooltip="true"/>
  177. <el-table-column :label="$t('未撤销项编号')" align="center" prop="wcxxbh" :show-overflow-tooltip="true"/>
  178. <el-table-column :label="$t('未撤销状态')" align="center" prop="wcxzt" :formatter="wcxztFormat">
  179. <template slot-scope="scope" v-if="scope.row.wcxzt != null">
  180. <el-dropdown placement="bottom" trigger="click">
  181. <span class="el-dropdown-link">
  182. <span style=" font-size: 13px" v-if="scope.row.wcxzt==10">{{"有"}}</span>
  183. <span style=" font-size: 13px" v-if="scope.row.wcxzt==12">{{"无"}}</span>
  184. <i class="el-icon-caret-bottom"></i>
  185. </span>
  186. <el-dropdown-menu slot="dropdown">
  187. <el-dropdown-item @click.native="wcxztYOU(0, scope.row)">{{ $t('有') }}</el-dropdown-item>
  188. <el-dropdown-item @click.native="wcxztWU(0, scope.row)">{{ $t('无') }}</el-dropdown-item>
  189. </el-dropdown-menu>
  190. </el-dropdown>
  191. </template>
  192. </el-table-column>
  193. <el-table-column :label="$t('撤销时间')" align="center" prop="cxsj" width="100">
  194. <template slot-scope="scope">
  195. <span>{{ parseTime(scope.row.cxsj, '{y}-{m}-{d}') }}</span>
  196. </template>
  197. </el-table-column>
  198. <el-table-column :label="$t('索引')" align="center" prop="tag" :show-overflow-tooltip="true"/>
  199. <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
  200. <el-table-column :label="$t('操作')" align="center" fixed="right" width="160" class-name="small-padding fixed-width">
  201. <template slot-scope="scope">
  202. <el-button
  203. size="mini"
  204. type="text"
  205. icon="el-icon-edit"
  206. @click="handleUpdate(scope.row)"
  207. v-hasPermi="['ehs:jobticket:edit']"
  208. >{{ $t('修改') }}</el-button>
  209. <el-button
  210. size="mini"
  211. type="text"
  212. icon="el-icon-delete"
  213. @click="handleDelete(scope.row)"
  214. v-hasPermi="['ehs:jobticket:remove']"
  215. >{{ $t('删除') }}</el-button>
  216. <el-button
  217. v-if="scope.row.xpxp=='10'"
  218. size="mini"
  219. type="text"
  220. icon="el-icon-date"
  221. @click="handlePostpone(scope.row)"
  222. v-hasPermi="['ehs:jobticket:add']"
  223. >{{ $t('延期') }}</el-button>
  224. </template>
  225. </el-table-column>
  226. </el-table>
  227. <pagination
  228. v-show="total>0"
  229. :total="total"
  230. :page.sync="queryParams.pageNum"
  231. :limit.sync="queryParams.pageSize"
  232. @pagination="getList"
  233. />
  234. <!-- 添加或修改工作票对话框 -->
  235. <el-dialog v-dialogDrag :title="title" :visible.sync="open" width="500px" append-to-body>
  236. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  237. <el-form-item :label="$t('开票日期')" prop="kprq">
  238. <el-date-picker clearable size="small" style="width: 200px"
  239. v-model="form.kprq"
  240. type="date"
  241. value-format="yyyy-MM-dd"
  242. :placeholder="$t('请选择') + $t('开票日期')">
  243. </el-date-picker>
  244. </el-form-item>
  245. <el-form-item :label="$t('签发时间')" prop="qfsj">
  246. <el-input v-model="form.qfsj" :placeholder="$t('请输入') + $t('签发时间')" />
  247. </el-form-item>
  248. <el-form-item :label="$t('签发班组')" prop="qfbz">
  249. <el-select v-model="form.qfbz" :placeholder="$t('请选择') + $t('签发班组')">
  250. <el-option
  251. v-for="dict in qfbzOptions"
  252. :key="dict.dictValue"
  253. :label="dict.dictLabel"
  254. :value="dict.dictValue"
  255. ></el-option>
  256. </el-select>
  257. </el-form-item>
  258. <el-form-item :label="$t('签发人')" prop="qfr">
  259. <el-input v-model="form.qfr" :placeholder="$t('请输入') + $t('签发人')" />
  260. </el-form-item>
  261. <el-form-item :label="$t('新票/续票')" prop="xpxp" v-if="isxp">
  262. <el-select v-model="form.xpxp" :placeholder="$t('请选择') + $t('新票/续票')">
  263. <el-option
  264. v-for="dict in xpxpOptions"
  265. :key="dict.dictValue"
  266. :label="dict.dictLabel"
  267. :value="dict.dictValue"
  268. ></el-option>
  269. </el-select>
  270. </el-form-item>
  271. <el-form-item :label="$t('延期许可证号')" prop="yqxkzh">
  272. <el-input v-model="form.yqxkzh" :placeholder="$t('请输入') + $t('延期许可证号')" />
  273. </el-form-item>
  274. <el-form-item :label="$t('危害工作许可证号')" prop="whgzxkzh">
  275. <el-input v-model="form.whgzxkzh" :placeholder="$t('请输入') + $t('危害工作许可证号')" />
  276. </el-form-item>
  277. <el-form-item :label="$t('动火作业许可证号')" prop="dhzyxkzh">
  278. <el-input v-model="form.dhzyxkzh" :placeholder="$t('请输入') + $t('动火作业许可证号')" />
  279. </el-form-item>
  280. <el-form-item :label="$t('火票级别')" prop="hpjb">
  281. <el-select v-model="form.hpjb" :placeholder="$t('请选择') + $t('火票级别')">
  282. <el-option
  283. v-for="dict in hpjbOptions"
  284. :key="dict.dictValue"
  285. :label="dict.dictLabel"
  286. :value="dict.dictValue"
  287. ></el-option>
  288. </el-select>
  289. </el-form-item>
  290. <el-form-item :label="$t('限制空间许可证号')" prop="xzkjxkzh">
  291. <el-input v-model="form.xzkjxkzh" :placeholder="$t('请输入') + $t('限制空间许可证号')" />
  292. </el-form-item>
  293. <el-form-item :label="$t('内容')" prop="content">
  294. <el-input v-model="form.content" :placeholder="$t('请输入') + $t('内容')" />
  295. </el-form-item>
  296. <el-form-item label="用户单位" prop="userUnit">
  297. <el-select v-model="form.userUnit" placeholder="请选择用户单位" @change="checkCategoryPromotionUpdate(form.userUnit)">
  298. <el-option
  299. v-for="dict in userUnitOptions"
  300. :key="dict.dictValue"
  301. :label="dict.dictLabel"
  302. :value="parseInt(dict.dictValue)"
  303. ></el-option>
  304. </el-select>
  305. </el-form-item>
  306. <el-form-item label="用户主管" prop="userMg">
  307. <el-select v-model="form.userMg" placeholder="请先选择好用户单位" @change="pick">
  308. <el-option
  309. v-for="dict in userMgOptions"
  310. :key="dict.userId"
  311. :label="dict.nickName"
  312. :value="dict.userId"
  313. ></el-option>
  314. </el-select>
  315. </el-form-item>
  316. <el-form-item :label="$t('施工单位')" prop="sgdw">
  317. <el-select v-model="form.sgdw" placeholder="请选择施工单位" @change="selectworkUnit(form.sgdw)">
  318. <el-option
  319. v-for="dict in sgdwOptions"
  320. :key="dict.id"
  321. :label="dict.label"
  322. :value="dict.id"
  323. ></el-option>
  324. </el-select>
  325. </el-form-item>
  326. <el-form-item :label="$t('联系人')" prop="lxr">
  327. <el-input v-model="form.lxr" :placeholder="$t('请输入') + $t('联系人')" />
  328. </el-form-item>
  329. <el-form-item :label="$t('联系电话')" prop="lxdh">
  330. <el-input v-model="form.lxdh" :placeholder="$t('请输入') + $t('联系电话')" />
  331. </el-form-item>
  332. <el-form-item :label="$t('销票时间')" prop="xpsj">
  333. <el-date-picker clearable size="small" style="width: 200px"
  334. v-model="form.xpsj"
  335. type="date"
  336. value-format="yyyy-MM-dd"
  337. :placeholder="$t('请选择') + $t('销票时间')">
  338. </el-date-picker>
  339. </el-form-item>
  340. <el-form-item :label="$t('作业票状态')" prop="zypzt">
  341. <el-select v-model="form.zypzt" :placeholder="$t('请选择') + $t('作业票状态')">
  342. <el-option
  343. v-for="dict in zypztOptions"
  344. :key="dict.dictValue"
  345. :label="dict.dictLabel"
  346. :value="dict.dictValue"
  347. ></el-option>
  348. </el-select>
  349. </el-form-item>
  350. <el-form-item :label="$t('检查/存档人')" prop="jccdr">
  351. <el-input v-model="form.jccdr" :placeholder="$t('请输入') + $t('检查/存档人')" />
  352. </el-form-item>
  353. <el-form-item :label="$t('未撤销项编号')" prop="wcxxbh">
  354. <el-input v-model="form.wcxxbh" :placeholder="$t('请输入') + $t('未撤销项编号')" />
  355. </el-form-item>
  356. <el-form-item :label="$t('未撤销状态')" prop="wcxzt">
  357. <el-select v-model="form.wcxzt" :placeholder="$t('请选择') + $t('未撤销状态')">
  358. <el-option
  359. v-for="dict in wcxztOptions"
  360. :key="dict.dictValue"
  361. :label="dict.dictLabel"
  362. :value="dict.dictValue"
  363. ></el-option>
  364. </el-select>
  365. </el-form-item>
  366. <el-form-item :label="$t('撤销时间')" prop="cxsj">
  367. <el-date-picker clearable size="small" style="width: 200px"
  368. v-model="form.cxsj"
  369. type="date"
  370. value-format="yyyy-MM-dd"
  371. :placeholder="$t('请选择') + $t('撤销时间')">
  372. </el-date-picker>
  373. </el-form-item>
  374. <el-form-item label="索引" prop="tag">
  375. <el-select v-model="form.tag" clearable placeholder="请选择索引">
  376. <el-option
  377. v-for="dict in tagOptions"
  378. :key="dict.tag"
  379. :label="dict.tag"
  380. :value="dict.tag"
  381. ></el-option>
  382. </el-select>
  383. </el-form-item>
  384. <el-form-item :label="$t('备注')" prop="remarks">
  385. <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" />
  386. </el-form-item>
  387. <el-form-item :label="$t('归属部门')" prop="deptId">
  388. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" :placeholder="$t('请选择') + $t('归属部门')" />
  389. </el-form-item>
  390. </el-form>
  391. <div slot="footer" class="dialog-footer">
  392. <el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
  393. <el-button @click="cancel">{{ $t('取 消') }}</el-button>
  394. </div>
  395. </el-dialog>
  396. <!-- 用户导入对话框 -->
  397. <el-dialog v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  398. <el-upload
  399. ref="upload"
  400. :limit="1"
  401. accept=".xlsx, .xls"
  402. :headers="upload.headers"
  403. :action="upload.url"
  404. :disabled="upload.isUploading"
  405. :on-progress="handleFileUploadProgress"
  406. :on-success="handleFileSuccess"
  407. :auto-upload="false"
  408. drag
  409. >
  410. <i class="el-icon-upload"></i>
  411. <div class="el-upload__text">
  412. {{ $t('将文件拖到此处,或') }}
  413. <em>{{ $t('点击上传') }}</em>
  414. </div>
  415. <div class="el-upload__tip" slot="tip">
  416. <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
  417. <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
  418. </div>
  419. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  420. <input name="type" :value="upload.type" hidden />
  421. </form>
  422. <div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
  423. </el-upload>
  424. <div slot="footer" class="dialog-footer">
  425. <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>
  426. <el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
  427. </div>
  428. </el-dialog>
  429. <el-drawer
  430. :title="$t('数据分析')"
  431. size="600px"
  432. :visible.sync="drawer"
  433. :direction="direction">
  434. <el-row>
  435. <el-col>
  436. <el-card class="box-card" shadow="hover">
  437. <div slot="header" class="clearfix">
  438. <span>{{ this.$t('火票级别统计') }}</span>
  439. </div>
  440. <div class="text item">
  441. <fire-data></fire-data>
  442. </div>
  443. </el-card>
  444. </el-col>
  445. </el-row>
  446. </el-drawer>
  447. <el-dialog title="延期作业许可" :visible.sync="guanlianVisible" width="30%" center>
  448. <el-form ref="form" :model="postponeform" :rules="rules1" label-width="80px">
  449. <el-form-item :label="$t('开票日期')" prop="kprq">
  450. <el-date-picker clearable size="small" style="width: 200px"
  451. v-model="postponeform.kprq"
  452. type="date"
  453. value-format="yyyy-MM-dd"
  454. :placeholder="$t('请选择') + $t('开票日期')">
  455. </el-date-picker>
  456. </el-form-item>
  457. <el-form-item :label="$t('签发时间')" prop="qfsj">
  458. <el-input v-model="postponeform.qfsj" :placeholder="$t('请输入') + $t('签发时间')" />
  459. </el-form-item>
  460. <el-form-item :label="$t('签发班组')" prop="qfbz">
  461. <el-select v-model="postponeform.qfbz" :placeholder="$t('请选择') + $t('签发班组')">
  462. <el-option
  463. v-for="dict in qfbzOptions"
  464. :key="dict.dictValue"
  465. :label="dict.dictLabel"
  466. :value="dict.dictValue"
  467. ></el-option>
  468. </el-select>
  469. </el-form-item>
  470. <el-form-item :label="$t('签发人')" prop="qfr">
  471. <el-input v-model="postponeform.qfr" :placeholder="$t('请输入') + $t('签发人')" />
  472. </el-form-item>
  473. <el-form-item :label="$t('延期许可证号')" prop="yqxkzh">
  474. <el-input v-model="postponeform.yqxkzh" :placeholder="$t('请输入') + $t('延期许可证号')" />
  475. </el-form-item>
  476. </el-form>
  477. <div slot="footer" class="dialog-footer">
  478. <el-button @click="guanlianVisible=false">取 消</el-button>
  479. <el-button type="primary" @click="submitPostpone()">确 定</el-button>
  480. </div>
  481. </el-dialog>
  482. </div>
  483. </template>
  484. <script>
  485. import { listJobticket, getJobticket, delJobticket, addJobticket, updateJobticket, exportJobticket ,selectChengbaoshang} from "@/api/ehs/jobticket";
  486. import { listUnit, getUnit, delUnit, addUnit, updateUnit, exportUnit,getUserByUnit} from "@/api/invoice/unit";
  487. import { treeselect,getDept } from "@/api/system/dept";
  488. import { getToken } from "@/utils/auth";
  489. import Treeselect from "@riophae/vue-treeselect";
  490. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  491. import FireData from "./fireData";
  492. import { listTagAll} from "@/api/invoice/tag";
  493. export default {
  494. name: "Jobticket",
  495. components: {FireData, Treeselect },
  496. data() {
  497. return {
  498. //新票新增
  499. isxp:false,
  500. //延期对话框
  501. guanlianVisible:false,
  502. yqzyxkzh:"",
  503. drawer: false,
  504. direction: 'rtl',
  505. // 遮罩层
  506. loading: true,
  507. // 选中数组
  508. ids: [],
  509. // 非单个禁用
  510. single: true,
  511. // 非多个禁用
  512. multiple: true,
  513. // 显示搜索条件
  514. showSearch: false,
  515. // 总条数
  516. total: 0,
  517. // 工作票表格数据
  518. jobticketList: [],
  519. // 弹出层标题
  520. title: "",
  521. // 部门树选项
  522. deptOptions: undefined,
  523. clientHeight:300,
  524. // 是否显示弹出层
  525. open: false,
  526. // 装置字典
  527. plantCodeOptions: [],
  528. // 签发班组字典
  529. qfbzOptions: [],
  530. // 新票/续票字典
  531. xpxpOptions: [],
  532. // 火票级别字典
  533. hpjbOptions: [],
  534. // 作业票状态字典
  535. zypztOptions: [],
  536. // 高处作业级别字典
  537. gczyjbOptions: [],
  538. //作业票未撤销状态字典
  539. wcxztOptions:[],
  540. //施工单位字典
  541. sgdwOptions:[],
  542. // 用户单位字典
  543. userUnitOptions: [],
  544. // 用户主管字典
  545. userMgOptions: [],
  546. tagOptions: [],
  547. // 用户导入参数
  548. upload: {
  549. //下载模板请求地址
  550. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  551. //下载模板类型
  552. type: "jobticket",
  553. // 是否显示弹出层(用户导入)
  554. open: false,
  555. // 弹出层标题(用户导入)
  556. title: "",
  557. // 是否禁用上传
  558. isUploading: false,
  559. // 是否更新已经存在的用户数据
  560. updateSupport: 0,
  561. // 设置上传的请求头部
  562. headers: { Authorization: "Bearer " + getToken() },
  563. // 上传的地址
  564. url: process.env.VUE_APP_BASE_API + "/ehs/jobticket/importData"
  565. },
  566. // 查询参数
  567. queryParams: {
  568. pageNum: 1,
  569. pageSize: 20,
  570. plantCode: null,
  571. kprq: null,
  572. startDate: null,
  573. endDate: null,
  574. qfsj: null,
  575. qfbz: null,
  576. qfr: null,
  577. xpxp: null,
  578. whgzxkzh: null,
  579. dhzyxkzh: null,
  580. hpjb: null,
  581. xzkjxkzh: null,
  582. content: null,
  583. byclxr: null,
  584. sgdw: null,
  585. lxr: null,
  586. lxdh: null,
  587. xpsj: null,
  588. zypzt: null,
  589. jccdr: null,
  590. wcxxbh: null,
  591. wcxzt: null,
  592. cxsj: null,
  593. tag: null
  594. },
  595. //日期快速选择
  596. pickerOptions: {
  597. shortcuts: [{
  598. text: this.$t('最近一周'),
  599. onClick(picker) {
  600. const end = new Date();
  601. const start = new Date();
  602. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  603. picker.$emit('pick', [start, end]);
  604. }
  605. }, {
  606. text: this.$t('最近一个月'),
  607. onClick(picker) {
  608. const end = new Date();
  609. const start = new Date();
  610. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  611. picker.$emit('pick', [start, end]);
  612. }
  613. }, {
  614. text: this.$t('最近三个月'),
  615. onClick(picker) {
  616. const end = new Date();
  617. const start = new Date();
  618. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  619. picker.$emit('pick', [start, end]);
  620. }
  621. }]
  622. },
  623. //日期选择器
  624. chooseDate: [],
  625. // 表单参数
  626. form: {},
  627. //延期参数
  628. postponeParams:{},
  629. //延期表单
  630. postponeform:{},
  631. // 表单校验
  632. rules: {
  633. plantCode: [
  634. { required: true, message: this.$t('装置') + this.$t('不能为空'), trigger: "change" }
  635. ],
  636. deptId: [
  637. { required: true, message: this.$t('部门编号') + this.$t('不能为空'), trigger: "blur" }
  638. ],
  639. xpxp: [
  640. { required: true, message: this.$t('手动新增只能为新票'), trigger: "blur" },
  641. {validator: this.xpxp, trigger: 'blur'}
  642. ]
  643. },
  644. rules1: {
  645. yqxkzh: [
  646. { required: true, message: this.$t('当前续票必填'), trigger: "blur" }
  647. ],
  648. }
  649. };
  650. },
  651. watch: {
  652. // 根据名称筛选部门树
  653. deptName(val) {
  654. this.$refs.tree.filter(val);
  655. }
  656. },
  657. created() {
  658. //设置表格高度对应屏幕高度
  659. this.$nextTick(() => {
  660. this.clientHeight = (document.body.clientHeight - 80) * 0.8
  661. })
  662. this.getList();
  663. this.getTreeselect();
  664. this.getChengbaoshang();
  665. this.getTagList()
  666. this.getDicts("PLANT_DIVIDE").then(response => {
  667. this.plantCodeOptions = response.data;
  668. });
  669. this.getDicts("QFBZ").then(response => {
  670. this.qfbzOptions = response.data;
  671. });
  672. this.getDicts("XPXP").then(response => {
  673. this.xpxpOptions = response.data;
  674. });
  675. this.getDicts("HPJB").then(response => {
  676. this.hpjbOptions = response.data;
  677. });
  678. this.getDicts("ZYPZT").then(response => {
  679. this.zypztOptions = response.data;
  680. });
  681. //高处作业级别
  682. this.getDicts("GCZYJB").then(response => {
  683. this.gczyjbOptions = response.data;
  684. });
  685. this.getDicts("TICKED_WCXZT").then(response => {
  686. this.wcxztOptions = response.data;
  687. });
  688. this.getDicts("book_user_unit").then(response => {
  689. this.userUnitOptions = response.data;
  690. });
  691. },
  692. methods: {
  693. //根据用户单位 查询对应选择的用户主管 根据用户单位 字段 查找对应的多个主管 返回 Sysuser的集合(id,name)
  694. checkCategoryPromotion(oneId){
  695. getUserByUnit(oneId).then(response => {
  696. // this.form.userMg=null;
  697. this.userMgOptions = response.data;
  698. // let arr= response.data.userIds.split(',');
  699. });
  700. },
  701. //修改用户单位时,级联的用户主管下拉数据应清空,否则会造成用户修改了用户单位,但未重新选择相应的用户主管
  702. checkCategoryPromotionUpdate(oneId){
  703. this.form.userMg=null;
  704. getUserByUnit(oneId).then(response => {
  705. // this.form.userMg=null;
  706. this.userMgOptions = response.data;
  707. // let arr= response.data.userIds.split(',');
  708. });
  709. },
  710. //修改延期时的用户单位
  711. checkCategoryPromotionRenew(oneId){
  712. this.postponeform.userMg=null;
  713. getUserByUnit(oneId).then(response => {
  714. this.userMgOptions = response.data;
  715. });
  716. },
  717. //主管下拉框变动重新刷新赋值
  718. pick(){
  719. this.$forceUpdate()
  720. },
  721. //查找施工单位
  722. selectworkUnit(oneId){
  723. getDept(oneId).then(response => {
  724. this.form.lxr = response.data.leader;
  725. this.form.lxdh=response.data.phone
  726. });
  727. },
  728. //查找承包商列表
  729. getChengbaoshang(){
  730. treeselect().then(response => {
  731. this.sgdwOptions = response.data[1].children;
  732. });
  733. },
  734. //得到索引下拉框
  735. getTagList(){
  736. listTagAll().then(response => {
  737. this.tagOptions = response
  738. });
  739. },
  740. //延期 即新增一条 改为续票
  741. handlePostpone(row){
  742. this.guanlianVisible=true
  743. const id = row.id || this.ids
  744. getJobticket(id).then(response => {
  745. this.postponeform = response.data;
  746. // this.checkCategoryPromotion(response.data.userUnit);
  747. });
  748. this.postponeParams=row
  749. },
  750. //新的 续票 构造票号 最多五次
  751. submitPostpone(){
  752. this.guanlianVisible=false
  753. //保留新票的参数 用来修改新票
  754. const id =this.postponeParams.id
  755. const postponeNumber=this.postponeParams.postponeNumber+1;
  756. const yqxkzh=this.postponeform.yqxkzh
  757. //续票的参数
  758. this.postponeParams.id=null
  759. this.postponeParams.yqxkzh=this.postponeform.yqxkzh
  760. this.postponeParams.xpxp="12"
  761. this.postponeParams.zypzt="10"
  762. this.postponeParams.kprq=this.postponeform.kprq
  763. this.postponeParams.qfsj=this.postponeform.qfsj
  764. this.postponeParams.qfbz=this.postponeform.qfbz
  765. this.postponeParams.qfr=this.postponeform.qfr
  766. if(postponeNumber>15){
  767. return this.msgError("当前作业票最多可以延期十五次,请重新开票");
  768. }else{
  769. if(this.postponeParams.yqxkzh.endsWith('-6')){
  770. this.msgError("每张续票最多可以延期五次,请重新命名生成新的续票");
  771. this.getList();
  772. }else{
  773. //若果是第一次延期 延期许可证取输入的 后续的都是原来
  774. let putData={}
  775. putData.id=id
  776. putData.postponeNumber=postponeNumber
  777. if(putData.postponeNumber==1){
  778. putData.yqxkzh=yqxkzh.substring(0, yqxkzh.indexOf("-"));
  779. updateJobticket(putData).then(response => {
  780. });
  781. }else{
  782. putData.yqxkzh=yqxkzh
  783. }
  784. addJobticket(this.postponeParams).then(response => {
  785. this.msgSuccess(this.$t('延期成功,请查看新的续票'));
  786. this.open = false;
  787. this.getList();
  788. });
  789. }
  790. }
  791. },
  792. //修改单元格样式的方法
  793. myclass({ row, column, rowIndex, columnIndex }) {
  794. if ( row.zypzt == 10){
  795. return "background-color:rgba(255, 68,68, 0.5);"
  796. }
  797. if ( row.zypzt == 18||row.zypzt==14){
  798. return "background-color:rgba(21,180,51, 0.5);"
  799. }
  800. if (row.zypzt == 16){
  801. return "background-color:rgba(221,248,9, 0.5);"
  802. }
  803. if (row.zypzt == 20){
  804. return "background-color:rgba(163, 150,150, 0.5);"
  805. }
  806. },
  807. /** 查询工作票列表 */
  808. getList() {
  809. this.loading = true;
  810. listJobticket(this.queryParams).then(response => {
  811. this.jobticketList = response.rows;
  812. this.total = response.total;
  813. this.loading = false;
  814. });
  815. },
  816. /** 查询部门下拉树结构 */
  817. getTreeselect() {
  818. treeselect().then(response => {
  819. this.deptOptions = response.data;
  820. });
  821. },
  822. // 装置字典翻译
  823. plantCodeFormat(row, column) {
  824. return this.selectDictLabel(this.plantCodeOptions, row.plantCode);
  825. },
  826. // 签发班组字典翻译
  827. qfbzFormat(row, column) {
  828. return this.selectDictLabel(this.qfbzOptions, row.qfbz);
  829. },
  830. // 新票/续票字典翻译
  831. xpxpFormat(row, column) {
  832. return this.selectDictLabel(this.xpxpOptions, row.xpxp);
  833. },
  834. // 火票级别字典翻译
  835. hpjbFormat(row, column) {
  836. return this.selectDictLabel(this.hpjbOptions, row.hpjb);
  837. },
  838. // 作业票状态字典翻译
  839. zypztFormat(row, column) {
  840. return this.selectDictLabel(this.zypztOptions, row.zypzt);
  841. },
  842. // 高处作业级别字典翻译
  843. gczyjbFormat(row, column) {
  844. return this.selectDictLabel(this.gczyjbOptions, row.gczyjb);
  845. },
  846. wcxztFormat(row, column) {
  847. return this.selectDictLabel(this.wcxztOptions, row.wcxzt);
  848. },
  849. // 取消按钮
  850. cancel() {
  851. this.open = false;
  852. this.reset();
  853. },
  854. //变换作业票状态
  855. statusWX (index, row) {
  856. this.form = row;
  857. row.zypzt = 10;
  858. this.form.zypzt = 10;
  859. updateJobticket(this.form).then(response => {
  860. this.msgSuccess(this.$t('修改成功'));
  861. this.open = false;
  862. this.getList();
  863. });
  864. },
  865. statusGBSH (index, row) {
  866. this.form = row;
  867. this.form.zypzt = 18;
  868. updateJobticket(this.form).then(response => {
  869. this.msgSuccess(this.$t('修改成功'));
  870. this.open = false;
  871. this.getList();
  872. });
  873. },
  874. statusYQ (index, row) {
  875. this.form = row;
  876. this.form.zypzt = 16;
  877. updateJobticket(this.form).then(response => {
  878. this.msgSuccess(this.$t('修改成功'));
  879. this.open = false;
  880. this.getList();
  881. });
  882. },
  883. statusZF (index, row) {
  884. this.form = row;
  885. this.form.zypzt = 20;
  886. updateJobticket(this.form).then(response => {
  887. this.msgSuccess(this.$t('修改成功'));
  888. this.open = false;
  889. this.getList();
  890. });
  891. },
  892. wcxztYOU (index, row) {
  893. this.form = row;
  894. this.form.wcxzt = 10;
  895. updateJobticket(this.form).then(response => {
  896. this.msgSuccess(this.$t('修改成功'));
  897. this.open = false;
  898. this.getList();
  899. });
  900. },
  901. wcxztWU (index, row) {
  902. this.form = row;
  903. this.form.wcxzt = 12;
  904. updateJobticket(this.form).then(response => {
  905. this.msgSuccess(this.$t('修改成功'));
  906. this.open = false;
  907. this.getList();
  908. });
  909. },
  910. // 表单重置
  911. reset() {
  912. this.form = {
  913. id: null,
  914. plantCode: null,
  915. kprq: null,
  916. startDate: null,
  917. endDate: null,
  918. qfsj: null,
  919. qfbz: null,
  920. qfr: null,
  921. xpxp: null,
  922. yqxkzh: null,
  923. whgzxkzh: null,
  924. dhzyxkzh: null,
  925. hpjb: null,
  926. xzkjxkzh: null,
  927. content: null,
  928. byclxr: null,
  929. sgdw: null,
  930. lxr: null,
  931. lxdh: null,
  932. xpsj: null,
  933. zypzt: null,
  934. jccdr: null,
  935. wcxxbh: null,
  936. wcxzt: null,
  937. cxsj: null,
  938. delFlag: null,
  939. createrCode: null,
  940. createdate: null,
  941. updaterCode: null,
  942. updatedate: null,
  943. deptId: null,
  944. remarks: null
  945. };
  946. this.resetForm("form");
  947. },
  948. /** 搜索按钮操作 */
  949. handleQuery() {
  950. this.queryParams.pageNum = 1;
  951. this.queryParams.startDate = this.chooseDate[0];
  952. this.queryParams.endDate = this.chooseDate[1];
  953. this.getList();
  954. },
  955. /** 重置按钮操作 */
  956. resetQuery() {
  957. this.resetForm("queryForm");
  958. this.chooseDate = "";
  959. this.handleQuery();
  960. },
  961. // 多选框选中数据
  962. handleSelectionChange(selection) {
  963. this.ids = selection.map(item => item.id)
  964. this.single = selection.length!==1
  965. this.multiple = !selection.length
  966. },
  967. /** 新增按钮操作 */
  968. handleAdd() {
  969. this.reset();
  970. this.open = true;
  971. this.title = this.$t('新增') + " " + this.$t('工作票');
  972. this.form.xpxp="10"
  973. this.isxp=false
  974. },
  975. /** 修改按钮操作 */
  976. handleUpdate(row) {
  977. this.isxp=true
  978. this.reset();
  979. const id = row.id || this.ids
  980. getJobticket(id).then(response => {
  981. this.form = response.data;
  982. this.checkCategoryPromotion(this.form.userUnit);
  983. this.open = true;
  984. this.title = this.$t('修改') + this.$t('工作票');
  985. });
  986. },
  987. /** 提交按钮 */
  988. submitForm() {
  989. this.$refs["form"].validate(valid => {
  990. if (valid) {
  991. if (this.form.id != null) {
  992. updateJobticket(this.form).then(response => {
  993. this.msgSuccess(this.$t('修改成功'));
  994. this.open = false;
  995. this.getList();
  996. });
  997. } else {
  998. addJobticket(this.form).then(response => {
  999. this.msgSuccess(this.$t('新增成功'));
  1000. this.open = false;
  1001. this.getList();
  1002. });
  1003. }
  1004. }
  1005. });
  1006. },
  1007. /** 删除按钮操作 */
  1008. handleDelete(row) {
  1009. if (row.children!= null && row.children.length > 0) {
  1010. this.msgError('存在续票,无法删除主票')
  1011. return
  1012. }
  1013. const ids = row.id || this.ids;
  1014. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1015. confirmButtonText: this.$t('确定'),
  1016. cancelButtonText: this.$t('取消'),
  1017. type: "warning"
  1018. }).then(function() {
  1019. return delJobticket(ids);
  1020. }).then(() => {
  1021. this.getList();
  1022. this.msgSuccess(this.$t('删除成功'));
  1023. })
  1024. },
  1025. /** 导出按钮操作 */
  1026. handleExport() {
  1027. const queryParams = this.queryParams;
  1028. this.$confirm(this.$t('是否确认导出所有工作票数据项?'), this.$t('警告'), {
  1029. confirmButtonText: this.$t('确定'),
  1030. cancelButtonText: this.$t('取消'),
  1031. type: "warning"
  1032. }).then(function() {
  1033. return exportJobticket(queryParams);
  1034. }).then(response => {
  1035. this.download(response.msg);
  1036. })
  1037. },
  1038. /** 导入按钮操作 */
  1039. handleImport() {
  1040. this.upload.title = this.$t('用户导入');
  1041. this.upload.open = true;
  1042. },
  1043. /** 下载模板操作 */
  1044. importTemplate() {
  1045. this.$refs['downloadFileForm'].submit()
  1046. },
  1047. // 文件上传中处理
  1048. handleFileUploadProgress(event, file, fileList) {
  1049. this.upload.isUploading = true;
  1050. },
  1051. // 文件上传成功处理
  1052. handleFileSuccess(response, file, fileList) {
  1053. this.upload.open = false;
  1054. this.upload.isUploading = false;
  1055. this.$refs.upload.clearFiles();
  1056. if (response.data[0] != null) {
  1057. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1058. }else {
  1059. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1060. }
  1061. this.getList();
  1062. },
  1063. // 提交上传文件
  1064. submitFileForm() {
  1065. this.$refs.upload.submit();
  1066. },
  1067. //数据分析
  1068. handleData(){
  1069. this.drawer = true
  1070. }
  1071. }
  1072. };
  1073. </script>
  1074. <style>
  1075. .text {
  1076. font-size: 14px;
  1077. }
  1078. .item {
  1079. margin-bottom: 18px;
  1080. }
  1081. .clearfix {
  1082. color: #1e1e1e;
  1083. }
  1084. .clearfix:before,
  1085. .clearfix:after {
  1086. display: table;
  1087. content: "";
  1088. }
  1089. .clearfix:after {
  1090. clear: both
  1091. }
  1092. .box-card {
  1093. width: 100%;
  1094. }
  1095. .el-drawer__body {
  1096. overflow: auto;
  1097. }
  1098. .el-drawer__container ::-webkit-scrollbar {
  1099. display: none;
  1100. }
  1101. </style>