index.vue 53 KB

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