123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031 |
- <template>
- <div class="app-container">
- <el-form
- :model="queryParams"
- ref="queryForm"
- :inline="true"
- v-show="showSearch"
- label-width="68px"
- >
- <el-form-item prop="name">
- <el-input
- v-model="queryParams.name"
- placeholder="请输入文件名称"
- clearable
- size="small"
- @input="handleQuery"
- />
- </el-form-item>
- <el-form-item prop="sendName">
- <el-input
- v-model="queryParams.sendName"
- placeholder="请输入发送人"
- clearable
- size="small"
- @input="handleQuery"
- />
- </el-form-item>
- <el-form-item>
- <!-- <el-button type="primary" size="btn" @click="handleQuery"
- >搜索</el-button
- > -->
- <el-button size="btr" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- plain
- size="mini"
- @click="handleAdd"
- v-hasPermi="['PrintsManage:manage:add']"
- >发送文件</el-button
- >
- </el-col>
- <!-- <el-col :span="1.5">
- <el-button
- type="success"
- plain
- icon="el-icon-edit"
- size="mini"
- :disabled="single"
- @click="handleUpdate"
- v-hasPermi="['PrintsManage:manage:edit']"
- >修改</el-button>
- </el-col>-->
- <el-col :span="1.5">
- <el-button
- type="danger"
- plain
- icon="el-icon-delete"
- size="mini"
- :disabled="multiple"
- @click="handleDelete"
- v-hasPermi="['PrintsManage:manage:remove']"
- >删除</el-button
- >
- </el-col>
- <!-- <el-col :span="1.5">
- <el-button
- type="warning"
- plain
- icon="el-icon-download"
- size="mini"
- :loading="exportLoading"
- @click="handleExport"
- v-hasPermi="['PrintsManage:manage:export']"
- >导出</el-button>
- </el-col>-->
- <!-- <right-toolbar
- :showSearch.sync="showSearch"
- @queryTable="getList"
- ></right-toolbar> -->
- </el-row>
- <el-table
- v-loading="loading"
- :header-cell-style="{ background: '#003C69', color: 'white' }"
- :data="manageList"
- @selection-change="handleSelectionChange"
- >
- <el-table-column type="selection" width="55" align="center" />
- <!-- <el-table-column label="打印回复信息" align="center" prop="id" /> -->
- <el-table-column label="序号" align="center" type="index" />
- <el-table-column
- label="文件名称"
- align="center"
- prop="name"
- show-overflow-tooltip
- />
- <!-- <el-table-column label="路径" align="center" prop="file" /> -->
- <el-table-column label="类型" align="center" prop="type" />
- <el-table-column label="是否彩打" align="center" prop="isPrintColor">
- <template slot-scope="scope">
- <span>{{ scope.row.isPrintColor == 0 ? "否" : "是" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="是否双面打" align="center" prop="isPrintTwo">
- <template slot-scope="scope">
- <span>{{ scope.row.isPrintTwo == 0 ? "否" : "是" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="打印状态" align="center" prop="printStatus">
- <template slot-scope="scope">
- <span
- style="color: #90da90"
- v-if="
- (scope.row.printStatus == 1 &&
- scope.row.printRoom == 0 &&
- roles == '15号文印室') ||
- (scope.row.printStatus == 1 &&
- scope.row.printRoom == 1 &&
- roles == '19号文印室')
- "
- >待打印</span
- >
- <span
- style="color: #90da90"
- v-if="
- scope.row.printStatus == 1 &&
- roles != '19号文印室' &&
- roles != '15号文印室'
- "
- >打印中</span
- >
- <span style="color: #00ff00" v-if="scope.row.printStatus == 2"
- >已打印</span
- >
- </template>
- </el-table-column>
- <el-table-column label="级别" align="center" prop="levelM">
- <template slot-scope="scope">
- <dict-tag :options="dict.type.level" :value="scope.row.levelM" />
- </template>
- </el-table-column>
- <el-table-column label="发送人" align="center" prop="sendName" />
- <el-table-column
- label="发送时间"
- align="center"
- prop="creattime"
- width="180"
- >
- <template slot-scope="scope">
- <span>{{
- parseTime(scope.row.creattime, "{y}-{m}-{d} {h}:{i}:{s}")
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- width="280px"
- >
- <template slot-scope="scope">
- <el-button
- size="btu"
- type="text"
- @click="handleok(scope.row)"
- v-hasPermi="['PrintsLog:printlog:edit']"
- v-if="scope.row.isShow == 1"
- >确定</el-button
- >
- <el-button
- size="btk"
- type="text"
- @click="handlelook(scope.row)"
- v-hasPermi="['PrintsLog:printlog:edit']"
- >查看</el-button
- >
- <el-button
- size="btk"
- type="text"
- @click="handlePrint(scope.row)"
- v-hasPermi="['PrintsLog:printlog:edit']"
- >打印</el-button
- >
- <el-button
- size="btu"
- type="text"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['PrintsManage:manage:edit']"
- >修改</el-button
- >
- <el-button
- size="btd"
- type="text"
- @click="handleDelete(scope.row)"
- v-hasPermi="['PrintsManage:manage:remove']"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 添加或修改集中文印主对话框 -->
- <el-dialog
- :title="title"
- :visible.sync="open"
- width="1010px"
- append-to-body
- :close-on-click-modal="false"
- >
- <div class="userAgree">
- <el-form
- ref="form"
- :model="form"
- :inline="true"
- :rules="rules"
- label-width="120px"
- style="margin-left: 34px"
- >
- <div class="jiben">发送人信息</div>
- <el-form-item label="发送人" prop="sendName">
- <el-input
- v-model="form.sendName"
- disabled
- placeholder="请输入发送人"
- />
- </el-form-item>
- <el-form-item label="文印室" prop="printRoom">
- <el-select
- v-model="form.printRoom"
- clearable
- placeholder="请选择文印室"
- >
- <el-option
- v-for="dict in printRooms"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="parseInt(dict.dictValue)"
- ></el-option>
- </el-select>
- </el-form-item>
- <div class="jiben">打印说明</div>
- <el-form-item label prop="explainInfo">
- <el-input
- v-model="form.explainInfo"
- type="textarea"
- placeholder="请输入打印说明"
- class="textarea-explainInfo"
- />
- </el-form-item>
- <div class="jiben">文件信息</div>
- <!-- <el-form-item label="文件名称">
- <el-input v-model="form.name" placeholder="请输入文件名称" />
- </el-form-item>
- <el-form-item label="打印份数" prop="printNumber">
- <el-input
- v-model="form.printNumber"
- :min="0"
- placeholder="请输入打印份数"
- />
- </el-form-item>
- <el-form-item label="文件大小" prop="size">
- <el-input v-model="form.size" placeholder="请输入文件大小" />
- </el-form-item> -->
- <!-- <el-form-item label="单位ID" prop="unitId">
- <el-input v-model="form.unitId" placeholder="请输入单位ID" />
- </el-form-item>-->
- <!-- <el-form-item label="单位名称" prop="unitName">
- <el-input v-model="form.unitName" placeholder="请输入单位名称" />
- </el-form-item>-->
- <!-- <el-form-item label="文件类型" prop="type">
- <el-input v-model="form.type" placeholder="请输入文件类型" />
- </el-form-item> -->
- <!-- <el-form-item label="级别" prop="levelM">
- <el-select v-model="form.levelM" clearable placeholder="请选择级别">
- <el-option
- v-for="dict in levelMs"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="parseInt(dict.dictValue)"
- ></el-option>
- </el-select>
- </el-form-item> -->
- <!-- <el-form-item label="是否需要归还" prop="isReturn">
- <el-radio-group v-model="form.isReturn" style="width:200px;" size="mini">
- <el-radio label="1">归还</el-radio>
- <el-radio label="0">无需归还</el-radio>
- </el-radio-group>
- </el-form-item>-->
- <!-- <el-form-item label="是否为彩打" prop="isPrintColor">
- <el-radio-group
- v-model="form.isPrintColor"
- style="width: 200px"
- size="mini"
- >
- <el-radio label="1">是</el-radio>
- <el-radio label="0">否</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="是否为双面打" prop="isPrintTwo">
- <el-radio-group
- v-model="form.isPrintTwo"
- style="width: 200px"
- size="mini"
- >
- <el-radio label="1">是</el-radio>
- <el-radio label="0">否</el-radio>
- </el-radio-group>
- </el-form-item> -->
- <div class="box3" v-for="(item, i) in tomList" :key="i">
- <el-form
- ref="refform"
- :model="form"
- :rules="rules"
- label-width="80px"
- :inline="true"
- style="margin-left: 20px"
- >
- <el-form-item prop="type">
- <el-input
- class="forEach"
- disabled
- v-model="item.type"
- placeholder="请输入文件类型"
- />
- <!-- <el-select v-model="form.type" placeholder="请选择类型">
- <el-option label="请选择字典生成" value />
- </el-select>-->
- </el-form-item>
- <el-form-item prop="size">
- <el-input
- class="forEach"
- disabled
- v-model="item.size"
- placeholder="请输入文件大小"
- />
- </el-form-item>
- <el-form-item prop="levelM">
- <el-select
- v-model="item.levelM"
- clearable
- class="forEach"
- placeholder="请选择级别"
- >
- <el-option
- v-for="dict in levelMs"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="parseInt(dict.dictValue)"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="printNumber">
- <el-input
- class="forEach"
- v-model="item.printNumber"
- :min="0"
- placeholder="请输入打印份数"
- />
- </el-form-item>
- <el-form-item>
- <!-- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- style="padding: 11px 10px 10px 10px"
- @click="addForms"
- v-if="i == tomList.length - 1"
- ></el-button> -->
- <el-button
- type="danger"
- icon="el-icon-close"
- size="mini"
- style="padding: 11px 10px 10px 10px"
- v-if="i >= 0"
- @click="delForms(i)"
- ></el-button>
- </el-form-item>
- <el-form-item>
- <el-input
- class="fileName"
- suffix-icon="el-icon-document"
- disabled
- v-model="item.name"
- placeholder="请输入文件名称"
- />
- </el-form-item>
- <!-- <el-form-item label="单位ID" prop="unitId">
- <el-input v-model="form.unitId" placeholder="请输入单位ID" />
- </el-form-item>-->
- <!-- <el-form-item label="单位名称" prop="unitName">
- <el-input v-model="form.unitName" placeholder="请输入单位名称" />
- </el-form-item>-->
- <!-- <el-form-item label="是否需要归还" prop="isReturn">
- <el-radio-group v-model="form.isReturn" style="width:200px;" size="mini">
- <el-radio label="1">归还</el-radio>
- <el-radio label="0">无需归还</el-radio>
- </el-radio-group>
- </el-form-item>-->
- <el-form-item
- label="是否为彩打"
- label-width="120px"
- prop="isPrintColor"
- >
- <!-- <el-radio-group
- v-model="item.isPrintColor"
- style="width: 200px"
- size="mini"
- >
- <el-radio label="1">是</el-radio>
- <el-radio label="0">否</el-radio>
- </el-radio-group> -->
- <el-switch
- v-model="item.isPrintColor"
- active-color="#13ce66"
- inactive-color="#ccc"
- active-value="1"
- inactive-value="0"
- >
- </el-switch>
- <span class="greed" v-if="item.isPrintColor == '1'"></span>
- <span class="CCC" v-if="item.isPrintColor == '0'"></span>
- </el-form-item>
- <el-form-item
- label="是否为双面打"
- label-width="120px"
- prop="isPrintTwo"
- >
- <!-- <el-radio-group
- v-model="item.isPrintTwo"
- style="width: 200px"
- size="mini"
- >
- <el-radio label="1">是</el-radio>
- <el-radio label="0">否</el-radio>
- </el-radio-group> -->
- <el-switch
- v-model="item.isPrintTwo"
- active-color="#13ce66"
- inactive-color="#ccc"
- active-value="1"
- inactive-value="0"
- >
- </el-switch>
- <span class="greed" v-if="item.isPrintTwo == '1'"></span>
- <span class="CCC" v-if="item.isPrintTwo == '0'"></span>
- </el-form-item>
- <el-form-item
- label="是否需归还"
- label-width="120px"
- prop="isReturns"
- >
- <el-switch
- v-model="item.isReturn"
- active-color="#13ce66"
- inactive-color="#ccc"
- active-value="1"
- inactive-value="0"
- >
- </el-switch>
- <span class="greed" v-if="item.isReturn == '1'"></span>
- <span class="CCC" v-if="item.isReturn == '0'"></span>
- </el-form-item>
- </el-form>
- </div>
- <el-form-item style="margin-left: 20px" prop="name">
- <!-- <fileUpload v-model="form.file" /> -->
- <el-upload
- :action="uploadFileUrl"
- :before-upload="handleBeforeUpload"
- :file-list="fileList"
- :limit="limit"
- :on-error="handleUploadError"
- :on-exceed="handleExceed"
- :on-success="handleUploadSuccess"
- :show-file-list="false"
- :headers="headers"
- class="upload-file-uploader"
- ref="upload"
- style="width: 200px"
- name="pfile"
- >
- <!-- 上传按钮 -->
- <el-button size="mini" type="primary" class="select_file"
- >选取文件</el-button
- >
- </el-upload>
- </el-form-item>
- <!-- <el-form-item label="发送人ID" prop="sendId">
- <el-input v-model="form.sendId" placeholder="请输入发送人ID" />
- </el-form-item>-->
- <!-- <el-form-item label="创建时间" prop="creattime">
- <el-date-picker
- clearable
- size="small"
- v-model="form.creattime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择创建时间"
- ></el-date-picker>
- </el-form-item>-->
- <!-- <el-form-item label="打印状态(1 打印中 2 已打印)">
- <el-radio-group v-model="form.printStatus">
- <el-radio label="1">请选择字典生成</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="接收人ID" prop="receiveId">
- <el-input v-model="form.receiveId" placeholder="请输入接收人ID" />
- </el-form-item>
- <el-form-item label="接收人" prop="receiveName">
- <el-input v-model="form.receiveName" placeholder="请输入接收人" />
- </el-form-item>
- <el-form-item label="生成路径">
- <fileUpload v-model="form.sFile" />
- </el-form-item>
- <el-form-item label="打印回复信息" prop="printInfo">
- <el-input v-model="form.printInfo" placeholder="请输入打印回复信息" />
- </el-form-item>-->
- </el-form>
- </div>
- <div slot="footer" class="dialog-footer" style="margin-right: 30px">
- <el-button type="primary" @click="submitForm">确 定</el-button>
- <el-button @click="cancel" size="btn">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 修改集中文印 -->
- <el-dialog
- :title="title1"
- :visible.sync="open1"
- width="940px"
- append-to-body
- :close-on-click-modal="false"
- >
- <el-form
- ref="form1"
- :model="form1"
- :inline="true"
- :rules="rules"
- label-width="120px"
- style="margin-left: 37px"
- >
- <div class="jiben">发送人信息</div>
- <el-form-item label="发送人" prop="sendName">
- <el-input
- v-model="form1.sendName"
- disabled
- placeholder="请输入发送人"
- />
- </el-form-item>
- <el-form-item label="文印室" prop="printRoom">
- <el-select
- v-model="form1.printRoom"
- clearable
- placeholder="请选择文印室"
- >
- <el-option
- v-for="dict in printRooms"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="parseInt(dict.dictValue)"
- ></el-option>
- </el-select>
- </el-form-item>
- <div class="jiben">打印说明</div>
- <el-form-item label prop="explainInfo">
- <el-input
- v-model="form1.explainInfo"
- type="textarea"
- placeholder="请输入打印说明"
- class="textarea-explainInfo1"
- />
- </el-form-item>
- <div class="jiben">文件信息</div>
- <el-form-item prop="type">
- <el-input
- class="forEach"
- disabled
- v-model="form1.type"
- placeholder="请输入文件类型"
- />
- <!-- <el-select v-model="form.type" placeholder="请选择类型">
- <el-option label="请选择字典生成" value />
- </el-select>-->
- </el-form-item>
- <el-form-item prop="size">
- <el-input
- class="forEach"
- disabled
- v-model="form1.size"
- placeholder="请输入文件大小"
- />
- </el-form-item>
- <el-form-item prop="levelM">
- <el-select
- v-model="form1.levelM"
- clearable
- class="forEach"
- placeholder="请选择级别"
- >
- <el-option
- v-for="dict in levelMs"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="parseInt(dict.dictValue)"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="printNumber">
- <el-input
- class="forEach"
- v-model="form1.printNumber"
- :min="0"
- placeholder="请输入打印份数"
- />
- </el-form-item>
- <el-form-item>
- <el-input
- class="fileName"
- suffix-icon="el-icon-document"
- disabled
- v-model="form1.name"
- placeholder="请输入文件名称"
- />
- </el-form-item>
- <el-form-item
- label="是否为彩打"
- label-width="120px"
- prop="isPrintColor"
- >
- <el-switch
- v-model="form1.isPrintColor"
- active-color="#13ce66"
- inactive-color="#ccc"
- active-value="1"
- inactive-value="0"
- >
- </el-switch>
- <span class="greed" v-if="form1.isPrintColor == '1'"></span>
- <span class="CCC" v-if="form1.isPrintColor == '0'"></span>
- </el-form-item>
- <el-form-item
- label="是否为双面打"
- label-width="120px"
- prop="isPrintTwo"
- >
- <!-- <el-radio-group
- v-model="item.isPrintTwo"
- style="width: 200px"
- size="mini"
- >
- <el-radio label="1">是</el-radio>
- <el-radio label="0">否</el-radio>
- </el-radio-group> -->
- <el-switch
- v-model="form1.isPrintTwo"
- active-color="#13ce66"
- inactive-color="#ccc"
- active-value="1"
- inactive-value="0"
- >
- </el-switch>
- <span class="greed" v-if="form1.isPrintTwo == '1'"></span>
- <span class="CCC" v-if="form1.isPrintTwo == '0'"></span>
- </el-form-item>
- <el-form-item label="是否需归还" label-width="120px" prop="isReturns">
- <el-switch
- v-model="form1.isReturn"
- active-color="#13ce66"
- inactive-color="#ccc"
- :active-value="1"
- :inactive-value="0"
- >
- </el-switch>
- <span class="greed" v-if="form1.isReturn == 1"></span>
- <span class="CCC" v-if="form1.isReturn == 0"></span>
- </el-form-item>
- <el-form-item prop="name">
- <!-- <fileUpload v-model="form.file" /> -->
- <el-upload
- :action="uploadFileUrl"
- :before-upload="handleBeforeUpload"
- :file-list="fileList"
- :limit="limit"
- :on-error="handleUploadError"
- :on-exceed="handleExceed"
- :on-success="handleUploadSuccess"
- :show-file-list="false"
- :headers="headers"
- class="upload-file-uploader"
- ref="upload"
- style="width: 200px"
- name="pfile"
- >
- <!-- 上传按钮 -->
- <el-button size="mini" type="primary" class="select_file"
- >选取文件</el-button
- >
- </el-upload>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer" style="margin-right: 18px">
- <el-button type="primary" @click="updatesubmit">确 定</el-button>
- <el-button @click="open1 = false" size="btn">取 消</el-button>
- </div>
- </el-dialog>
- <el-dialog
- :title="title"
- :visible.sync="dyopen"
- append-to-body
- width="700px"
- style="padding-top: 100px"
- :close-on-click-modal="false"
- @close="close"
- >
- <el-form
- ref="dyform"
- :model="dyform"
- :inline="true"
- :rules="rules"
- label-width="120px"
- >
- <div class="jiben jiben2">打印信息</div>
- <el-form-item label="打印文件" prop="printName">
- <el-input v-model="dyform.printName" placeholder="请输入打印文件" />
- </el-form-item>
- <el-form-item label="打印份数" prop="printNumber">
- <el-input
- v-model="dyform.printNumber"
- :min="0"
- placeholder="请输入打印份数"
- />
- </el-form-item>
- <el-form-item label="是否需要归还" prop="isReturn">
- <el-radio-group
- v-model="dyform.isReturn"
- style="width: 200px"
- size="mini"
- @change="dianji"
- >
- <el-radio label="1">归还</el-radio>
- <el-radio label="0">无需归还</el-radio>
- </el-radio-group>
- </el-form-item>
- <!-- <el-form-item label="是否为彩打" prop="isPrintColor">
- <el-radio-group v-model="dyform.isPrintColor" style="width:200px;" size="mini">
- <el-radio label="1">是</el-radio>
- <el-radio label="0">否</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="是否为双面打" prop="isPrintTwo">
- <el-radio-group v-model="dyform.isPrintTwo" style="width:200px;" size="mini">
- <el-radio label="1">是</el-radio>
- <el-radio label="0">否</el-radio>
- </el-radio-group>
- </el-form-item>-->
- <!-- <div class="jiben">打印人信息</div> -->
- <el-form-item label="打印人" prop="printfileName">
- <el-select
- v-model="dyform.printfileName"
- filterable
- clearable
- placeholder="请选择打印人"
- >
- <el-option
- v-for="item in rylist"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <div class="jiben jiben2">打印说明</div>
- <div
- style="
- width: 98.5%;
- height: 45px;
- font-size: 14px;
- line-height: 45px;
- color: #fff;
- border-bottom: 1px solid #fff;
- margin-bottom: 20px;
- padding-left: 15px;
- "
- v-if="yaoqiuflg"
- >
- 其他要求:{{ yaoqiu }}
- </div>
- <el-form-item label prop="explainInfo">
- <el-input
- v-model="dyform.explainInfo"
- type="textarea"
- placeholder="请输入打印说明"
- class="dyform-textarea"
- />
- </el-form-item>
- <div class="jiben jiben2" v-if="ramrk">备注</div>
- <el-form-item label prop="" v-if="ramrk">
- <el-input
- v-model="dyform.remark"
- type="textarea"
- placeholder="请输入备注"
- class="dyform-textarea"
- />
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="dysubmitForm">打 印</el-button>
- <el-button @click="dycancel" size="btn">取 消</el-button>
- </div>
- </el-dialog>
- <!-- <el-dialog
- :title="title"
- :visible.sync="dyopen2"
- append-to-body
- width="1500px"
- style="padding-top:100px;"
- >
- <div ref="file" v-html="tableau" style="width:100%;"></div>
- </el-dialog> -->
- <!-- 添加预览doc文件弹框 -->
- <el-dialog
- style="color: pink"
- :title="title3"
- :visible.sync="open33"
- width="1100px"
- append-to-body
- id="fileinfodocx"
- class="el-dialog__header"
- :close-on-click-modal="false"
- >
- <div ref="file"></div>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm3">关 闭</el-button>
- <!-- <el-button @click="open33 = false" size="" class="aa1">
- 取 消</el-button
- > -->
- </div>
- </el-dialog>
- <!-- 预览PDF文件弹框 -->
- <el-dialog
- :title="title3"
- :visible.sync="previewDialog"
- width="850px"
- append-to-body
- id="fileinfopdf"
- class="el-dialog__header"
- :close-on-click-modal="false"
- >
- <template>
- <!-- <div style="margin-bottom:20px"> -->
- <div style="display: flex">
- <el-button
- :class="gopage == true ? 'bg' : ''"
- class="gopage"
- :theme="'default'"
- type="submit"
- :title="'上一页'"
- @click.native="prePage"
- >
- 上一页</el-button
- >
- <div
- style="
- width: 50px;
- height: 28px;
- background: #f4f4f4;
- text-align: center;
- line-height: 28px;
- "
- >
- {{ pageNum }}/{{ pageTotalNum }}
- </div>
- <el-button
- :class="gopage == false ? 'bg' : ''"
- :theme="'default'"
- class="downpage"
- type="submit"
- :title="'下一页'"
- @click.native="nextPage"
- >
- 下一页</el-button
- >
- <!-- <el-button :theme="'default'" type="submit" :title="'顺时针旋转'" @click.native="clock" > 顺时针旋转</el-button>
- <el-button :theme="'default'" type="submit" :title="'逆时针旋转'" @click.native="counterClock" > 逆时针旋转</el-button>
- <el-button :theme="'default'" type="submit" :title="'打印'" @click.native="pdfPrintAll"> 打印</el-button> -->
- </div>
- <PDF
- ref="pdf"
- :src="pdfurl"
- :page="pageNum"
- :rotate="pageRotate"
- @progress="loadedRatio = $event"
- @page-loaded="pageLoaded($event)"
- @num-pages="pageTotalNum = $event"
- @error="pdfError($event)"
- @link-clicked="page = $event"
- ></PDF>
- <!-- </div> -->
- <!-- <div class="el-dialog__footer"> -->
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="previewDialog = false"
- >关 闭</el-button
- >
- <!-- <el-button @click="previewDialog = false" size="" class="aa1"
- >取 消</el-button
- > -->
- </div>
- <!-- </div> -->
- </template>
- </el-dialog>
- <el-dialog
- :title="title3"
- :visible.sync="open44"
- width="1100px"
- append-to-body
- id="fileinfopdf"
- class="el-dialog__header"
- :close-on-click-modal="false"
- >
- <template>
- <div class="home">
- <div v-html="tableau"></div>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="open44 = false">关 闭</el-button>
- <!-- <el-button @click="open44 = false" size="" class="aa1"
- >取 消</el-button
- > -->
- </div>
- </template>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- listManage,
- getManage,
- delManage,
- addManage,
- updateManage,
- exportManage,
- printFile,
- listPeople,
- printCode,
- tkbox,
- } from "@/api/PrintsManage/manage";
- import { getToken } from "@/utils/auth";
- import Cookies from "js-cookie";
- import axios from "axios";
- var XLSX = require("xlsx");
- const docx = require("docx-preview");
- window.JSZip = require("jszip");
- import PDF from "vue-pdf";
- export default {
- name: "Manage",
- dicts: ["level", "print_room"],
- props: {
- // 值
- value: [String, Object, Array],
- // 数量限制
- limit: {
- type: Number,
- default: 10,
- },
- // 大小限制(MB)
- fileSize: {
- type: Number,
- default: 50,
- },
- // 文件类型, 例如['png', 'jpg', 'jpeg']
- fileType: {
- type: Array,
- default: () => ["doc", "xls", "ppt", "pdf"],
- },
- // 是否显示提示
- isShowTip: {
- type: Boolean,
- default: true,
- },
- },
- components: {
- PDF,
- },
- data() {
- return {
- // 遮罩层
- loading: true,
- // 导出遮罩层
- exportLoading: false,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 集中文印主表格数据
- manageList: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- dyopen: false,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- name: null,
- file: null,
- type: null,
- size: null,
- unitId: null,
- unitName: null,
- levelM: null,
- sendId: null,
- sendName: null,
- creattime: null,
- updatetime: null,
- explainInfo: null,
- printStatus: null,
- receiveId: null,
- receiveName: null,
- sFile: null,
- printInfo: null,
- printRoom: null,
- },
- // 表单参数
- form: {
- printsManageList: [],
- },
- dyform: {},
- // 表单校验
- rules: {
- // name: [
- // // { required: true, message: "发送文件不能为空", trigger: "click" },
- // { required: true },
- // ],
- printRoom: [
- { required: true, message: "打印室不能为空", trigger: "change" },
- ],
- isReturn: [
- { required: true, message: "是否归还需要选择", trigger: "change" },
- ],
- printName: [
- { required: true, message: "打印文件不能为空", trigger: "change" },
- ],
- printfileName: [
- { required: true, message: "打印人不能为空", trigger: "change" },
- ],
- },
- //级别
- levelMs: [],
- //文印室
- printRooms: [],
- baseUrl: process.env.VUE_APP_BASE_API,
- uploadFileUrl:
- process.env.VUE_APP_BASE_API + "/PrintsManage/manage/printFile", // 上传的图片服务器地址
- headers: {
- Authorization: "Bearer " + getToken(),
- },
- fileList: [],
- faith: null,
- rylist: [],
- islist: [],
- yaoqiu: "",
- dyopen2: false,
- tableau: null,
- yaoqiuflg: false,
- roles: "",
- // 虚拟字段
- fid: "",
- open33: false,
- title3: "预览文件",
- // 下载文件路径
- downurl: process.env.VUE_APP_BASE_API,
- // pdf文件
- previewDialog: false,
- pdfurl: "",
- pageNum: 1,
- pageTotalNum: 1,
- pageRotate: 0,
- // 加载进度
- loadedRatio: 0,
- curPageNum: 0,
- gopage: true,
- // excel表格
- tableau: null,
- open44: false,
- // 确定按钮
- printshow: false,
- printManage: {},
- //添加文件为空
- tomList: [
- {
- // 文件名称
- name: null,
- // 打印份数
- printNumber: null,
- // 文件大小
- size: null,
- // 级别
- levelM: null,
- // 是否为彩打
- isPrintColor: null,
- // 是否为双面打
- isPrintTwo: null,
- },
- ],
- // 上传文件
- tomLists: [],
- form1: {},
- open1: false,
- title1: "",
- // 打印备注
- ramrk: false,
- };
- },
- created() {
- // if (Cookies.get("shuaxin") != "true") {
- // window.location.reload();
- // }
- // Cookies.set("shuaxin", "true");
- this.getList();
- //级别
- this.getDicts("level").then((response) => {
- this.levelMs = response.data;
- });
- //文印室
- this.getDicts("print_room").then((response) => {
- this.printRooms = response.data;
- });
- //是否
- this.getDicts("sys_is").then((response) => {
- this.islist = response.data;
- });
- },
- mounted() {
- this.roles = Cookies.get("roles");
- },
- methods: {
- // 点击上传文件触发
- fileChange(data) {
- console.log(1);
- },
- // 打印点击叉号关闭事件
- close() {
- this.ramrk = false;
- },
- // 点击是否需要归还触发
- dianji(data) {
- if (data == "1") {
- this.ramrk = false;
- } else if (data == "0") {
- this.ramrk = true;
- }
- },
- // 增加工作登记
- addForms() {
- this.tomList.push({
- // 文件名称
- name: null,
- // 打印份数
- printNumber: null,
- // 文件大小
- size: null,
- // 级别
- levelM: null,
- // 是否为彩打
- isPrintColor: null,
- // 是否为双面打
- isPrintTwo: null,
- });
- },
- // 删除对话框工作登记
- delForms(i) {
- this.tomList.splice(i, 1);
- },
- /** 查询集中文印主列表 */
- getList() {
- this.loading = true;
- listManage(this.queryParams).then((response) => {
- this.manageList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.reset();
- },
- dycancel() {
- this.dyopen = false;
- this.ramrk = false;
- this.dyreset();
- },
- // 表单重置
- reset() {
- this.form = {
- id: null,
- name: null,
- file: null,
- type: null,
- size: null,
- unitId: null,
- unitName: null,
- levelM: null,
- sendId: null,
- sendName: null,
- creattime: null,
- updatetime: null,
- explainInfo: null,
- printStatus: 0,
- receiveId: null,
- receiveName: null,
- sFile: null,
- printInfo: null,
- isReturn: null,
- printNumber: null,
- isPrintTwo: null,
- isPrintColor: null,
- printRoom: null,
- };
- this.resetForm("form");
- },
- // 表单重置
- dyreset() {
- this.dyform = {
- id: null,
- printName: null,
- printNumber: null,
- isReturn: null,
- printfileName: null,
- explainInfo: null,
- file: null,
- printId: null,
- statusG: null,
- isPrintTwo: null,
- isPrintColor: null,
- printRoom: null,
- };
- this.resetForm("dyform");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map((item) => item.id);
- this.single = selection.length !== 1;
- this.multiple = !selection.length;
- },
- /** 新增按钮操作 */
- handleAdd() {
- (this.tomList = [
- {
- // 文件名称
- name: null,
- // 打印份数
- printNumber: null,
- // 文件大小
- size: null,
- // 级别
- levelM: null,
- // 是否为彩打
- isPrintColor: null,
- // 是否为双面打
- isPrintTwo: null,
- },
- ]),
- (this.fileList = []);
- this.reset();
- this.open = true;
- this.title = "添加集中文印";
- this.form.sendName = Cookies.get("nickName");
- this.form.sendId = Cookies.get("userId");
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- // this.tomList=[]
- (this.tomList = [
- {
- // 文件名称
- name: null,
- // 打印份数
- printNumber: null,
- // 文件大小
- size: null,
- // 级别
- levelM: null,
- // 是否为彩打
- isPrintColor: null,
- // 是否为双面打
- isPrintTwo: null,
- isReturn: null,
- },
- ]),
- (this.fileList = []);
- this.reset();
- const id = row.id || this.ids;
- getManage(id).then((response) => {
- this.form1 = response.data;
- console.log(response);
- console.log(this.form1);
- this.form1.isPrintColor = response.data.isPrintColor + "";
- this.form1.isPrintTwo = response.data.isPrintTwo + "";
- // this.tomList[0].name=this.form.name
- // this.tomList[0].type=this.form.type
- // this.tomList[0].file=this.form.file
- // this.tomList[0].printNumber=this.form.printNumber
- // this.tomList[0].size=this.form.size
- // this.tomList[0].levelM=this.form.levelM
- // this.tomList[0].isPrintColor=this.form.isPrintColor
- // this.tomList[0].isPrintTwo=this.form.isPrintTwo
- this.open1 = true;
- this.title1 = "修改集中文印";
- });
- },
- // 修改提交
- updatesubmit() {
- this.$refs["form1"].validate((valid) => {
- if (valid) {
- updateManage(this.form1).then((response) => {
- this.$modal.msgSuccess("修改成功");
- this.open1 = false;
- this.getList();
- });
- }
- });
- },
- /** 提交按钮 */
- submitForm() {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- if (this.form.id != null) {
- updateManage(this.form).then((response) => {
- this.$modal.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- });
- } else {
- this.form.printsManageList = this.tomList;
- var num = 0;
- var num1 = this.tomList.length;
- for (let index = 0; index < this.tomList.length; index++) {
- if (
- this.tomList[index].levelM &&
- this.tomList[index].printNumber
- ) {
- num += 1;
- } else {
- return this.$modal.msgWarning("请选择级别,份数");
- }
- }
- // this.tomList.forEach((item,i)=>{
- // if(item.levelM){
- // num+=1
- // }else{
- // return this.$modal.msgWarning("请选择级别");
- // }
- // })
- if (num1 == num) {
- addManage(this.form).then((response) => {
- this.$modal.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
- }
- }
- }
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const ids = row.id || this.ids;
- this.$modal
- .confirm("是否确认删除该数据项?")
- .then(function () {
- return delManage(ids);
- })
- .then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- })
- .catch(() => {});
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams;
- this.$modal
- .confirm("是否确认导出所有集中文印主数据项?")
- .then(() => {
- this.exportLoading = true;
- return exportManage(queryParams);
- })
- .then((response) => {
- this.$download.name(response.msg);
- this.exportLoading = false;
- })
- .catch(() => {});
- },
- // 上传前校检格式和大小
- handleBeforeUpload(file) {
- // if (this.tomList.length > 1) {
- // console.log(this.tomList);
- // this.$message.error("上传失败, 请重试");
- // callback(new Error('请填写必填项'))
- // } else {
- // 校检文件类型
- this.tomLists.name = file.name;
- this.form1.name = file.name;
- if (file.size == 0) {
- this.tomLists.size = "0 B";
- this.form1.size = "0 B";
- }
- var k = 1024;
- var sizes = ["B", "KB", "MB", "GB", "TB", "EB", "ZB", "YB"];
- var i = Math.floor(Math.log(file.size) / Math.log(k));
- this.tomLists.size = file.size;
- this.form1.size = file.size;
- this.tomLists.size =
- (file.size / Math.pow(k, i)).toPrecision(3) + "" + sizes[i];
- this.form1.size =
- (file.size / Math.pow(k, i)).toPrecision(3) + "" + sizes[i];
- if (this.fileType) {
- let fileExtension = "";
- if (file.name.lastIndexOf(".") > -1) {
- fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
- this.tomLists.type = fileExtension;
- this.form1.type = fileExtension;
- }
- const isTypeOk = this.fileType.some((type) => {
- if (file.type.indexOf(type) > -1) return true;
- if (fileExtension && fileExtension.indexOf(type) > -1) return true;
- return false;
- });
- if (!isTypeOk) {
- this.$message.error(
- `文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`
- );
- this.tomLists.name = null;
- this.tomLists.size = null;
- this.tomLists.type = null;
- this.form1.name = null;
- this.form1.size = null;
- this.form1.type = null;
- return false;
- }
- }
- // 校检文件大小
- if (this.fileSize) {
- const isLt = file.size / 1024 / 1024 < this.fileSize;
- if (!isLt) {
- this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
- return false;
- }
- }
- return true;
- // }
- },
- // 文件个数超出
- handleExceed() {
- this.$message.error(`上传文件数量不能超过 ${this.limit} 个!`);
- },
- // 上传失败
- handleUploadError(err) {
- this.$message.error("上传失败, 请重试");
- },
- // 上传成功回调
- handleUploadSuccess(res, file) {
- this.$message.success("上传成功");
- this.fileList.push({
- name: file.name,
- file: res.url,
- size: this.tomLists.size,
- type: this.tomLists.type,
- });
- this.$emit("input", this.fileList);
- this.tomList = this.fileList;
- this.form1.file = res.url;
- // this.tomList.push(this.form)
- },
- //打印
- handlePrint(row) {
- this.dyreset();
- this.dyopen = true;
- this.title = "打印";
- this.dyform.printName = row.name;
- this.dyform.explainInfo = row.explainInfo;
- this.dyform.printId = row.id;
- this.dyform.file = row.file;
- this.dyform.statusG = 0;
- this.dyform.printfileName = row.sendName;
- this.dyform.printNumber = row.printNumber;
- this.dyform.printRoom = row.printRoom;
- this.dyform.type = row.type;
- this.dyform.isReturn = row.isReturn;
- this.dyform.isReturn = row.isReturn + "";
- if (row.isReturn == "1") {
- this.ramrk = false;
- }
- if (row.isReturn == "0") {
- this.ramrk = true;
- }
- if (row.isPrintColor == 1) {
- this.yaoqiu = "彩打";
- this.yaoqiuflg = true;
- }
- if (row.isPrintTwo == 1) {
- this.yaoqiuflg = true;
- if (this.yaoqiu) {
- this.yaoqiu += " 双面打";
- } else {
- this.yaoqiu = "双面打";
- }
- }
- if (row.isPrintTwo != 1 && row.isPrintColor != 1) {
- this.yaoqiuflg = false;
- }
- this.getrylist();
- },
- // 查看按钮预览
- handlelook(row) {
- if (row.type == "docx" || row.type == "doc") {
- this.open33 = true;
- axios({
- method: "get",
- responseType: "blob", // 设置响应文件格式
- url: row.file,
- }).then(({ data }) => {
- $(".docx").attr("id", "printArea");
- docx.renderAsync(data, this.$refs.file); // 渲染到页面预览
- });
- } else if (row.type == "pdf") {
- this.previewDialog = true;
- this.pdfurl = row.file;
- this.pageNum = 1;
- } else if (row.type == "xlsx") {
- axios
- .get(row.file, {
- responseType: "arraybuffer", // 设置响应体类型为arraybuffer
- })
- .then(({ data }) => {
- let workbook = XLSX.read(new Uint8Array(data), { type: "array" }); // 解析数据
- this.open44 = true;
- var worksheet = workbook.Sheets[workbook.SheetNames[0]]; // workbook.SheetNames 下存的是该文件每个工作表名字,这里取出第一个工作表
- this.tableau = XLSX.utils.sheet_to_html(worksheet); // 渲染
- });
- }
- },
- // 预览弹框
- submitForm3() {
- this.open33 = false;
- },
- //获取人员
- getrylist() {
- listPeople().then((res) => {
- if (res.code == 200) {
- this.rylist = res.rows;
- }
- });
- },
- //打印提交
- dysubmitForm() {
- this.$refs["dyform"].validate((valid) => {
- if (valid) {
- if (this.dyform.isReturn == 0) {
- this.dyform.statusG = 1;
- } else {
- this.dyform.statusG = 0;
- }
- printCode(this.dyform).then((res) => {
- if (res.code == 200) {
- if (this.dyform.type == "pdf") {
- // let blob = new Blob([res]);
- // let objectUrl = URL.createObjectURL(blob);
- // let link = document.createElement("a");
- // link.download =this.dyform.file;
- // link.href = objectUrl;
- // link.click();
- // link.remove();
- let xhr = new XMLHttpRequest();
- xhr.open(
- "get",
- process.env.VUE_APP_BASE_API +
- "/profile/print/" +
- res.printFileName,
- true
- );
- xhr.setRequestHeader("Content-Type", `application/pdf`);
- xhr.responseType = "blob";
- let that = this;
- xhr.onload = function () {
- if (this.status == 200) {
- //接受二进制文件流
- var blob = this.response;
- // that.downloadExportFile(blob, fileName);
- let downloadElement = document.createElement("a");
- let href = blob;
- if (typeof blob == "string") {
- downloadElement.target = "_blank";
- } else {
- href = window.URL.createObjectURL(blob); //创建下载的链接
- }
- downloadElement.href = href;
- downloadElement.download = that.dyform.printName;
- // tagFileName +
- //下载后文件名
- document.body.appendChild(downloadElement);
- downloadElement.click(); //点击下载
- document.body.removeChild(downloadElement); //下载完成移除元素
- if (typeof blob != "string") {
- window.URL.revokeObjectURL(href); //释放掉blob对象
- }
- }
- };
- xhr.send();
- this.dyopen = false;
- this.ramrk = false;
- this.getList();
- } else {
- let downloadElement = document.createElement("a");
- downloadElement.href =
- process.env.VUE_APP_BASE_API +
- "/profile/print/" +
- res.printFileName;
- downloadElement.download = this.dyform.printName;
- document.body.appendChild(downloadElement);
- downloadElement.click(); //点击下载
- document.body.removeChild(downloadElement);
- this.dyopen = false;
- this.ramrk = false;
- this.printshow = true;
- this.getList();
- }
- // var open=window.open();
- // location.href =res.file;
- }
- });
- }
- });
- // open.location.href="http://192.168.5.188:8080/priofile/print/202203211244.docx";
- // window.open( `https://view.officeapps.live.com/op/view.aspx?src=http://192.168.5.188:8080/profile/print/202203211428.docx`, "_blank");
- },
- // 确定
- handleok(row) {
- // this.dyform.printName = row.name;
- // this.dyform.explainInfo = row.explainInfo;
- // this.dyform.printId = row.id;
- // this.dyform.file = row.file;
- // this.dyform.statusG = 0;
- // this.dyform.printfileName = row.sendName;
- // this.dyform.printNumber = row.printNumber;
- // this.dyform.printRoom = row.printRoom;
- // this.dyform.type = row.type;
- this.printManage = row;
- tkbox(this.printManage).then((res) => {
- this.printshow = false;
- this.getList();
- });
- },
- /**
- * 预览PDF
- */
- previewPDF(row, index) {
- this.previewDialog = true;
- },
- // 上一页函数,
- prePage() {
- this.gopage = true;
- var page = this.pageNum;
- page = page > 1 ? page - 1 : this.pageTotalNum;
- this.pageNum = page;
- },
- // 下一页函数
- nextPage() {
- this.gopage = false;
- var page = this.pageNum;
- page = page < this.pageTotalNum ? page + 1 : 1;
- this.pageNum = page;
- },
- // 页面顺时针翻转90度。
- clock() {
- this.pageRotate += 90;
- },
- // 页面逆时针翻转90度。
- counterClock() {
- this.pageRotate -= 90;
- },
- // 页面加载回调函数,其中e为当前页数
- pageLoaded(e) {
- this.curPageNum = e;
- },
- // 错误时回调函数。
- pdfError(error) {
- console.error(error);
- },
- // 打印全部
- pdfPrintAll() {
- /**
- * 打印界面字符乱码是因为你pdf中使用了自定义字体导致的,谷歌浏览器打印的时候预览界面真的变成了真·方块字 ,解决方案如下:
- * 用文章最后的pdfjsWrapper.js在替换掉node_modules/vue-pdf/src/pdfjsWrapper.js
- */
- this.$refs.pdf.print();
- },
- },
- };
- </script>
- <style scoped>
- ::v-deep .el-dialog {
- background-color: #004d86;
- }
- ::v-deep .el-dialog__header {
- border-bottom: 1px solid #718a9d;
- }
- ::v-deep .el-dialog__title {
- color: #fff;
- font: 18px;
- }
- ::v-deep .el-dialog__headerbtn .el-dialog__close {
- color: #fff;
- }
- .el-form-item ::v-deep .el-input__inner {
- width: 200px;
- height: 36px;
- background: transparent;
- color: #fff;
- border: 1px solid #fff !important;
- }
- ::v-deep .el-date-editor.el-input {
- width: 200px;
- height: 36px;
- }
- .pictureUploading-img img {
- width: 60px;
- height: 210px;
- margin-right: 10px;
- }
- ::v-deep .el-upload--picture-card {
- height: 210px;
- width: 170px;
- line-height: 210px;
- background-image: url("../../../assets/images/头像.png");
- background-repeat: no-repeat;
- background-size: 100% 100%;
- }
- ::v-deep .el-upload--picture-card .el-icon-plus {
- display: none;
- }
- .el-upload--picture-card /deep/ .el-upload--picture-card i {
- font-size: 48px;
- }
- ::v-deep .el-upload__tip {
- display: none;
- }
- ::v-deep .textarea-explainInfo .el-textarea__inner {
- margin-left: 20px;
- width: 880px;
- height: 104px;
- }
- ::v-deep .textarea-explainInfo1 .el-textarea__inner {
- /* margin-left: 20px; */
- width: 833px;
- height: 104px;
- }
- ::v-deep .dyform-textarea .el-textarea__inner {
- width: 650px;
- height: 64px;
- }
- .jiben2 {
- width: 650px;
- }
- .jiben span {
- width: 25px;
- height: 25px;
- display: inline-block;
- background-color: #1c86e1;
- line-height: 25px;
- text-align: center;
- font-size: 16px;
- cursor: pointer;
- /* margin-left: 851px; */
- position: absolute;
- right: 20px;
- }
- .el-select-dropdown__item:hover {
- color: #1c86e1;
- }
- .el-select-dropdown__item {
- color: #000;
- }
- .el-tree {
- background-color: #00365f;
- color: #fff;
- }
- ::v-deep .el-tree-node__content:hover {
- color: #1c86e1;
- }
- ::v-deep .el-upload-list--picture-card .el-upload-list__item {
- height: 210px;
- width: 170px;
- }
- .dadui {
- height: 40px;
- background: #003156;
- /* border-bottom: 1px solid #718A9D ; */
- background-image: url(../../../images/矩形底部边框.png);
- background-repeat: no-repeat;
- background-position: 0px 39px;
- font-size: 16px;
- color: #1d96ff;
- }
- .dadui img {
- margin: 10px 10px 0px 10px;
- }
- .data {
- height: 40px;
- background: #003156;
- margin-bottom: 12px;
- color: #fff;
- display: flex;
- font-size: 13px;
- line-height: 25px;
- position: relative;
- }
- .el-tree {
- padding: 10px;
- background: #003156;
- color: #fff;
- }
- .data p {
- position: absolute;
- top: -5px;
- left: 15px;
- }
- .data .a1 {
- width: 128px;
- height: 26px;
- background: rgba(23, 74, 112, 0.4);
- border-radius: 13px;
- position: absolute;
- top: 7px;
- left: 60px;
- }
- ::v-deep .data .el-date-editor.el-input {
- width: 100%;
- border: none;
- }
- ::v-deep .data .el-input__inner {
- width: 100% !important;
- border: none;
- }
- ::v-deep .data .el-input--medium .el-input__icon {
- line-height: 36px;
- position: absolute;
- right: -223px;
- top: 2px;
- }
- ::v-deep .data .el-input__inner {
- background-color: transparent;
- color: #fff;
- text-align: center;
- margin-top: 2px;
- }
- ::v-deep .data .el-input__suffix {
- position: absolute;
- right: 281px;
- }
- ::v-deep
- .el-tree--highlight-current
- .el-tree-node.is-current
- > .el-tree-node__content {
- color: #00365f !important;
- /* background-color: #003156 !important; */
- }
- ::v-deep .el-radio-group .el-radio {
- color: #fff;
- }
- /* ::v-deep .el-radio:last-child {
- margin-left: 35px;
- } */
- /* 调整输入框提示文字颜色 */
- ::v-deep .vue-treeselect__placeholder {
- color: #bdbdbd4f !important;
- }
- ::v-deep input::-webkit-input-placeholder {
- color: #bdbdbd4f !important;
- }
- ::v-deep input:-moz-placeholder {
- color: #bdbdbd4f !important;
- }
- /* 文本域提示文字颜色 */
- ::v-deep ::-webkit-input-placeholder {
- color: #bdbdbd4f !important;
- }
- ::v-deep .el-dialog__footer {
- padding-right: 30px !important;
- }
- ::v-deep .el-input__inner {
- border: 1px solid white !important;
- }
- /* 预览弹框背景去除 */
- ::v-deep .docx-wrapper {
- padding: 0 !important;
- background: none !important;
- }
- /* excel表格样式 */
- ::v-deep .home table tr td {
- text-align: right;
- height: 20px;
- min-width: 60px;
- text-align: center;
- /* margin-left: -5px ; */
- /* width: 70px !important; */
- border-right: 1px solid black;
- border-bottom: 1px solid black !important;
- }
- ::v-deep .home table {
- width: 100%;
- border-spacing: 0px !important;
- border-top: 1px solid black;
- border-left: 1px solid black;
- /* border-collapse: collapse !important;
- border-color:#b6ff00 !important; */
- }
- ::v-deep .docx-wrapper table tr td {
- border-bottom: 1px solid black !important;
- }
- ::v-deep .docx {
- width: 100% !important;
- }
- /* 文件关闭小叉号 */
- ::v-deep .el-dialog__headerbtn .el-dialog__close {
- color: #ccc !important;
- }
- /* 上一页样式 */
- .gopage {
- width: 60px;
- height: 28px;
- background: #f4f4f4;
- color: #60627d;
- border-radius: 14px 0px 0px 14px;
- padding: 6px 9px;
- }
- /* 下一页样式 */
- .downpage {
- width: 60px;
- height: 28px;
- background: #f4f4f4;
- border-radius: 0px 14px 14px 0px;
- padding: 6px 9px;
- }
- .bg {
- background: #1d96ff;
- color: white;
- }
- .greed {
- position: absolute;
- top: 26px;
- right: -10px;
- color: #13ce66;
- }
- .CCC {
- position: absolute;
- top: 26px;
- right: 118px;
- color: #cccccc;
- }
- /* 文件名称表格 */
- ::v-deep .fileName .el-input__inner {
- width: 316px !important;
- text-indent: 1em;
- /* background-color: #196299; */
- }
- ::v-deep .fileName .el-input__suffix {
- left: -280px;
- }
- </style>
|