index.vue 59 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="68px"
  9. >
  10. <el-form-item prop="name">
  11. <el-input
  12. v-model="queryParams.name"
  13. placeholder="请输入文件名称"
  14. clearable
  15. size="small"
  16. @input="handleQuery"
  17. />
  18. </el-form-item>
  19. <el-form-item prop="sendName">
  20. <el-input
  21. v-model="queryParams.sendName"
  22. placeholder="请输入发送人"
  23. clearable
  24. size="small"
  25. @input="handleQuery"
  26. />
  27. </el-form-item>
  28. <el-form-item>
  29. <!-- <el-button type="primary" size="btn" @click="handleQuery"
  30. >搜索</el-button
  31. > -->
  32. <el-button size="btr" @click="resetQuery">重置</el-button>
  33. </el-form-item>
  34. </el-form>
  35. <el-row :gutter="10" class="mb8">
  36. <el-col :span="1.5">
  37. <el-button
  38. type="primary"
  39. plain
  40. size="mini"
  41. @click="handleAdd"
  42. v-hasPermi="['PrintsManage:manage:add']"
  43. >发送文件</el-button
  44. >
  45. </el-col>
  46. <!-- <el-col :span="1.5">
  47. <el-button
  48. type="success"
  49. plain
  50. icon="el-icon-edit"
  51. size="mini"
  52. :disabled="single"
  53. @click="handleUpdate"
  54. v-hasPermi="['PrintsManage:manage:edit']"
  55. >修改</el-button>
  56. </el-col>-->
  57. <el-col :span="1.5">
  58. <el-button
  59. type="danger"
  60. plain
  61. icon="el-icon-delete"
  62. size="mini"
  63. :disabled="multiple"
  64. @click="handleDelete"
  65. v-hasPermi="['PrintsManage:manage:remove']"
  66. >删除</el-button
  67. >
  68. </el-col>
  69. <!-- <el-col :span="1.5">
  70. <el-button
  71. type="warning"
  72. plain
  73. icon="el-icon-download"
  74. size="mini"
  75. :loading="exportLoading"
  76. @click="handleExport"
  77. v-hasPermi="['PrintsManage:manage:export']"
  78. >导出</el-button>
  79. </el-col>-->
  80. <!-- <right-toolbar
  81. :showSearch.sync="showSearch"
  82. @queryTable="getList"
  83. ></right-toolbar> -->
  84. </el-row>
  85. <el-table
  86. v-loading="loading"
  87. :header-cell-style="{ background: '#003C69', color: 'white' }"
  88. :data="manageList"
  89. @selection-change="handleSelectionChange"
  90. >
  91. <el-table-column type="selection" width="55" align="center" />
  92. <!-- <el-table-column label="打印回复信息" align="center" prop="id" /> -->
  93. <el-table-column label="序号" align="center" type="index" />
  94. <el-table-column
  95. label="文件名称"
  96. align="center"
  97. prop="name"
  98. show-overflow-tooltip
  99. />
  100. <!-- <el-table-column label="路径" align="center" prop="file" /> -->
  101. <el-table-column label="类型" align="center" prop="type" />
  102. <el-table-column label="是否彩打" align="center" prop="isPrintColor">
  103. <template slot-scope="scope">
  104. <span>{{ scope.row.isPrintColor == 0 ? "否" : "是" }}</span>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="是否双面打" align="center" prop="isPrintTwo">
  108. <template slot-scope="scope">
  109. <span>{{ scope.row.isPrintTwo == 0 ? "否" : "是" }}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="打印状态" align="center" prop="printStatus">
  113. <template slot-scope="scope">
  114. <span
  115. style="color: #90da90"
  116. v-if="
  117. (scope.row.printStatus == 1 &&
  118. scope.row.printRoom == 0 &&
  119. roles == '15号文印室') ||
  120. (scope.row.printStatus == 1 &&
  121. scope.row.printRoom == 1 &&
  122. roles == '19号文印室')
  123. "
  124. >待打印</span
  125. >
  126. <span
  127. style="color: #90da90"
  128. v-if="
  129. scope.row.printStatus == 1 &&
  130. roles != '19号文印室' &&
  131. roles != '15号文印室'
  132. "
  133. >打印中</span
  134. >
  135. <span style="color: #00ff00" v-if="scope.row.printStatus == 2"
  136. >已打印</span
  137. >
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="级别" align="center" prop="levelM">
  141. <template slot-scope="scope">
  142. <dict-tag :options="dict.type.level" :value="scope.row.levelM" />
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="发送人" align="center" prop="sendName" />
  146. <el-table-column
  147. label="发送时间"
  148. align="center"
  149. prop="creattime"
  150. width="180"
  151. >
  152. <template slot-scope="scope">
  153. <span>{{
  154. parseTime(scope.row.creattime, "{y}-{m}-{d} {h}:{i}:{s}")
  155. }}</span>
  156. </template>
  157. </el-table-column>
  158. <el-table-column
  159. label="操作"
  160. align="center"
  161. class-name="small-padding fixed-width"
  162. width="280px"
  163. >
  164. <template slot-scope="scope">
  165. <el-button
  166. size="btu"
  167. type="text"
  168. @click="handleok(scope.row)"
  169. v-hasPermi="['PrintsLog:printlog:edit']"
  170. v-if="scope.row.isShow == 1"
  171. >确定</el-button
  172. >
  173. <el-button
  174. size="btk"
  175. type="text"
  176. @click="handlelook(scope.row)"
  177. v-hasPermi="['PrintsLog:printlog:edit']"
  178. >查看</el-button
  179. >
  180. <el-button
  181. size="btk"
  182. type="text"
  183. @click="handlePrint(scope.row)"
  184. v-hasPermi="['PrintsLog:printlog:edit']"
  185. >打印</el-button
  186. >
  187. <el-button
  188. size="btu"
  189. type="text"
  190. @click="handleUpdate(scope.row)"
  191. v-hasPermi="['PrintsManage:manage:edit']"
  192. >修改</el-button
  193. >
  194. <el-button
  195. size="btd"
  196. type="text"
  197. @click="handleDelete(scope.row)"
  198. v-hasPermi="['PrintsManage:manage:remove']"
  199. >删除</el-button
  200. >
  201. </template>
  202. </el-table-column>
  203. </el-table>
  204. <pagination
  205. v-show="total > 0"
  206. :total="total"
  207. :page.sync="queryParams.pageNum"
  208. :limit.sync="queryParams.pageSize"
  209. @pagination="getList"
  210. />
  211. <!-- 添加或修改集中文印主对话框 -->
  212. <el-dialog
  213. :title="title"
  214. :visible.sync="open"
  215. width="1010px"
  216. append-to-body
  217. :close-on-click-modal="false"
  218. >
  219. <div class="userAgree">
  220. <el-form
  221. ref="form"
  222. :model="form"
  223. :inline="true"
  224. :rules="rules"
  225. label-width="120px"
  226. style="margin-left: 34px"
  227. >
  228. <div class="jiben">发送人信息</div>
  229. <el-form-item label="发送人" prop="sendName">
  230. <el-input
  231. v-model="form.sendName"
  232. disabled
  233. placeholder="请输入发送人"
  234. />
  235. </el-form-item>
  236. <el-form-item label="文印室" prop="printRoom">
  237. <el-select
  238. v-model="form.printRoom"
  239. clearable
  240. placeholder="请选择文印室"
  241. >
  242. <el-option
  243. v-for="dict in printRooms"
  244. :key="dict.dictValue"
  245. :label="dict.dictLabel"
  246. :value="parseInt(dict.dictValue)"
  247. ></el-option>
  248. </el-select>
  249. </el-form-item>
  250. <div class="jiben">打印说明</div>
  251. <el-form-item label prop="explainInfo">
  252. <el-input
  253. v-model="form.explainInfo"
  254. type="textarea"
  255. placeholder="请输入打印说明"
  256. class="textarea-explainInfo"
  257. />
  258. </el-form-item>
  259. <div class="jiben">文件信息</div>
  260. <!-- <el-form-item label="文件名称">
  261. <el-input v-model="form.name" placeholder="请输入文件名称" />
  262. </el-form-item>
  263. <el-form-item label="打印份数" prop="printNumber">
  264. <el-input
  265. v-model="form.printNumber"
  266. :min="0"
  267. placeholder="请输入打印份数"
  268. />
  269. </el-form-item>
  270. <el-form-item label="文件大小" prop="size">
  271. <el-input v-model="form.size" placeholder="请输入文件大小" />
  272. </el-form-item> -->
  273. <!-- <el-form-item label="单位ID" prop="unitId">
  274. <el-input v-model="form.unitId" placeholder="请输入单位ID" />
  275. </el-form-item>-->
  276. <!-- <el-form-item label="单位名称" prop="unitName">
  277. <el-input v-model="form.unitName" placeholder="请输入单位名称" />
  278. </el-form-item>-->
  279. <!-- <el-form-item label="文件类型" prop="type">
  280. <el-input v-model="form.type" placeholder="请输入文件类型" />
  281. </el-form-item> -->
  282. <!-- <el-form-item label="级别" prop="levelM">
  283. <el-select v-model="form.levelM" clearable placeholder="请选择级别">
  284. <el-option
  285. v-for="dict in levelMs"
  286. :key="dict.dictValue"
  287. :label="dict.dictLabel"
  288. :value="parseInt(dict.dictValue)"
  289. ></el-option>
  290. </el-select>
  291. </el-form-item> -->
  292. <!-- <el-form-item label="是否需要归还" prop="isReturn">
  293. <el-radio-group v-model="form.isReturn" style="width:200px;" size="mini">
  294. <el-radio label="1">归还</el-radio>
  295. <el-radio label="0">无需归还</el-radio>
  296. </el-radio-group>
  297. </el-form-item>-->
  298. <!-- <el-form-item label="是否为彩打" prop="isPrintColor">
  299. <el-radio-group
  300. v-model="form.isPrintColor"
  301. style="width: 200px"
  302. size="mini"
  303. >
  304. <el-radio label="1">是</el-radio>
  305. <el-radio label="0">否</el-radio>
  306. </el-radio-group>
  307. </el-form-item>
  308. <el-form-item label="是否为双面打" prop="isPrintTwo">
  309. <el-radio-group
  310. v-model="form.isPrintTwo"
  311. style="width: 200px"
  312. size="mini"
  313. >
  314. <el-radio label="1">是</el-radio>
  315. <el-radio label="0">否</el-radio>
  316. </el-radio-group>
  317. </el-form-item> -->
  318. <div class="box3" v-for="(item, i) in tomList" :key="i">
  319. <el-form
  320. ref="refform"
  321. :model="form"
  322. :rules="rules"
  323. label-width="80px"
  324. :inline="true"
  325. style="margin-left: 20px"
  326. >
  327. <el-form-item prop="type">
  328. <el-input
  329. class="forEach"
  330. disabled
  331. v-model="item.type"
  332. placeholder="请输入文件类型"
  333. />
  334. <!-- <el-select v-model="form.type" placeholder="请选择类型">
  335. <el-option label="请选择字典生成" value />
  336. </el-select>-->
  337. </el-form-item>
  338. <el-form-item prop="size">
  339. <el-input
  340. class="forEach"
  341. disabled
  342. v-model="item.size"
  343. placeholder="请输入文件大小"
  344. />
  345. </el-form-item>
  346. <el-form-item prop="levelM">
  347. <el-select
  348. v-model="item.levelM"
  349. clearable
  350. class="forEach"
  351. placeholder="请选择级别"
  352. >
  353. <el-option
  354. v-for="dict in levelMs"
  355. :key="dict.dictValue"
  356. :label="dict.dictLabel"
  357. :value="parseInt(dict.dictValue)"
  358. ></el-option>
  359. </el-select>
  360. </el-form-item>
  361. <el-form-item prop="printNumber">
  362. <el-input
  363. class="forEach"
  364. v-model="item.printNumber"
  365. :min="0"
  366. placeholder="请输入打印份数"
  367. />
  368. </el-form-item>
  369. <el-form-item>
  370. <!-- <el-button
  371. type="primary"
  372. icon="el-icon-plus"
  373. size="mini"
  374. style="padding: 11px 10px 10px 10px"
  375. @click="addForms"
  376. v-if="i == tomList.length - 1"
  377. ></el-button> -->
  378. <el-button
  379. type="danger"
  380. icon="el-icon-close"
  381. size="mini"
  382. style="padding: 11px 10px 10px 10px"
  383. v-if="i >= 0"
  384. @click="delForms(i)"
  385. ></el-button>
  386. </el-form-item>
  387. <el-form-item>
  388. <el-input
  389. class="fileName"
  390. suffix-icon="el-icon-document"
  391. disabled
  392. v-model="item.name"
  393. placeholder="请输入文件名称"
  394. />
  395. </el-form-item>
  396. <!-- <el-form-item label="单位ID" prop="unitId">
  397. <el-input v-model="form.unitId" placeholder="请输入单位ID" />
  398. </el-form-item>-->
  399. <!-- <el-form-item label="单位名称" prop="unitName">
  400. <el-input v-model="form.unitName" placeholder="请输入单位名称" />
  401. </el-form-item>-->
  402. <!-- <el-form-item label="是否需要归还" prop="isReturn">
  403. <el-radio-group v-model="form.isReturn" style="width:200px;" size="mini">
  404. <el-radio label="1">归还</el-radio>
  405. <el-radio label="0">无需归还</el-radio>
  406. </el-radio-group>
  407. </el-form-item>-->
  408. <el-form-item
  409. label="是否为彩打"
  410. label-width="120px"
  411. prop="isPrintColor"
  412. >
  413. <!-- <el-radio-group
  414. v-model="item.isPrintColor"
  415. style="width: 200px"
  416. size="mini"
  417. >
  418. <el-radio label="1">是</el-radio>
  419. <el-radio label="0">否</el-radio>
  420. </el-radio-group> -->
  421. <el-switch
  422. v-model="item.isPrintColor"
  423. active-color="#13ce66"
  424. inactive-color="#ccc"
  425. active-value="1"
  426. inactive-value="0"
  427. >
  428. </el-switch>
  429. <span class="greed" v-if="item.isPrintColor == '1'"></span>
  430. <span class="CCC" v-if="item.isPrintColor == '0'"></span>
  431. </el-form-item>
  432. <el-form-item
  433. label="是否为双面打"
  434. label-width="120px"
  435. prop="isPrintTwo"
  436. >
  437. <!-- <el-radio-group
  438. v-model="item.isPrintTwo"
  439. style="width: 200px"
  440. size="mini"
  441. >
  442. <el-radio label="1">是</el-radio>
  443. <el-radio label="0">否</el-radio>
  444. </el-radio-group> -->
  445. <el-switch
  446. v-model="item.isPrintTwo"
  447. active-color="#13ce66"
  448. inactive-color="#ccc"
  449. active-value="1"
  450. inactive-value="0"
  451. >
  452. </el-switch>
  453. <span class="greed" v-if="item.isPrintTwo == '1'"></span>
  454. <span class="CCC" v-if="item.isPrintTwo == '0'"></span>
  455. </el-form-item>
  456. <el-form-item
  457. label="是否需归还"
  458. label-width="120px"
  459. prop="isReturns"
  460. >
  461. <el-switch
  462. v-model="item.isReturn"
  463. active-color="#13ce66"
  464. inactive-color="#ccc"
  465. active-value="1"
  466. inactive-value="0"
  467. >
  468. </el-switch>
  469. <span class="greed" v-if="item.isReturn == '1'"></span>
  470. <span class="CCC" v-if="item.isReturn == '0'"></span>
  471. </el-form-item>
  472. </el-form>
  473. </div>
  474. <el-form-item style="margin-left: 20px" prop="name">
  475. <!-- <fileUpload v-model="form.file" /> -->
  476. <el-upload
  477. :action="uploadFileUrl"
  478. :before-upload="handleBeforeUpload"
  479. :file-list="fileList"
  480. :limit="limit"
  481. :on-error="handleUploadError"
  482. :on-exceed="handleExceed"
  483. :on-success="handleUploadSuccess"
  484. :show-file-list="false"
  485. :headers="headers"
  486. class="upload-file-uploader"
  487. ref="upload"
  488. style="width: 200px"
  489. name="pfile"
  490. >
  491. <!-- 上传按钮 -->
  492. <el-button size="mini" type="primary" class="select_file"
  493. >选取文件</el-button
  494. >
  495. </el-upload>
  496. </el-form-item>
  497. <!-- <el-form-item label="发送人ID" prop="sendId">
  498. <el-input v-model="form.sendId" placeholder="请输入发送人ID" />
  499. </el-form-item>-->
  500. <!-- <el-form-item label="创建时间" prop="creattime">
  501. <el-date-picker
  502. clearable
  503. size="small"
  504. v-model="form.creattime"
  505. type="date"
  506. value-format="yyyy-MM-dd"
  507. placeholder="选择创建时间"
  508. ></el-date-picker>
  509. </el-form-item>-->
  510. <!-- <el-form-item label="打印状态(1 打印中 2 已打印)">
  511. <el-radio-group v-model="form.printStatus">
  512. <el-radio label="1">请选择字典生成</el-radio>
  513. </el-radio-group>
  514. </el-form-item>
  515. <el-form-item label="接收人ID" prop="receiveId">
  516. <el-input v-model="form.receiveId" placeholder="请输入接收人ID" />
  517. </el-form-item>
  518. <el-form-item label="接收人" prop="receiveName">
  519. <el-input v-model="form.receiveName" placeholder="请输入接收人" />
  520. </el-form-item>
  521. <el-form-item label="生成路径">
  522. <fileUpload v-model="form.sFile" />
  523. </el-form-item>
  524. <el-form-item label="打印回复信息" prop="printInfo">
  525. <el-input v-model="form.printInfo" placeholder="请输入打印回复信息" />
  526. </el-form-item>-->
  527. </el-form>
  528. </div>
  529. <div slot="footer" class="dialog-footer" style="margin-right: 30px">
  530. <el-button type="primary" @click="submitForm">确 定</el-button>
  531. <el-button @click="cancel" size="btn">取 消</el-button>
  532. </div>
  533. </el-dialog>
  534. <!-- 修改集中文印 -->
  535. <el-dialog
  536. :title="title1"
  537. :visible.sync="open1"
  538. width="940px"
  539. append-to-body
  540. :close-on-click-modal="false"
  541. >
  542. <el-form
  543. ref="form1"
  544. :model="form1"
  545. :inline="true"
  546. :rules="rules"
  547. label-width="120px"
  548. style="margin-left: 37px"
  549. >
  550. <div class="jiben">发送人信息</div>
  551. <el-form-item label="发送人" prop="sendName">
  552. <el-input
  553. v-model="form1.sendName"
  554. disabled
  555. placeholder="请输入发送人"
  556. />
  557. </el-form-item>
  558. <el-form-item label="文印室" prop="printRoom">
  559. <el-select
  560. v-model="form1.printRoom"
  561. clearable
  562. placeholder="请选择文印室"
  563. >
  564. <el-option
  565. v-for="dict in printRooms"
  566. :key="dict.dictValue"
  567. :label="dict.dictLabel"
  568. :value="parseInt(dict.dictValue)"
  569. ></el-option>
  570. </el-select>
  571. </el-form-item>
  572. <div class="jiben">打印说明</div>
  573. <el-form-item label prop="explainInfo">
  574. <el-input
  575. v-model="form1.explainInfo"
  576. type="textarea"
  577. placeholder="请输入打印说明"
  578. class="textarea-explainInfo1"
  579. />
  580. </el-form-item>
  581. <div class="jiben">文件信息</div>
  582. <el-form-item prop="type">
  583. <el-input
  584. class="forEach"
  585. disabled
  586. v-model="form1.type"
  587. placeholder="请输入文件类型"
  588. />
  589. <!-- <el-select v-model="form.type" placeholder="请选择类型">
  590. <el-option label="请选择字典生成" value />
  591. </el-select>-->
  592. </el-form-item>
  593. <el-form-item prop="size">
  594. <el-input
  595. class="forEach"
  596. disabled
  597. v-model="form1.size"
  598. placeholder="请输入文件大小"
  599. />
  600. </el-form-item>
  601. <el-form-item prop="levelM">
  602. <el-select
  603. v-model="form1.levelM"
  604. clearable
  605. class="forEach"
  606. placeholder="请选择级别"
  607. >
  608. <el-option
  609. v-for="dict in levelMs"
  610. :key="dict.dictValue"
  611. :label="dict.dictLabel"
  612. :value="parseInt(dict.dictValue)"
  613. ></el-option>
  614. </el-select>
  615. </el-form-item>
  616. <el-form-item prop="printNumber">
  617. <el-input
  618. class="forEach"
  619. v-model="form1.printNumber"
  620. :min="0"
  621. placeholder="请输入打印份数"
  622. />
  623. </el-form-item>
  624. <el-form-item>
  625. <el-input
  626. class="fileName"
  627. suffix-icon="el-icon-document"
  628. disabled
  629. v-model="form1.name"
  630. placeholder="请输入文件名称"
  631. />
  632. </el-form-item>
  633. <el-form-item
  634. label="是否为彩打"
  635. label-width="120px"
  636. prop="isPrintColor"
  637. >
  638. <el-switch
  639. v-model="form1.isPrintColor"
  640. active-color="#13ce66"
  641. inactive-color="#ccc"
  642. active-value="1"
  643. inactive-value="0"
  644. >
  645. </el-switch>
  646. <span class="greed" v-if="form1.isPrintColor == '1'"></span>
  647. <span class="CCC" v-if="form1.isPrintColor == '0'"></span>
  648. </el-form-item>
  649. <el-form-item
  650. label="是否为双面打"
  651. label-width="120px"
  652. prop="isPrintTwo"
  653. >
  654. <!-- <el-radio-group
  655. v-model="item.isPrintTwo"
  656. style="width: 200px"
  657. size="mini"
  658. >
  659. <el-radio label="1">是</el-radio>
  660. <el-radio label="0">否</el-radio>
  661. </el-radio-group> -->
  662. <el-switch
  663. v-model="form1.isPrintTwo"
  664. active-color="#13ce66"
  665. inactive-color="#ccc"
  666. active-value="1"
  667. inactive-value="0"
  668. >
  669. </el-switch>
  670. <span class="greed" v-if="form1.isPrintTwo == '1'"></span>
  671. <span class="CCC" v-if="form1.isPrintTwo == '0'"></span>
  672. </el-form-item>
  673. <el-form-item label="是否需归还" label-width="120px" prop="isReturns">
  674. <el-switch
  675. v-model="form1.isReturn"
  676. active-color="#13ce66"
  677. inactive-color="#ccc"
  678. :active-value="1"
  679. :inactive-value="0"
  680. >
  681. </el-switch>
  682. <span class="greed" v-if="form1.isReturn == 1"></span>
  683. <span class="CCC" v-if="form1.isReturn == 0"></span>
  684. </el-form-item>
  685. <el-form-item prop="name">
  686. <!-- <fileUpload v-model="form.file" /> -->
  687. <el-upload
  688. :action="uploadFileUrl"
  689. :before-upload="handleBeforeUpload"
  690. :file-list="fileList"
  691. :limit="limit"
  692. :on-error="handleUploadError"
  693. :on-exceed="handleExceed"
  694. :on-success="handleUploadSuccess"
  695. :show-file-list="false"
  696. :headers="headers"
  697. class="upload-file-uploader"
  698. ref="upload"
  699. style="width: 200px"
  700. name="pfile"
  701. >
  702. <!-- 上传按钮 -->
  703. <el-button size="mini" type="primary" class="select_file"
  704. >选取文件</el-button
  705. >
  706. </el-upload>
  707. </el-form-item>
  708. </el-form>
  709. <div slot="footer" class="dialog-footer" style="margin-right: 18px">
  710. <el-button type="primary" @click="updatesubmit">确 定</el-button>
  711. <el-button @click="open1 = false" size="btn">取 消</el-button>
  712. </div>
  713. </el-dialog>
  714. <el-dialog
  715. :title="title"
  716. :visible.sync="dyopen"
  717. append-to-body
  718. width="700px"
  719. style="padding-top: 100px"
  720. :close-on-click-modal="false"
  721. @close="close"
  722. >
  723. <el-form
  724. ref="dyform"
  725. :model="dyform"
  726. :inline="true"
  727. :rules="rules"
  728. label-width="120px"
  729. >
  730. <div class="jiben jiben2">打印信息</div>
  731. <el-form-item label="打印文件" prop="printName">
  732. <el-input v-model="dyform.printName" placeholder="请输入打印文件" />
  733. </el-form-item>
  734. <el-form-item label="打印份数" prop="printNumber">
  735. <el-input
  736. v-model="dyform.printNumber"
  737. :min="0"
  738. placeholder="请输入打印份数"
  739. />
  740. </el-form-item>
  741. <el-form-item label="是否需要归还" prop="isReturn">
  742. <el-radio-group
  743. v-model="dyform.isReturn"
  744. style="width: 200px"
  745. size="mini"
  746. @change="dianji"
  747. >
  748. <el-radio label="1">归还</el-radio>
  749. <el-radio label="0">无需归还</el-radio>
  750. </el-radio-group>
  751. </el-form-item>
  752. <!-- <el-form-item label="是否为彩打" prop="isPrintColor">
  753. <el-radio-group v-model="dyform.isPrintColor" style="width:200px;" size="mini">
  754. <el-radio label="1">是</el-radio>
  755. <el-radio label="0">否</el-radio>
  756. </el-radio-group>
  757. </el-form-item>
  758. <el-form-item label="是否为双面打" prop="isPrintTwo">
  759. <el-radio-group v-model="dyform.isPrintTwo" style="width:200px;" size="mini">
  760. <el-radio label="1">是</el-radio>
  761. <el-radio label="0">否</el-radio>
  762. </el-radio-group>
  763. </el-form-item>-->
  764. <!-- <div class="jiben">打印人信息</div> -->
  765. <el-form-item label="打印人" prop="printfileName">
  766. <el-select
  767. v-model="dyform.printfileName"
  768. filterable
  769. clearable
  770. placeholder="请选择打印人"
  771. >
  772. <el-option
  773. v-for="item in rylist"
  774. :key="item.id"
  775. :label="item.name"
  776. :value="item.id"
  777. ></el-option>
  778. </el-select>
  779. </el-form-item>
  780. <div class="jiben jiben2">打印说明</div>
  781. <div
  782. style="
  783. width: 98.5%;
  784. height: 45px;
  785. font-size: 14px;
  786. line-height: 45px;
  787. color: #fff;
  788. border-bottom: 1px solid #fff;
  789. margin-bottom: 20px;
  790. padding-left: 15px;
  791. "
  792. v-if="yaoqiuflg"
  793. >
  794. 其他要求:{{ yaoqiu }}
  795. </div>
  796. <el-form-item label prop="explainInfo">
  797. <el-input
  798. v-model="dyform.explainInfo"
  799. type="textarea"
  800. placeholder="请输入打印说明"
  801. class="dyform-textarea"
  802. />
  803. </el-form-item>
  804. <div class="jiben jiben2" v-if="ramrk">备注</div>
  805. <el-form-item label prop="" v-if="ramrk">
  806. <el-input
  807. v-model="dyform.remark"
  808. type="textarea"
  809. placeholder="请输入备注"
  810. class="dyform-textarea"
  811. />
  812. </el-form-item>
  813. </el-form>
  814. <div slot="footer" class="dialog-footer">
  815. <el-button type="primary" @click="dysubmitForm">打 印</el-button>
  816. <el-button @click="dycancel" size="btn">取 消</el-button>
  817. </div>
  818. </el-dialog>
  819. <!-- <el-dialog
  820. :title="title"
  821. :visible.sync="dyopen2"
  822. append-to-body
  823. width="1500px"
  824. style="padding-top:100px;"
  825. >
  826. <div ref="file" v-html="tableau" style="width:100%;"></div>
  827. </el-dialog> -->
  828. <!-- 添加预览doc文件弹框 -->
  829. <el-dialog
  830. style="color: pink"
  831. :title="title3"
  832. :visible.sync="open33"
  833. width="1100px"
  834. append-to-body
  835. id="fileinfodocx"
  836. class="el-dialog__header"
  837. :close-on-click-modal="false"
  838. >
  839. <div ref="file"></div>
  840. <div slot="footer" class="dialog-footer">
  841. <el-button type="primary" @click="submitForm3">关 闭</el-button>
  842. <!-- <el-button @click="open33 = false" size="" class="aa1">
  843. 取 消</el-button
  844. > -->
  845. </div>
  846. </el-dialog>
  847. <!-- 预览PDF文件弹框 -->
  848. <el-dialog
  849. :title="title3"
  850. :visible.sync="previewDialog"
  851. width="850px"
  852. append-to-body
  853. id="fileinfopdf"
  854. class="el-dialog__header"
  855. :close-on-click-modal="false"
  856. >
  857. <template>
  858. <!-- <div style="margin-bottom:20px"> -->
  859. <div style="display: flex">
  860. <el-button
  861. :class="gopage == true ? 'bg' : ''"
  862. class="gopage"
  863. :theme="'default'"
  864. type="submit"
  865. :title="'上一页'"
  866. @click.native="prePage"
  867. >
  868. 上一页</el-button
  869. >
  870. <div
  871. style="
  872. width: 50px;
  873. height: 28px;
  874. background: #f4f4f4;
  875. text-align: center;
  876. line-height: 28px;
  877. "
  878. >
  879. {{ pageNum }}/{{ pageTotalNum }}
  880. </div>
  881. <el-button
  882. :class="gopage == false ? 'bg' : ''"
  883. :theme="'default'"
  884. class="downpage"
  885. type="submit"
  886. :title="'下一页'"
  887. @click.native="nextPage"
  888. >
  889. 下一页</el-button
  890. >
  891. <!-- <el-button :theme="'default'" type="submit" :title="'顺时针旋转'" @click.native="clock" > 顺时针旋转</el-button>
  892. <el-button :theme="'default'" type="submit" :title="'逆时针旋转'" @click.native="counterClock" > 逆时针旋转</el-button>
  893. <el-button :theme="'default'" type="submit" :title="'打印'" @click.native="pdfPrintAll"> 打印</el-button> -->
  894. </div>
  895. <PDF
  896. ref="pdf"
  897. :src="pdfurl"
  898. :page="pageNum"
  899. :rotate="pageRotate"
  900. @progress="loadedRatio = $event"
  901. @page-loaded="pageLoaded($event)"
  902. @num-pages="pageTotalNum = $event"
  903. @error="pdfError($event)"
  904. @link-clicked="page = $event"
  905. ></PDF>
  906. <!-- </div> -->
  907. <!-- <div class="el-dialog__footer"> -->
  908. <div slot="footer" class="dialog-footer">
  909. <el-button type="primary" @click="previewDialog = false"
  910. >关 闭</el-button
  911. >
  912. <!-- <el-button @click="previewDialog = false" size="" class="aa1"
  913. >取 消</el-button
  914. > -->
  915. </div>
  916. <!-- </div> -->
  917. </template>
  918. </el-dialog>
  919. <el-dialog
  920. :title="title3"
  921. :visible.sync="open44"
  922. width="1100px"
  923. append-to-body
  924. id="fileinfopdf"
  925. class="el-dialog__header"
  926. :close-on-click-modal="false"
  927. >
  928. <template>
  929. <div class="home">
  930. <div v-html="tableau"></div>
  931. </div>
  932. <div slot="footer" class="dialog-footer">
  933. <el-button type="primary" @click="open44 = false">关 闭</el-button>
  934. <!-- <el-button @click="open44 = false" size="" class="aa1"
  935. >取 消</el-button
  936. > -->
  937. </div>
  938. </template>
  939. </el-dialog>
  940. </div>
  941. </template>
  942. <script>
  943. import {
  944. listManage,
  945. getManage,
  946. delManage,
  947. addManage,
  948. updateManage,
  949. exportManage,
  950. printFile,
  951. listPeople,
  952. printCode,
  953. tkbox,
  954. } from "@/api/PrintsManage/manage";
  955. import { getToken } from "@/utils/auth";
  956. import Cookies from "js-cookie";
  957. import axios from "axios";
  958. var XLSX = require("xlsx");
  959. const docx = require("docx-preview");
  960. window.JSZip = require("jszip");
  961. import PDF from "vue-pdf";
  962. export default {
  963. name: "Manage",
  964. dicts: ["level", "print_room"],
  965. props: {
  966. // 值
  967. value: [String, Object, Array],
  968. // 数量限制
  969. limit: {
  970. type: Number,
  971. default: 10,
  972. },
  973. // 大小限制(MB)
  974. fileSize: {
  975. type: Number,
  976. default: 50,
  977. },
  978. // 文件类型, 例如['png', 'jpg', 'jpeg']
  979. fileType: {
  980. type: Array,
  981. default: () => ["doc", "xls", "ppt", "pdf"],
  982. },
  983. // 是否显示提示
  984. isShowTip: {
  985. type: Boolean,
  986. default: true,
  987. },
  988. },
  989. components: {
  990. PDF,
  991. },
  992. data() {
  993. return {
  994. // 遮罩层
  995. loading: true,
  996. // 导出遮罩层
  997. exportLoading: false,
  998. // 选中数组
  999. ids: [],
  1000. // 非单个禁用
  1001. single: true,
  1002. // 非多个禁用
  1003. multiple: true,
  1004. // 显示搜索条件
  1005. showSearch: true,
  1006. // 总条数
  1007. total: 0,
  1008. // 集中文印主表格数据
  1009. manageList: [],
  1010. // 弹出层标题
  1011. title: "",
  1012. // 是否显示弹出层
  1013. open: false,
  1014. dyopen: false,
  1015. // 查询参数
  1016. queryParams: {
  1017. pageNum: 1,
  1018. pageSize: 10,
  1019. name: null,
  1020. file: null,
  1021. type: null,
  1022. size: null,
  1023. unitId: null,
  1024. unitName: null,
  1025. levelM: null,
  1026. sendId: null,
  1027. sendName: null,
  1028. creattime: null,
  1029. updatetime: null,
  1030. explainInfo: null,
  1031. printStatus: null,
  1032. receiveId: null,
  1033. receiveName: null,
  1034. sFile: null,
  1035. printInfo: null,
  1036. printRoom: null,
  1037. },
  1038. // 表单参数
  1039. form: {
  1040. printsManageList: [],
  1041. },
  1042. dyform: {},
  1043. // 表单校验
  1044. rules: {
  1045. // name: [
  1046. // // { required: true, message: "发送文件不能为空", trigger: "click" },
  1047. // { required: true },
  1048. // ],
  1049. printRoom: [
  1050. { required: true, message: "打印室不能为空", trigger: "change" },
  1051. ],
  1052. isReturn: [
  1053. { required: true, message: "是否归还需要选择", trigger: "change" },
  1054. ],
  1055. printName: [
  1056. { required: true, message: "打印文件不能为空", trigger: "change" },
  1057. ],
  1058. printfileName: [
  1059. { required: true, message: "打印人不能为空", trigger: "change" },
  1060. ],
  1061. },
  1062. //级别
  1063. levelMs: [],
  1064. //文印室
  1065. printRooms: [],
  1066. baseUrl: process.env.VUE_APP_BASE_API,
  1067. uploadFileUrl:
  1068. process.env.VUE_APP_BASE_API + "/PrintsManage/manage/printFile", // 上传的图片服务器地址
  1069. headers: {
  1070. Authorization: "Bearer " + getToken(),
  1071. },
  1072. fileList: [],
  1073. faith: null,
  1074. rylist: [],
  1075. islist: [],
  1076. yaoqiu: "",
  1077. dyopen2: false,
  1078. tableau: null,
  1079. yaoqiuflg: false,
  1080. roles: "",
  1081. // 虚拟字段
  1082. fid: "",
  1083. open33: false,
  1084. title3: "预览文件",
  1085. // 下载文件路径
  1086. downurl: process.env.VUE_APP_BASE_API,
  1087. // pdf文件
  1088. previewDialog: false,
  1089. pdfurl: "",
  1090. pageNum: 1,
  1091. pageTotalNum: 1,
  1092. pageRotate: 0,
  1093. // 加载进度
  1094. loadedRatio: 0,
  1095. curPageNum: 0,
  1096. gopage: true,
  1097. // excel表格
  1098. tableau: null,
  1099. open44: false,
  1100. // 确定按钮
  1101. printshow: false,
  1102. printManage: {},
  1103. //添加文件为空
  1104. tomList: [
  1105. {
  1106. // 文件名称
  1107. name: null,
  1108. // 打印份数
  1109. printNumber: null,
  1110. // 文件大小
  1111. size: null,
  1112. // 级别
  1113. levelM: null,
  1114. // 是否为彩打
  1115. isPrintColor: null,
  1116. // 是否为双面打
  1117. isPrintTwo: null,
  1118. },
  1119. ],
  1120. // 上传文件
  1121. tomLists: [],
  1122. form1: {},
  1123. open1: false,
  1124. title1: "",
  1125. // 打印备注
  1126. ramrk: false,
  1127. };
  1128. },
  1129. created() {
  1130. // if (Cookies.get("shuaxin") != "true") {
  1131. // window.location.reload();
  1132. // }
  1133. // Cookies.set("shuaxin", "true");
  1134. this.getList();
  1135. //级别
  1136. this.getDicts("level").then((response) => {
  1137. this.levelMs = response.data;
  1138. });
  1139. //文印室
  1140. this.getDicts("print_room").then((response) => {
  1141. this.printRooms = response.data;
  1142. });
  1143. //是否
  1144. this.getDicts("sys_is").then((response) => {
  1145. this.islist = response.data;
  1146. });
  1147. },
  1148. mounted() {
  1149. this.roles = Cookies.get("roles");
  1150. },
  1151. methods: {
  1152. // 点击上传文件触发
  1153. fileChange(data) {
  1154. console.log(1);
  1155. },
  1156. // 打印点击叉号关闭事件
  1157. close() {
  1158. this.ramrk = false;
  1159. },
  1160. // 点击是否需要归还触发
  1161. dianji(data) {
  1162. if (data == "1") {
  1163. this.ramrk = false;
  1164. } else if (data == "0") {
  1165. this.ramrk = true;
  1166. }
  1167. },
  1168. // 增加工作登记
  1169. addForms() {
  1170. this.tomList.push({
  1171. // 文件名称
  1172. name: null,
  1173. // 打印份数
  1174. printNumber: null,
  1175. // 文件大小
  1176. size: null,
  1177. // 级别
  1178. levelM: null,
  1179. // 是否为彩打
  1180. isPrintColor: null,
  1181. // 是否为双面打
  1182. isPrintTwo: null,
  1183. });
  1184. },
  1185. // 删除对话框工作登记
  1186. delForms(i) {
  1187. this.tomList.splice(i, 1);
  1188. },
  1189. /** 查询集中文印主列表 */
  1190. getList() {
  1191. this.loading = true;
  1192. listManage(this.queryParams).then((response) => {
  1193. this.manageList = response.rows;
  1194. this.total = response.total;
  1195. this.loading = false;
  1196. });
  1197. },
  1198. // 取消按钮
  1199. cancel() {
  1200. this.open = false;
  1201. this.reset();
  1202. },
  1203. dycancel() {
  1204. this.dyopen = false;
  1205. this.ramrk = false;
  1206. this.dyreset();
  1207. },
  1208. // 表单重置
  1209. reset() {
  1210. this.form = {
  1211. id: null,
  1212. name: null,
  1213. file: null,
  1214. type: null,
  1215. size: null,
  1216. unitId: null,
  1217. unitName: null,
  1218. levelM: null,
  1219. sendId: null,
  1220. sendName: null,
  1221. creattime: null,
  1222. updatetime: null,
  1223. explainInfo: null,
  1224. printStatus: 0,
  1225. receiveId: null,
  1226. receiveName: null,
  1227. sFile: null,
  1228. printInfo: null,
  1229. isReturn: null,
  1230. printNumber: null,
  1231. isPrintTwo: null,
  1232. isPrintColor: null,
  1233. printRoom: null,
  1234. };
  1235. this.resetForm("form");
  1236. },
  1237. // 表单重置
  1238. dyreset() {
  1239. this.dyform = {
  1240. id: null,
  1241. printName: null,
  1242. printNumber: null,
  1243. isReturn: null,
  1244. printfileName: null,
  1245. explainInfo: null,
  1246. file: null,
  1247. printId: null,
  1248. statusG: null,
  1249. isPrintTwo: null,
  1250. isPrintColor: null,
  1251. printRoom: null,
  1252. };
  1253. this.resetForm("dyform");
  1254. },
  1255. /** 搜索按钮操作 */
  1256. handleQuery() {
  1257. this.queryParams.pageNum = 1;
  1258. this.getList();
  1259. },
  1260. /** 重置按钮操作 */
  1261. resetQuery() {
  1262. this.resetForm("queryForm");
  1263. this.handleQuery();
  1264. },
  1265. // 多选框选中数据
  1266. handleSelectionChange(selection) {
  1267. this.ids = selection.map((item) => item.id);
  1268. this.single = selection.length !== 1;
  1269. this.multiple = !selection.length;
  1270. },
  1271. /** 新增按钮操作 */
  1272. handleAdd() {
  1273. (this.tomList = [
  1274. {
  1275. // 文件名称
  1276. name: null,
  1277. // 打印份数
  1278. printNumber: null,
  1279. // 文件大小
  1280. size: null,
  1281. // 级别
  1282. levelM: null,
  1283. // 是否为彩打
  1284. isPrintColor: null,
  1285. // 是否为双面打
  1286. isPrintTwo: null,
  1287. },
  1288. ]),
  1289. (this.fileList = []);
  1290. this.reset();
  1291. this.open = true;
  1292. this.title = "添加集中文印";
  1293. this.form.sendName = Cookies.get("nickName");
  1294. this.form.sendId = Cookies.get("userId");
  1295. },
  1296. /** 修改按钮操作 */
  1297. handleUpdate(row) {
  1298. // this.tomList=[]
  1299. (this.tomList = [
  1300. {
  1301. // 文件名称
  1302. name: null,
  1303. // 打印份数
  1304. printNumber: null,
  1305. // 文件大小
  1306. size: null,
  1307. // 级别
  1308. levelM: null,
  1309. // 是否为彩打
  1310. isPrintColor: null,
  1311. // 是否为双面打
  1312. isPrintTwo: null,
  1313. isReturn: null,
  1314. },
  1315. ]),
  1316. (this.fileList = []);
  1317. this.reset();
  1318. const id = row.id || this.ids;
  1319. getManage(id).then((response) => {
  1320. this.form1 = response.data;
  1321. console.log(response);
  1322. console.log(this.form1);
  1323. this.form1.isPrintColor = response.data.isPrintColor + "";
  1324. this.form1.isPrintTwo = response.data.isPrintTwo + "";
  1325. // this.tomList[0].name=this.form.name
  1326. // this.tomList[0].type=this.form.type
  1327. // this.tomList[0].file=this.form.file
  1328. // this.tomList[0].printNumber=this.form.printNumber
  1329. // this.tomList[0].size=this.form.size
  1330. // this.tomList[0].levelM=this.form.levelM
  1331. // this.tomList[0].isPrintColor=this.form.isPrintColor
  1332. // this.tomList[0].isPrintTwo=this.form.isPrintTwo
  1333. this.open1 = true;
  1334. this.title1 = "修改集中文印";
  1335. });
  1336. },
  1337. // 修改提交
  1338. updatesubmit() {
  1339. this.$refs["form1"].validate((valid) => {
  1340. if (valid) {
  1341. updateManage(this.form1).then((response) => {
  1342. this.$modal.msgSuccess("修改成功");
  1343. this.open1 = false;
  1344. this.getList();
  1345. });
  1346. }
  1347. });
  1348. },
  1349. /** 提交按钮 */
  1350. submitForm() {
  1351. this.$refs["form"].validate((valid) => {
  1352. if (valid) {
  1353. if (this.form.id != null) {
  1354. updateManage(this.form).then((response) => {
  1355. this.$modal.msgSuccess("修改成功");
  1356. this.open = false;
  1357. this.getList();
  1358. });
  1359. } else {
  1360. this.form.printsManageList = this.tomList;
  1361. var num = 0;
  1362. var num1 = this.tomList.length;
  1363. for (let index = 0; index < this.tomList.length; index++) {
  1364. if (
  1365. this.tomList[index].levelM &&
  1366. this.tomList[index].printNumber
  1367. ) {
  1368. num += 1;
  1369. } else {
  1370. return this.$modal.msgWarning("请选择级别,份数");
  1371. }
  1372. }
  1373. // this.tomList.forEach((item,i)=>{
  1374. // if(item.levelM){
  1375. // num+=1
  1376. // }else{
  1377. // return this.$modal.msgWarning("请选择级别");
  1378. // }
  1379. // })
  1380. if (num1 == num) {
  1381. addManage(this.form).then((response) => {
  1382. this.$modal.msgSuccess("新增成功");
  1383. this.open = false;
  1384. this.getList();
  1385. });
  1386. }
  1387. }
  1388. }
  1389. });
  1390. },
  1391. /** 删除按钮操作 */
  1392. handleDelete(row) {
  1393. const ids = row.id || this.ids;
  1394. this.$modal
  1395. .confirm("是否确认删除该数据项?")
  1396. .then(function () {
  1397. return delManage(ids);
  1398. })
  1399. .then(() => {
  1400. this.getList();
  1401. this.$modal.msgSuccess("删除成功");
  1402. })
  1403. .catch(() => {});
  1404. },
  1405. /** 导出按钮操作 */
  1406. handleExport() {
  1407. const queryParams = this.queryParams;
  1408. this.$modal
  1409. .confirm("是否确认导出所有集中文印主数据项?")
  1410. .then(() => {
  1411. this.exportLoading = true;
  1412. return exportManage(queryParams);
  1413. })
  1414. .then((response) => {
  1415. this.$download.name(response.msg);
  1416. this.exportLoading = false;
  1417. })
  1418. .catch(() => {});
  1419. },
  1420. // 上传前校检格式和大小
  1421. handleBeforeUpload(file) {
  1422. // if (this.tomList.length > 1) {
  1423. // console.log(this.tomList);
  1424. // this.$message.error("上传失败, 请重试");
  1425. // callback(new Error('请填写必填项'))
  1426. // } else {
  1427. // 校检文件类型
  1428. this.tomLists.name = file.name;
  1429. this.form1.name = file.name;
  1430. if (file.size == 0) {
  1431. this.tomLists.size = "0 B";
  1432. this.form1.size = "0 B";
  1433. }
  1434. var k = 1024;
  1435. var sizes = ["B", "KB", "MB", "GB", "TB", "EB", "ZB", "YB"];
  1436. var i = Math.floor(Math.log(file.size) / Math.log(k));
  1437. this.tomLists.size = file.size;
  1438. this.form1.size = file.size;
  1439. this.tomLists.size =
  1440. (file.size / Math.pow(k, i)).toPrecision(3) + "" + sizes[i];
  1441. this.form1.size =
  1442. (file.size / Math.pow(k, i)).toPrecision(3) + "" + sizes[i];
  1443. if (this.fileType) {
  1444. let fileExtension = "";
  1445. if (file.name.lastIndexOf(".") > -1) {
  1446. fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
  1447. this.tomLists.type = fileExtension;
  1448. this.form1.type = fileExtension;
  1449. }
  1450. const isTypeOk = this.fileType.some((type) => {
  1451. if (file.type.indexOf(type) > -1) return true;
  1452. if (fileExtension && fileExtension.indexOf(type) > -1) return true;
  1453. return false;
  1454. });
  1455. if (!isTypeOk) {
  1456. this.$message.error(
  1457. `文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
  1458. );
  1459. this.tomLists.name = null;
  1460. this.tomLists.size = null;
  1461. this.tomLists.type = null;
  1462. this.form1.name = null;
  1463. this.form1.size = null;
  1464. this.form1.type = null;
  1465. return false;
  1466. }
  1467. }
  1468. // 校检文件大小
  1469. if (this.fileSize) {
  1470. const isLt = file.size / 1024 / 1024 < this.fileSize;
  1471. if (!isLt) {
  1472. this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
  1473. return false;
  1474. }
  1475. }
  1476. return true;
  1477. // }
  1478. },
  1479. // 文件个数超出
  1480. handleExceed() {
  1481. this.$message.error(`上传文件数量不能超过 ${this.limit} 个!`);
  1482. },
  1483. // 上传失败
  1484. handleUploadError(err) {
  1485. this.$message.error("上传失败, 请重试");
  1486. },
  1487. // 上传成功回调
  1488. handleUploadSuccess(res, file) {
  1489. this.$message.success("上传成功");
  1490. this.fileList.push({
  1491. name: file.name,
  1492. file: res.url,
  1493. size: this.tomLists.size,
  1494. type: this.tomLists.type,
  1495. });
  1496. this.$emit("input", this.fileList);
  1497. this.tomList = this.fileList;
  1498. this.form1.file = res.url;
  1499. // this.tomList.push(this.form)
  1500. },
  1501. //打印
  1502. handlePrint(row) {
  1503. this.dyreset();
  1504. this.dyopen = true;
  1505. this.title = "打印";
  1506. this.dyform.printName = row.name;
  1507. this.dyform.explainInfo = row.explainInfo;
  1508. this.dyform.printId = row.id;
  1509. this.dyform.file = row.file;
  1510. this.dyform.statusG = 0;
  1511. this.dyform.printfileName = row.sendName;
  1512. this.dyform.printNumber = row.printNumber;
  1513. this.dyform.printRoom = row.printRoom;
  1514. this.dyform.type = row.type;
  1515. this.dyform.isReturn = row.isReturn;
  1516. this.dyform.isReturn = row.isReturn + "";
  1517. if (row.isReturn == "1") {
  1518. this.ramrk = false;
  1519. }
  1520. if (row.isReturn == "0") {
  1521. this.ramrk = true;
  1522. }
  1523. if (row.isPrintColor == 1) {
  1524. this.yaoqiu = "彩打";
  1525. this.yaoqiuflg = true;
  1526. }
  1527. if (row.isPrintTwo == 1) {
  1528. this.yaoqiuflg = true;
  1529. if (this.yaoqiu) {
  1530. this.yaoqiu += " 双面打";
  1531. } else {
  1532. this.yaoqiu = "双面打";
  1533. }
  1534. }
  1535. if (row.isPrintTwo != 1 && row.isPrintColor != 1) {
  1536. this.yaoqiuflg = false;
  1537. }
  1538. this.getrylist();
  1539. },
  1540. // 查看按钮预览
  1541. handlelook(row) {
  1542. if (row.type == "docx" || row.type == "doc") {
  1543. this.open33 = true;
  1544. axios({
  1545. method: "get",
  1546. responseType: "blob", // 设置响应文件格式
  1547. url: row.file,
  1548. }).then(({ data }) => {
  1549. $(".docx").attr("id", "printArea");
  1550. docx.renderAsync(data, this.$refs.file); // 渲染到页面预览
  1551. });
  1552. } else if (row.type == "pdf") {
  1553. this.previewDialog = true;
  1554. this.pdfurl = row.file;
  1555. this.pageNum = 1;
  1556. } else if (row.type == "xlsx") {
  1557. axios
  1558. .get(row.file, {
  1559. responseType: "arraybuffer", // 设置响应体类型为arraybuffer
  1560. })
  1561. .then(({ data }) => {
  1562. let workbook = XLSX.read(new Uint8Array(data), { type: "array" }); // 解析数据
  1563. this.open44 = true;
  1564. var worksheet = workbook.Sheets[workbook.SheetNames[0]]; // workbook.SheetNames 下存的是该文件每个工作表名字,这里取出第一个工作表
  1565. this.tableau = XLSX.utils.sheet_to_html(worksheet); // 渲染
  1566. });
  1567. }
  1568. },
  1569. // 预览弹框
  1570. submitForm3() {
  1571. this.open33 = false;
  1572. },
  1573. //获取人员
  1574. getrylist() {
  1575. listPeople().then((res) => {
  1576. if (res.code == 200) {
  1577. this.rylist = res.rows;
  1578. }
  1579. });
  1580. },
  1581. //打印提交
  1582. dysubmitForm() {
  1583. this.$refs["dyform"].validate((valid) => {
  1584. if (valid) {
  1585. if (this.dyform.isReturn == 0) {
  1586. this.dyform.statusG = 1;
  1587. } else {
  1588. this.dyform.statusG = 0;
  1589. }
  1590. printCode(this.dyform).then((res) => {
  1591. if (res.code == 200) {
  1592. if (this.dyform.type == "pdf") {
  1593. // let blob = new Blob([res]);
  1594. // let objectUrl = URL.createObjectURL(blob);
  1595. // let link = document.createElement("a");
  1596. // link.download =this.dyform.file;
  1597. // link.href = objectUrl;
  1598. // link.click();
  1599. // link.remove();
  1600. let xhr = new XMLHttpRequest();
  1601. xhr.open(
  1602. "get",
  1603. process.env.VUE_APP_BASE_API +
  1604. "/profile/print/" +
  1605. res.printFileName,
  1606. true
  1607. );
  1608. xhr.setRequestHeader("Content-Type", `application/pdf`);
  1609. xhr.responseType = "blob";
  1610. let that = this;
  1611. xhr.onload = function () {
  1612. if (this.status == 200) {
  1613. //接受二进制文件流
  1614. var blob = this.response;
  1615. // that.downloadExportFile(blob, fileName);
  1616. let downloadElement = document.createElement("a");
  1617. let href = blob;
  1618. if (typeof blob == "string") {
  1619. downloadElement.target = "_blank";
  1620. } else {
  1621. href = window.URL.createObjectURL(blob); //创建下载的链接
  1622. }
  1623. downloadElement.href = href;
  1624. downloadElement.download = that.dyform.printName;
  1625. // tagFileName +
  1626. //下载后文件名
  1627. document.body.appendChild(downloadElement);
  1628. downloadElement.click(); //点击下载
  1629. document.body.removeChild(downloadElement); //下载完成移除元素
  1630. if (typeof blob != "string") {
  1631. window.URL.revokeObjectURL(href); //释放掉blob对象
  1632. }
  1633. }
  1634. };
  1635. xhr.send();
  1636. this.dyopen = false;
  1637. this.ramrk = false;
  1638. this.getList();
  1639. } else {
  1640. let downloadElement = document.createElement("a");
  1641. downloadElement.href =
  1642. process.env.VUE_APP_BASE_API +
  1643. "/profile/print/" +
  1644. res.printFileName;
  1645. downloadElement.download = this.dyform.printName;
  1646. document.body.appendChild(downloadElement);
  1647. downloadElement.click(); //点击下载
  1648. document.body.removeChild(downloadElement);
  1649. this.dyopen = false;
  1650. this.ramrk = false;
  1651. this.printshow = true;
  1652. this.getList();
  1653. }
  1654. // var open=window.open();
  1655. // location.href =res.file;
  1656. }
  1657. });
  1658. }
  1659. });
  1660. // open.location.href="http://192.168.5.188:8080/priofile/print/202203211244.docx";
  1661. // window.open( `https://view.officeapps.live.com/op/view.aspx?src=http://192.168.5.188:8080/profile/print/202203211428.docx`, "_blank");
  1662. },
  1663. // 确定
  1664. handleok(row) {
  1665. // this.dyform.printName = row.name;
  1666. // this.dyform.explainInfo = row.explainInfo;
  1667. // this.dyform.printId = row.id;
  1668. // this.dyform.file = row.file;
  1669. // this.dyform.statusG = 0;
  1670. // this.dyform.printfileName = row.sendName;
  1671. // this.dyform.printNumber = row.printNumber;
  1672. // this.dyform.printRoom = row.printRoom;
  1673. // this.dyform.type = row.type;
  1674. this.printManage = row;
  1675. tkbox(this.printManage).then((res) => {
  1676. this.printshow = false;
  1677. this.getList();
  1678. });
  1679. },
  1680. /**
  1681. * 预览PDF
  1682. */
  1683. previewPDF(row, index) {
  1684. this.previewDialog = true;
  1685. },
  1686. // 上一页函数,
  1687. prePage() {
  1688. this.gopage = true;
  1689. var page = this.pageNum;
  1690. page = page > 1 ? page - 1 : this.pageTotalNum;
  1691. this.pageNum = page;
  1692. },
  1693. // 下一页函数
  1694. nextPage() {
  1695. this.gopage = false;
  1696. var page = this.pageNum;
  1697. page = page < this.pageTotalNum ? page + 1 : 1;
  1698. this.pageNum = page;
  1699. },
  1700. // 页面顺时针翻转90度。
  1701. clock() {
  1702. this.pageRotate += 90;
  1703. },
  1704. // 页面逆时针翻转90度。
  1705. counterClock() {
  1706. this.pageRotate -= 90;
  1707. },
  1708. // 页面加载回调函数,其中e为当前页数
  1709. pageLoaded(e) {
  1710. this.curPageNum = e;
  1711. },
  1712. // 错误时回调函数。
  1713. pdfError(error) {
  1714. console.error(error);
  1715. },
  1716. // 打印全部
  1717. pdfPrintAll() {
  1718. /**
  1719. * 打印界面字符乱码是因为你pdf中使用了自定义字体导致的,谷歌浏览器打印的时候预览界面真的变成了真·方块字 ,解决方案如下:
  1720. * 用文章最后的pdfjsWrapper.js在替换掉node_modules/vue-pdf/src/pdfjsWrapper.js
  1721. */
  1722. this.$refs.pdf.print();
  1723. },
  1724. },
  1725. };
  1726. </script>
  1727. <style scoped>
  1728. ::v-deep .el-dialog {
  1729. background-color: #004d86;
  1730. }
  1731. ::v-deep .el-dialog__header {
  1732. border-bottom: 1px solid #718a9d;
  1733. }
  1734. ::v-deep .el-dialog__title {
  1735. color: #fff;
  1736. font: 18px;
  1737. }
  1738. ::v-deep .el-dialog__headerbtn .el-dialog__close {
  1739. color: #fff;
  1740. }
  1741. .el-form-item ::v-deep .el-input__inner {
  1742. width: 200px;
  1743. height: 36px;
  1744. background: transparent;
  1745. color: #fff;
  1746. border: 1px solid #fff !important;
  1747. }
  1748. ::v-deep .el-date-editor.el-input {
  1749. width: 200px;
  1750. height: 36px;
  1751. }
  1752. .pictureUploading-img img {
  1753. width: 60px;
  1754. height: 210px;
  1755. margin-right: 10px;
  1756. }
  1757. ::v-deep .el-upload--picture-card {
  1758. height: 210px;
  1759. width: 170px;
  1760. line-height: 210px;
  1761. background-image: url("../../../assets/images/头像.png");
  1762. background-repeat: no-repeat;
  1763. background-size: 100% 100%;
  1764. }
  1765. ::v-deep .el-upload--picture-card .el-icon-plus {
  1766. display: none;
  1767. }
  1768. .el-upload--picture-card /deep/ .el-upload--picture-card i {
  1769. font-size: 48px;
  1770. }
  1771. ::v-deep .el-upload__tip {
  1772. display: none;
  1773. }
  1774. ::v-deep .textarea-explainInfo .el-textarea__inner {
  1775. margin-left: 20px;
  1776. width: 880px;
  1777. height: 104px;
  1778. }
  1779. ::v-deep .textarea-explainInfo1 .el-textarea__inner {
  1780. /* margin-left: 20px; */
  1781. width: 833px;
  1782. height: 104px;
  1783. }
  1784. ::v-deep .dyform-textarea .el-textarea__inner {
  1785. width: 650px;
  1786. height: 64px;
  1787. }
  1788. .jiben2 {
  1789. width: 650px;
  1790. }
  1791. .jiben span {
  1792. width: 25px;
  1793. height: 25px;
  1794. display: inline-block;
  1795. background-color: #1c86e1;
  1796. line-height: 25px;
  1797. text-align: center;
  1798. font-size: 16px;
  1799. cursor: pointer;
  1800. /* margin-left: 851px; */
  1801. position: absolute;
  1802. right: 20px;
  1803. }
  1804. .el-select-dropdown__item:hover {
  1805. color: #1c86e1;
  1806. }
  1807. .el-select-dropdown__item {
  1808. color: #000;
  1809. }
  1810. .el-tree {
  1811. background-color: #00365f;
  1812. color: #fff;
  1813. }
  1814. ::v-deep .el-tree-node__content:hover {
  1815. color: #1c86e1;
  1816. }
  1817. ::v-deep .el-upload-list--picture-card .el-upload-list__item {
  1818. height: 210px;
  1819. width: 170px;
  1820. }
  1821. .dadui {
  1822. height: 40px;
  1823. background: #003156;
  1824. /* border-bottom: 1px solid #718A9D ; */
  1825. background-image: url(../../../images/矩形底部边框.png);
  1826. background-repeat: no-repeat;
  1827. background-position: 0px 39px;
  1828. font-size: 16px;
  1829. color: #1d96ff;
  1830. }
  1831. .dadui img {
  1832. margin: 10px 10px 0px 10px;
  1833. }
  1834. .data {
  1835. height: 40px;
  1836. background: #003156;
  1837. margin-bottom: 12px;
  1838. color: #fff;
  1839. display: flex;
  1840. font-size: 13px;
  1841. line-height: 25px;
  1842. position: relative;
  1843. }
  1844. .el-tree {
  1845. padding: 10px;
  1846. background: #003156;
  1847. color: #fff;
  1848. }
  1849. .data p {
  1850. position: absolute;
  1851. top: -5px;
  1852. left: 15px;
  1853. }
  1854. .data .a1 {
  1855. width: 128px;
  1856. height: 26px;
  1857. background: rgba(23, 74, 112, 0.4);
  1858. border-radius: 13px;
  1859. position: absolute;
  1860. top: 7px;
  1861. left: 60px;
  1862. }
  1863. ::v-deep .data .el-date-editor.el-input {
  1864. width: 100%;
  1865. border: none;
  1866. }
  1867. ::v-deep .data .el-input__inner {
  1868. width: 100% !important;
  1869. border: none;
  1870. }
  1871. ::v-deep .data .el-input--medium .el-input__icon {
  1872. line-height: 36px;
  1873. position: absolute;
  1874. right: -223px;
  1875. top: 2px;
  1876. }
  1877. ::v-deep .data .el-input__inner {
  1878. background-color: transparent;
  1879. color: #fff;
  1880. text-align: center;
  1881. margin-top: 2px;
  1882. }
  1883. ::v-deep .data .el-input__suffix {
  1884. position: absolute;
  1885. right: 281px;
  1886. }
  1887. ::v-deep
  1888. .el-tree--highlight-current
  1889. .el-tree-node.is-current
  1890. > .el-tree-node__content {
  1891. color: #00365f !important;
  1892. /* background-color: #003156 !important; */
  1893. }
  1894. ::v-deep .el-radio-group .el-radio {
  1895. color: #fff;
  1896. }
  1897. /* ::v-deep .el-radio:last-child {
  1898. margin-left: 35px;
  1899. } */
  1900. /* 调整输入框提示文字颜色 */
  1901. ::v-deep .vue-treeselect__placeholder {
  1902. color: #bdbdbd4f !important;
  1903. }
  1904. ::v-deep input::-webkit-input-placeholder {
  1905. color: #bdbdbd4f !important;
  1906. }
  1907. ::v-deep input:-moz-placeholder {
  1908. color: #bdbdbd4f !important;
  1909. }
  1910. /* 文本域提示文字颜色 */
  1911. ::v-deep ::-webkit-input-placeholder {
  1912. color: #bdbdbd4f !important;
  1913. }
  1914. ::v-deep .el-dialog__footer {
  1915. padding-right: 30px !important;
  1916. }
  1917. ::v-deep .el-input__inner {
  1918. border: 1px solid white !important;
  1919. }
  1920. /* 预览弹框背景去除 */
  1921. ::v-deep .docx-wrapper {
  1922. padding: 0 !important;
  1923. background: none !important;
  1924. }
  1925. /* excel表格样式 */
  1926. ::v-deep .home table tr td {
  1927. text-align: right;
  1928. height: 20px;
  1929. min-width: 60px;
  1930. text-align: center;
  1931. /* margin-left: -5px ; */
  1932. /* width: 70px !important; */
  1933. border-right: 1px solid black;
  1934. border-bottom: 1px solid black !important;
  1935. }
  1936. ::v-deep .home table {
  1937. width: 100%;
  1938. border-spacing: 0px !important;
  1939. border-top: 1px solid black;
  1940. border-left: 1px solid black;
  1941. /* border-collapse: collapse !important;
  1942. border-color:#b6ff00 !important; */
  1943. }
  1944. ::v-deep .docx-wrapper table tr td {
  1945. border-bottom: 1px solid black !important;
  1946. }
  1947. ::v-deep .docx {
  1948. width: 100% !important;
  1949. }
  1950. /* 文件关闭小叉号 */
  1951. ::v-deep .el-dialog__headerbtn .el-dialog__close {
  1952. color: #ccc !important;
  1953. }
  1954. /* 上一页样式 */
  1955. .gopage {
  1956. width: 60px;
  1957. height: 28px;
  1958. background: #f4f4f4;
  1959. color: #60627d;
  1960. border-radius: 14px 0px 0px 14px;
  1961. padding: 6px 9px;
  1962. }
  1963. /* 下一页样式 */
  1964. .downpage {
  1965. width: 60px;
  1966. height: 28px;
  1967. background: #f4f4f4;
  1968. border-radius: 0px 14px 14px 0px;
  1969. padding: 6px 9px;
  1970. }
  1971. .bg {
  1972. background: #1d96ff;
  1973. color: white;
  1974. }
  1975. .greed {
  1976. position: absolute;
  1977. top: 26px;
  1978. right: -10px;
  1979. color: #13ce66;
  1980. }
  1981. .CCC {
  1982. position: absolute;
  1983. top: 26px;
  1984. right: 118px;
  1985. color: #cccccc;
  1986. }
  1987. /* 文件名称表格 */
  1988. ::v-deep .fileName .el-input__inner {
  1989. width: 316px !important;
  1990. text-indent: 1em;
  1991. /* background-color: #196299; */
  1992. }
  1993. ::v-deep .fileName .el-input__suffix {
  1994. left: -280px;
  1995. }
  1996. </style>