123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545 |
- <template>
- <div class="app-container">
- <el-form
- :model="queryParams"
- ref="queryForm"
- size="small"
- :inline="true"
- v-show="showSearch"
- >
- <el-form-item label="保税区">
- <el-select v-model="queryParams.deptId" placeholder="请选择保税区">
- <el-option
- v-for="item in regionList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="采集状态" prop="collStatus">
- <el-select
- v-model="queryParams.collStatus"
- placeholder="请选择采集状态"
- clearable
- filterable
- class="se"
- >
- <el-option
- v-for="dict in collStatus"
- :key="dict.value + 'collStatus'"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="上报状态" prop="reportStatus">
- <el-select
- v-model="queryParams.reportStatus"
- placeholder="请选择上报状态"
- clearable
- filterable
- class="se"
- >
- <el-option
- v-for="dict in reportStatus"
- :key="dict.value + 'reportStatus'"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="审核状态" prop="approveStatus">
- <el-select
- v-model="queryParams.approveStatus"
- placeholder="请选择审核状态"
- clearable
- filterable
- class="se"
- >
- <el-option
- v-for="(dict, index) in approveStatus"
- :key="dict.value + 'approveStatus'"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="年度" prop="year">
- <el-date-picker
- v-model="queryParams.year"
- type="year"
- format="yyyy"
- value-format="yyyy"
- placeholder="选择年度"
- class="se"
- ></el-date-picker>
- </el-form-item>
- <el-form-item label="月份" prop="month">
- <el-select v-model="queryParams.month" placeholder="请选择月份">
- <el-option
- v-for="item in monthOpt"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="el-icon-search" @click="handleQuery"
- >搜索</el-button
- >
- <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="success"
- v-hasPermi="['gather:GATHER:upload']"
- @click="onOpenDialog('old')"
- >历史数据导入</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="success"
- v-hasPermi="['gather:GATHER:uploadnew']"
- @click="onOpenDialog('new')"
- >导入</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-button
- @click="handleDownload()"
- v-hasPermi="['gather:GATHER:download']"
- :title="radio === '' ? '请先选择下面对应的单位模板' : ''"
- :disabled="radio === '' ? true : false"
- >下载导入模板</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- plain
- @click="importFile({ type: '0', mark: '1' }, '海关部分贸易导入')"
- v-hasPermi="['gather:GATHER:customsMrak']"
- >海关部分贸易导入</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- plain
- @click="importFile({ type: '0', mark: '2' }, '海关进出口总值导入')"
- v-hasPermi="['gather:GATHER:customs']"
- >海关进出口总值导入</el-button
- >
- </el-col>
- <right-toolbar
- :showSearch.sync="showSearch"
- @queryTable="getList"
- ></right-toolbar>
- </el-row>
- <el-table
- :data="GATHERList"
- @selection-change="handleSelectionChange"
- @row-click="showRow"
- >
- <!-- @current-change="handleCurrentChange" -->
- <el-table-column label="选择" fixed="left" width="70" center>
- <template scope="scope">
- <el-radio
- class="radio"
- v-model="radio"
- :label="scope.$index"
- @change.native="getCurrentRow(scope.row)"
- >{{ "" }}</el-radio
- >
- </template>
- </el-table-column>
- <!-- <el-table-column type="selection" width="55" align="center" /> -->
- <el-table-column label="综保区名称" fixed width="150" align="center" prop="deptId_dictText">
- <template slot-scope="scope">
- {{ scope.row.deptId_dictText }}
- </template>
- </el-table-column>
- <!-- <el-table-column label="数据类型" width="140" align="center" prop="type">-->
- <!-- <template slot-scope="scope">-->
- <!-- <span v-if="scope.row.type == 0">量化指标数据</span>-->
- <!-- <span v-if="scope.row.type == 1">月报表数据</span>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <el-table-column label="年份" align="center" prop="month">
- <template slot-scope="scope">
- {{ scope.row.year }}
- </template>
- </el-table-column>
- <el-table-column label="月份" align="center" prop="month">
- <template slot-scope="scope">
- {{ "01-" + scope.row.month }}
- </template>
- </el-table-column>
- <el-table-column label="采集状态" align="center" prop="collStatus">
- <template slot-scope="scope">
- <span v-if="scope.row.collStatus == 0">未采集</span>
- <span v-if="scope.row.collStatus == 1">已采集</span>
- <span v-if="scope.row.collStatus == 2">草稿</span>
- </template>
- </el-table-column>
- <el-table-column
- label="采集人"
- align="center"
- prop="collName"
- width="110"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.collName }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="采集时间"
- align="center"
- prop="collTime"
- width="160"
- >
- </el-table-column>
- <el-table-column label="上报状态" align="center" prop="reportStatus">
- <template slot-scope="scope">
- <span v-if="scope.row.reportStatus == 0">未上报</span>
- <span v-if="scope.row.reportStatus == 1">已上报</span>
- </template>
- </el-table-column>
- <el-table-column
- label="上报人"
- align="center"
- prop="reportName"
- width="160"
- />
- <el-table-column
- width="160"
- label="上报时间"
- align="center"
- prop="reportTime"
- />
- <el-table-column
- label="审核人"
- align="center"
- prop="approveName"
- width="160"
- />
- <el-table-column
- label="审核时间"
- align="center"
- prop="approveTime"
- width="160"
- />
- <el-table-column label="审核状态" align="center" prop="approveStatus">
- <template slot-scope="scope">
- <span>{{
- scope.row.approveStatus == 0
- ? "未审核"
- : scope.row.approveStatus == 1
- ? "审核中"
- : scope.row.approveStatus == 2
- ? "审核通过"
- : "审核拒绝"
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="驳回时间"
- align="center"
- prop="collTime"
- width="160"
- >
- </el-table-column>
- <el-table-column
- label="驳回姓名"
- align="center"
- prop="approveName"
- width="160"
- >
- </el-table-column>
- <el-table-column
- label="操作"
- align="center"
- fixed="right"
- width="220"
- class-name="small-padding fixed-width"
- >
- <template slot-scope="scope">
- <template
- v-if="
- scope.row.collStatus == 0 && checkPermi(['gather:GATHER:typein'])
- "
- >
- <el-button
- style="margin: 0 2px"
- size="mini"
- type="text"
- @click="handleUpdate(scope.row)"
- >录入</el-button
- >
- </template>
- <template
- v-if="scope.row.reportStatus == 1
- && checkPermi(['gather:GATHER:admin'])"
- >
- <el-button
- style="margin: 0 2px"
- size="mini"
- type="text"
- @click="handleWbEdit(scope.row)"
- >湾办修改</el-button
- >
- </template>
- <template
- v-if="(scope.row.collStatus == 0 || scope.row.collStatus == 1||scope.row.collStatus == 2) && (scope.row.approveStatus == 0 || scope.row.approveStatus == 3)
- && checkPermi(['gather:GATHER:admin'])"
- >
- <el-button
- style="margin: 0 2px"
- size="mini"
- type="text"
- @click="handleUpdate(scope.row)"
- >湾办录入</el-button
- >
- </template>
- <template
- v-if="
- scope.row.collStatus == 1 &&
- (scope.row.approveStatus == 0 || scope.row.approveStatus == 3) &&
- checkPermi(['gather:GATHER:approve'])
- "
- >
- <el-button
- @click="handleDetail(scope.row,3)"
- style="margin: 0 2px"
- size="mini"
- type="text"
- slot="reference"
- >提交审核</el-button
- >
- </template>
- <template
- v-if="
- scope.row.collStatus == 1 &&
- (scope.row.reportStatus == 0 || scope.row.reportStatus == null) &&
- scope.row.approveStatus == 2 &&
- checkPermi(['gather:GATHER:report'])
- "
- >
- <el-popconfirm
- title="确定上报吗?"
- @confirm="handleReport(scope.row)"
- >
- <el-button
- style="margin: 0 2px"
- size="mini"
- slot="reference"
- type="text"
- >上报</el-button
- >
- </el-popconfirm>
- </template>
- <el-button
- v-if="scope.row.collStatus == 1"
- style="margin: 0 2px"
- size="mini"
- type="text"
- @click="handleDetail(scope.row, 0)"
- >查看</el-button
- >
- <!-- {{scope.row.collStatus}}--{{scope.row.approveStatus}} -->
- <el-button
- style="margin: 0 2px"
- v-if="
- scope.row.collStatus == 2 &&
- (scope.row.approveStatus == 0 || scope.row.approveStatus == 3) &&
- checkPermi(['gather:GATHER:edit']) // 编辑权限
- "
- size="mini"
- type="text"
- @click="handleDetail(scope.row, 1)"
- >确定</el-button
- >
- <el-button
- style="margin: 0 2px"
- v-if="
- (scope.row.collStatus == 1 || scope.row.collStatus == 2) &&
- (scope.row.approveStatus == 0 || scope.row.approveStatus == 3) &&
- checkPermi(['gather:GATHER:edit']) // 编辑权限
- "
- size="mini"
- type="text"
- @click="handleDetail(scope.row, 1)"
- >修改</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
- center
- title="导入"
- :visible.sync="openUpload"
- width="50%"
- append-to-body
- :close-on-click-modal="false"
- >
- <el-form
- ref="uploadForm"
- :model="uploadForm"
- :rules="rules"
- label-width="120px"
- >
- <el-form-item label="文件" prop="linkUrl">
- <el-upload
- class="upload-demo"
- ref="upload"
- action="#"
- :http-request="httprequest"
- :before-upload="uploadFile"
- :file-list="fileList"
- :auto-upload="false"
- :limit="1"
- >
- <el-button slot="trigger" size="small" type="primary"
- >选取文件</el-button
- >
- </el-upload>
- </el-form-item>
- <div class="tips-text">
- <span class="tit">提示</span>
- <p>1.请先下载对应单位名称模板;</p>
- <p>2.上传前,请先检查数据的完整性;</p>
- </div>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitUpload">导 入</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 录入数据采集对话框 -->
- <el-dialog
- center
- :title="title"
- :visible.sync="open"
- width="1080px"
- append-to-body
- :close-on-click-modal="false"
- >
- <div
- v-for="(item, index) in tabList"
- :key="index + 'tabs'"
- :label="item.normName"
- :name="item.normName"
- >
- <el-col :span="24"
- style=" margin-bottom: 5px; padding: 4px;"
- >
- <!-- <p style="font-weight: 600;margin:0;margin-bottom: 5px; font-size: 17px;">{{ item.normName }}</p>-->
- <el-divider content-position="left" ><span style="font-weight: bold; font-size: 16px">{{ item.normName }}</span></el-divider>
- <template v-for="listItem in form.feeLists">
- <el-form
- v-if="listItem.normId == item.normId"
- :rules="
- validatorList(
- listItem.normfeeCode,
- listItem.normfeeName,
- listItem.sendValue
- )
- "
- :model="listItem"
- :ref="'form' + listItem.normfeeId"
- :key="listItem.normfeeId"
- :disabled="listItem.sendValue == 1 || (listItem.sendValue == undefined)"
- label-width="360px"
- >
- <el-col :span="12">
- <el-form-item
- style="padding:10px;"
- :label="
- listItem.normfeeName + '(' + listItem.funitName + ')'
- "
- prop="collCalue"
- >
- <el-input
- size="small"
- v-model="listItem.collCalue"
- style="width: 150px"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-form>
- </template>
- </el-col>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button v-if="checkPermi(['gather:GATHER:add'])" type="primary" @click="submitForm('add')">确 定</el-button>
- <el-button v-if="this.form.collStatus!=1 &&checkPermi(['gather:GATHER:draft'])" @click="submitForm('draft')" type="warning">暂 存</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 查看或修改 -->
- <el-dialog
- center
- @close="handleClose"
- :title="title"
- :visible.sync="openDetail"
- width="95%"
- append-to-body
- :close-on-click-modal="false"
- >
- <div
- v-for="(item, index) in tabList"
- :key="index + 'tabs'"
- :label="item.normName"
- :name="item.normName"
- >
- <el-col :span="24"
- style="border:1px solid rgba(0, 0, 0, .05); margin-bottom: 5px; padding: 4px;border-radius: 10px"
- >
- <p style="font-weight: 600;margin:0; margin-bottom: 5px; font-size: 17px;">{{ item.normName }}</p>
- <template v-for="listItem in form.feeLists">
- <el-form
- v-if="listItem.normId == item.normId"
- :rules="
- validatorList(
- listItem.normfeeCode,
- listItem.normfeeName,
- listItem.sendValue
- )
- "
- :model="listItem"
- :ref="'form' + listItem.normfeeId"
- :key="listItem.normfeeId"
- :disabled="listItem.sendValue == 1 || listItem.sendValue == undefined"
- :label-width="(index == 1 || index == 3) ? '350px' : '250px'"
- >
- <el-col :span="8">
- <el-form-item
- style="padding:10px;"
- :label="
- listItem.normfeeName + '(' + listItem.funitName + ')'
- "
- prop="collCalue"
- >
- <el-input
- :disabled="!edit"
- v-if="edit == true"
- v-model="listItem.collCalue"
- :placeholder="'请输入' + listItem.normfeeName"
- ></el-input>
- <div v-if="edit == false" style="background-color: rgba(0, 0, 0, .03); padding-left: 5px;" >{{ listItem.collCalue || listItem.collCalue == 0 ? listItem.collCalue :"请输入" }}</div>
- </el-form-item>
- </el-col>
- </el-form>
- </template>
- </el-col>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button v-if="audit && (this.form.collStatus != 2 && this.form.collStatus==1)" type="primary" @click="handleAudit(form)">提交审核</el-button>
- <el-button type="primary" @click="submitForm('edit')" v-if="edit && isEdit"
- >确 定</el-button
- >
- <el-button @click="submitForm('draft')" v-if="edit && this.form.collStatus!=1" type="warning">暂 存</el-button>
- <el-button type="primary" v-if="check" @click="handleCheck(1)"
- >通 过</el-button
- >
- <el-button type="warning" v-if="check" @click="handleReject"
- >驳 回</el-button
- >
- <el-button type="primary" @click="cancel">返 回</el-button>
- </div>
- <div class="remark" v-if="form.taskVoList != 0">
- <div class="remark_title" style="margin-bottom: 20px">审批记录:</div>
- <el-timeline>
- <el-timeline-item
- v-for="(item, index) in form.taskVoList"
- :timestamp="item.createTime"
- placement="top"
- :key="index + 'taskHisAction'"
- >
- <el-card>
- <p>
- {{ item.execName }}------{{
- item.status == 0
- ? "待审核"
- : item.status == 1
- ? "同意"
- : item.status == 2
- ? "驳回"
- : "退回"
- }}------{{ item.acname }}------{{ item.createTime }}
- <p v-if="item.comments != null">{{
- "审核意见:" + item.comments
- }}</p>
- </p>
- </el-card>
- </el-timeline-item>
- </el-timeline>
- </div>
- </el-dialog>
- <!-- 湾办录入 -->
- <el-dialog
- center
- @close="handleClose"
- :title="title"
- :visible.sync="wbopenDetail"
- width="95%"
- append-to-body
- :close-on-click-modal="false"
- >
- <div
- v-for="(item, index) in tabList"
- :key="index + 'tabs'"
- :label="item.normName"
- :name="item.normName"
- >
- <el-col :span="24"
- style="border:1px solid rgba(0, 0, 0, .05); margin-bottom: 5px; padding: 4px"
- >
- <p style="font-weight: 600;margin:0; margin-bottom: 5px; font-size: 17px;">{{ item.normName }}</p>
- <template v-for="listItem in form.feeLists">
- <el-form
- v-if="listItem.normId == item.normId"
- :rules="
- validatorList(
- listItem.normfeeCode,
- listItem.normfeeName,
- listItem.sendValue
- )
- "
- :model="listItem"
- :ref="'form' + listItem.normfeeId"
- :key="listItem.normfeeId"
- :disabled="!checkPermi(['gather:GATHER:adminedit'])"
- :label-width="(index == 1 || index == 3) ? '350px' : '250px'"
- >
- <el-col :span="8">
- <el-form-item
- style="padding:10px;"
- :label="
- listItem.normfeeName + '(' + listItem.funitName + ')'
- "
- prop="collCalue"
- >
- <el-input
- :disabled="false"
- v-model="listItem.collCalue"
- :placeholder="'请输入' + listItem.normfeeName"
- ></el-input>
- <!-- <div v-if="edit == false" style="background-color: rgba(0, 0, 0, .03); padding-left: 5px;" >{{ listItem.collCalue || listItem.collCalue == 0 ? listItem.collCalue :"请输入" }}</div> -->
- </el-form-item>
- </el-col>
- </el-form>
- </template>
- </el-col>
- </div>
- <div slot="footer" class="dialog-footer">
- <!-- <el-button v-if="audit && (this.form.collStatus != 2 && this.form.collStatus==1)" type="primary" @click="handleAudit(form)">提交审核</el-button> -->
- <el-button type="primary" @click="submitForm('edit',1)"
- >确 定</el-button
- >
- <!-- <el-button @click="submitForm('draft')" v-if="edit && this.form.collStatus!=1" type="warning">暂 存</el-button>
- <el-button type="primary" v-if="check" @click="handleCheck(1)"
- >通 过</el-button
- >
- <el-button type="warning" v-if="check" @click="handleReject"
- >驳 回</el-button
- > -->
- <el-button @click="cancel">返 回</el-button>
- </div>
- <div class="remark" v-if="form.taskVoList != 0">
- <div class="remark_title" style="margin-bottom: 20px">审批记录:</div>
- <el-timeline>
- <el-timeline-item
- v-for="(item, index) in form.taskVoList"
- :timestamp="item.createTime"
- placement="top"
- :key="index + 'taskHisAction'"
- >
- <el-card>
- <p>
- {{ item.execName }}------{{
- item.status == 0
- ? "待审核"
- : item.status == 1
- ? "同意"
- : item.status == 2
- ? "驳回"
- : "退回"
- }}------{{ item.acname }}------{{ item.createTime }}
- <p v-if="item.comments != null">{{
- "审核意见:" + item.comments
- }}</p>
- </p>
- </el-card>
- </el-timeline-item>
- </el-timeline>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- compute,
- listGATHER,
- getGATHER,
- delGATHER,
- addGATHER,
- updateGATHER,
- wbUpdateGATHER,
- getInfoByColl,
- approve,
- report,
- setAudit,
- download,
- upload,
- uploadnew,
- bsqAudit,
- } from "@/api/portal/GATHER/GATHER.js";
- import importFile from "./importFile.vue";
- import { saveAs } from "file-saver";
- import { getToken } from "@/utils/auth";
- import axios from "axios";
- import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
- import { bondedList } from "@/api/portal/figure/figure.js";
- export default {
- name: "GATHER",
- data() {
- return {
- // 提交审核按钮
- audit:false,
- isEdit:true,
- monthOpt: [{
- value: '01',
- label: '1月'
- }, {
- value: '02',
- label: '2月'
- }, {
- value: '03',
- label: '3月'
- }, {
- value: '04',
- label: '4月'
- }, {
- value: '05',
- label: '5月'
- }, {
- value: '06',
- label: '6月'
- }, {
- value: '07',
- label: '7月'
- }, {
- value: '08',
- label: '8月'
- }, {
- value: '09',
- label: '9月'
- }, {
- value: '10',
- label: '10月'
- }, {
- value: '11',
- label: '11月'
- }, {
- value: '12',
- label: '12月'
- }
- ],
- // 部门名称
- deptName:"",
- // 审核、驳回
- check: false,
- // 数据id
- dataId: null,
- edit: true, //false 查看 true修改
- tabList: [],
- feeLists: [],
- activeName: "",
- //数据类型(0=量化指标数据,1=月报表数据)
- typeList: [
- { label: "量化指标数据", value: "0" },
- { label: "月报表数据", value: "1" },
- ],
- //采集状态(0=未采集,1=已采集)
- collStatus: [
- { label: "未采集", value: "0" },
- { label: "已采集", value: "1" },
- ],
- //上报状态(0=未上报,=1已上报)
- reportStatus: [
- { label: "未上报", value: "0" },
- { label: "已上报", value: "1" },
- ],
- //审核状态(0=未审核,1审核中,2=审核通过,3=审核拒绝)
- approveStatus: [
- { label: "未审核", value: "0" },
- { label: "审核中", value: "1" },
- { label: "审核通过", value: "2" },
- { label: "审核拒绝", value: "3" },
- ],
- // 根路径
- baseURL: process.env.VUE_APP_BASE_API,
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 数据采集表格数据
- GATHERList: [],
- load: true,
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- openDetail: false,
- wbopenDetail: false,
- // 查询参数
- queryParams: {
- deptId: "",
- pageNum: 1,
- pageSize: 10,
- id: null,
- createTime: null,
- createBy: null,
- updateTime: null,
- updateBy: null,
- delFlag: null,
- type: null,
- year: null,
- month: null,
- collStatus: null,
- reportStatus: null,
- approveStatus: null,
- audit: null,
- },
- regionList: [], //保税区列表
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- // id: [{ required: true, message: "$comment不能为空", trigger: "blur" }],
- collCalue: [
- { required: true, message: "不能为空", trigger: "blur" },
- { trigger: "blur", validator: this.validatorFloatNum },
- ],
- },
- rulesOne: {},
- //设置文件名字
- setFileName: "",
- radio: "",
- rowData: {},
- fileList: [],
- uploadForm: {},
- openUpload: false,
- uploadFileType: "old", // old、new
- };
- },
- created() {
- this.getList();
- this.bondedList();
- },
- methods: {
- checkPermi,
- checkRole,
- // 下面这个validatorNum写重复了吗?
- // validatorNum(rule, value, callback) {},
- validatorFloatNum(rule, value, callback) {
- let reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g;
- if (!reg.test(value)) {
- callback(new Error("请输入数字和正确格式的数字"));
- } else if (typeof value == "string" && value.split(".").length > 2) {
- callback(new Error("请输入正确格式的数字")); //防止输入多个小数点
- }
- // else if (value.indexOf('.') != -1 && value.split('.')[1].length > 2) {
- // callback(new Error('最多只能输入两位小数')); //小数点后两位
- // }
- else {
- callback();
- }
- },
- validatorNum(rule, value, callback) {
- let reg = /^[+]?(0|([1-9]\d*))(\.\d+)?$/g;
- if (!reg.test(value)) {
- callback(new Error("请输入正数和正确格式的数字"));
- } else if (typeof value == "string" && value.split(".").length > 2) {
- callback(new Error("请输入正确格式的数字")); //防止输入多个小数点
- }
- // else if (value.indexOf('.') != -1 && value.split('.')[1].length > 2) {
- // callback(new Error('最多只能输入两位小数')); //小数点后两位
- // }
- else {
- callback();
- }
- },
- validatorList(code, name, sendValue) {
- if (typeof name != "string") return;
- if (sendValue == 1) return;
- // if (
- // code == "A001" ||
- // code == "A002" ||
- // code == "A003" ||
- // code == "A004" ||
- // code == "A005" ||
- // code == "A006" ||
- // code == "A007" ||
- // code == "A008" ||
- // code == "C002" ||
- // code == "C003" ||
- // code == "D001" ||
- // code == "E001" ||
- // code == "E002" ||
- // code == "E003" ||
- // code == "E004" ||
- // code == "F001" ||
- // code == "F002"
- // ) {
- return {
- collCalue: [
- { required: true, message: "不能为空", trigger: "blur" },
- { trigger: "blur", validator: this.validatorFloatNum },
- ],
- };
- // } else if (code == "A009" || code == "A010") {
- // return {
- // collCalue: [
- // { required: true, message: "不能为空", trigger: "blur" },
- // { pattern: /^[1-9]\d*$/, message: "请输入正整数", trigger: "blur" },
- // ],
- // };
- // }
- },
- importFile(param, title) {
- let img = param.mark == "1" ? "@/assets/images/portion.png" : "@/assets/images/sum.png";
- param.img = img;
- this.iframe({
- obj: importFile,
- param: param,
- title: title,
- width: "500px",
- height: "50%",
- });
- },
- submitUpload() {
- this.$refs.upload.submit();
- },
- httprequest() {},
- getCurrentRow(val) {
- },
- // 获取保税区列表
- bondedList() {
- this.regionList = [];
- bondedList().then((res) => {
- for (const i in res.data) {
- this.regionList.push({
- label: res.data[i].deptName,
- value: res.data[i].deptId,
- });
- }
- });
- },
- handleCurrentChange(val, index) {
- this.currentRow = val;
- this.$emit("data", val.pkg);
- },
- handleChange(file, fileList) {
- this.fileList = fileList.slice(-3);
- },
- showRow(row) {
- //赋值给radio
- this.radio = this.GATHERList.indexOf(row);
- this.rowData = row;
- },
- handleClose() {
- this.check = false;
- },
- /**
- * 打开上传弹窗
- * @params string type old/new
- */
- onOpenDialog(type) {
- this.uploadFileType = type;
- this.openUpload = true;
- },
- //导入
- uploadFile(file) {
- let formData = new FormData();
- formData.append("file", file);
- formData.append("type", this.uploadForm.type);
- if (this.uploadFileType === "old") {
- upload(formData).then((res) => {
- this.$modal.msgSuccess("上传采集附件成功!");
- this.getList();
- this.cancel();
- this.openUpload = false;
- });
- } else {
- uploadnew(formData).then((res) => {
- this.$modal.msgSuccess("上传采集附件成功!");
- this.getList();
- this.cancel();
- this.openUpload = false;
- });
- }
- },
- //下载模板
- handleDownload() {
- let row = this.rowData;
- axios({
- url: process.env.VUE_APP_BASE_API + "/gather/download/" + row.id,
- method: "get",
- responseType: "blob",
- headers: {
- Authorization: "Bearer " + getToken(),
- },
- }).then((res) => {
- const temp = res.headers["content-disposition"]
- .split(";")[1]
- .split("filename=")[1];
- const fileName = decodeURIComponent(temp);
- const blob = new Blob([res.data]);
- saveAs(blob, fileName);
- this.getList();
- });
- },
- //上报
- handleReport(data) {
- report(data).then((res) => {
- this.$modal.msgSuccess("上报成功");
- this.getList();
- });
- },
- //提交审核
- handleApprove(row) {
- this.tabList = [];
- this.form = [];
- const id = row.id || this.ids;
- this.edit = false;
- this.check = true;
- this.dataId = row.id;
- getGATHER(id).then((response) => {
- //深拷贝,而不是拷贝地址
- this.form = JSON.parse(JSON.stringify(response.data));
- this.openDetail = true;
- this.title = "数据查看";
- //深拷贝,而不是拷贝地址
- this.tabList = JSON.parse(JSON.stringify(response.data.feeLists));
- let dataList = response.data.feeLists;
- //去重获取tab
- //遍历如果遇到相同的id则删掉
- for (var i = 0; i < this.tabList.length - 1; i++) {
- //设置激活的tab
- if (i == 0) {
- this.activeName = this.tabList[0].normName;
- }
- for (var j = i + 1; j < this.tabList.length; j++) {
- if (this.tabList[i].normId == this.tabList[j].normId) {
- this.tabList.splice(j, 1);
- //因为数组长度减小1,所以直接 j++ 会漏掉一个元素,所以要 j--
- j--;
- }
- }
- }
- });
- },
- handleCheck(val, value) {
- let data = {
- gatherId: this.dataId,
- auditType: 2,
- };
- let audit = {
- gatherId: this.dataId,
- auditType: 3,
- remark: value,
- };
- if (val == 1) {
- bsqAudit(data).then((res) => {
- if (res.code == 200) {
- this.$modal.msgSuccess("通过审核成功");
- this.getList();
- this.openDetail = false;
- }
- });
- } else {
- bsqAudit(audit).then((res) => {
- if (res.code == 200) {
- this.$modal.msgSuccess("驳回成功");
- this.getList();
- this.openDetail = false;
- }
- });
- }
- },
- // 驳回处理
- handleReject() {
- this.$prompt("请输入驳回理由:", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- inputType: "textarea",
- })
- .then(({ value }) => {
- this.handleCheck(2, value);
- // this.$message({
- // type: 'success',
- // message: '你的邮箱是: ' + value
- // });
- })
- .catch(() => {
- // this.$message({
- // type: 'info',
- // message: '取消输入'
- // });
- });
- },
- handleClick(tab, event) {},
- /** 查询数据采集列表 */
- getList() {
- this.loading = true;
- listGATHER(this.queryParams).then((response) => {
- this.GATHERList = response.rows;
- this.load = false;
- this.total = response.total;
- this.loading = false;
- });
- },
- // 取消按钮
- cancel() {
- this.check = false;
- this.open = false;
- this.openDetail = false;
- this.openUpload = false;
- this.wbopenDetail = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.isEdit = true;
- this.audit = false;
- this.deptName = "";
- this.form = {
- id: null,
- delFlag: null,
- deptId: null,
- type: null,
- month: null,
- collStatus: "0",
- reportStatus: "0",
- approveStatus: "0",
- };
- this.uploadForm = {
- type: "",
- };
- this.fileList = [];
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.queryParams.deptId = "";
- 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.reset();
- // this.open = true;
- // this.openDetail = true;
- // this.title = "添加数据采集";
- // },
- /** 录入按钮操作 */
- handleUpdate(row) {
- // this.reset();
- this.tabList = [];
- this.form = [];
- const id = row.id || this.ids;
- getInfoByColl(id).then((response) => {
- //深拷贝,而不是拷贝地址
- this.form = JSON.parse(JSON.stringify(response.data));
- this.form.feeLists.forEach((item) => {
- if(item.funit == "%" && item.collCalue){
- item.collCalue = item.collCalue.toFixed(2);
- }
- if(item.collCalue == 0){
- item.collCalue = "";
- }
- })
- this.regionList.forEach(item=>{
- if(item.value == this.form.deptId){
- this.deptName = item.label;
- }
- })
- this.open = true;
- this.title = this.deptName + this.form.year + "年" + this.form.month + "数据采集";
- //深拷贝,而不是拷贝地址
- this.tabList = JSON.parse(JSON.stringify(response.data.feeLists));
- let dataList = response.data.feeLists;
- //去重获取tab
- //遍历如果遇到相同的id则删掉
- for (var i = 0; i < this.tabList.length - 1; i++) {
- //设置激活的tab
- if (i == 0) {
- this.activeName = this.tabList[0].normName;
- }
- for (var j = i + 1; j < this.tabList.length; j++) {
- if (this.tabList[i].normId == this.tabList[j].normId) {
- this.tabList.splice(j, 1);
- //因为数组长度减小1,所以直接 j++ 会漏掉一个元素,所以要 j--
- j--;
- }
- }
- }
- });
- },
- handleAudit(row) {
- let is = false;
- row.feeLists.forEach(item=>{
- if(item.collCalue == null || item.collCalue.length ==0 || item.collCalue == undefined){
- return is = true;
- }
- })
- if(is){
- this.$message.error("数据未填写齐全,禁止提交!");
- return;
- }
- let data = {
- type: "1",
- gatherId: row.id,
- };
- this.form.collStatus = 1;
- updateGATHER(this.form).then((response) => {
- this.$modal.msgSuccess("修改成功");
- compute(this.form).then((response) => {
- setAudit(data).then((res) => {
- if (res.code) {
- this.$message.success("审核成功");
- this.getList();
- this.openDetail = false;
- }
- });
- });
- });
- },
- // 湾办修改
- handleWbEdit(row){
- this.tabList = [];
- this.form = [];
- const id = row.id || this.ids;
- getGATHER(id).then((response) => {
- this.wbopenDetail = true;
- //深拷贝,而不是拷贝地址
- this.form = JSON.parse(JSON.stringify(response.data));
- this.form.feeLists.forEach((item) => {
- if(item.funit == "%" && item.collCalue){
- item.collCalue = item.collCalue.toFixed(2);
- }
- })
- this.regionList.forEach(item=>{
- if(item.value == this.form.deptId){
- this.deptName = item.label;
- }
- })
- this.title = this.deptName + this.form.year + "年" + this.form.month + "数据采集";
- //深拷贝,而不是拷贝地址
- this.tabList = JSON.parse(JSON.stringify(response.data.feeLists));
- //去重获取tab
- //遍历如果遇到相同的id则删掉
- for (var i = 0; i < this.tabList.length - 1; i++) {
- //设置激活的tab
- if (i == 0) {
- this.activeName = this.tabList[0].normName;
- }
- for (var j = i + 1; j < this.tabList.length; j++) {
- if (this.tabList[i].normId == this.tabList[j].normId) {
- this.tabList.splice(j, 1);
- //因为数组长度减小1,所以直接 j++ 会漏掉一个元素,所以要 j--
- j--;
- }
- }
- }
- });
- },
- /** 查看按钮操作 */
- handleDetail(row, type) {
- //false 查看 true修改
- if (type == 0 ) {
- this.edit = false;
- } else if (type == 1 ) {
- this.edit = true;
- this.isEdit = true;
- this.audit = false;
- }else if(type == 3){
- this.isEdit = false;
- this.edit = true;
- this.audit = true;
- }
- // this.reset();
- this.tabList = [];
- this.form = [];
- const id = row.id || this.ids;
- getGATHER(id).then((response) => {
- //深拷贝,而不是拷贝地址
- this.form = JSON.parse(JSON.stringify(response.data));
- this.form.feeLists.forEach((item) => {
- if(item.funit == "%" && item.collCalue){
- item.collCalue = item.collCalue.toFixed(2);
- }
- })
- this.openDetail = true;
- this.regionList.forEach(item=>{
- if(item.value == this.form.deptId){
- this.deptName = item.label;
- }
- })
- this.title = this.deptName + this.form.year + "年" + this.form.month + "数据采集";
- //深拷贝,而不是拷贝地址
- this.tabList = JSON.parse(JSON.stringify(response.data.feeLists));
- //去重获取tab
- //遍历如果遇到相同的id则删掉
- for (var i = 0; i < this.tabList.length - 1; i++) {
- //设置激活的tab
- if (i == 0) {
- this.activeName = this.tabList[0].normName;
- }
- for (var j = i + 1; j < this.tabList.length; j++) {
- if (this.tabList[i].normId == this.tabList[j].normId) {
- this.tabList.splice(j, 1);
- //因为数组长度减小1,所以直接 j++ 会漏掉一个元素,所以要 j--
- j--;
- }
- }
- }
- });
- },
- /** 提交按钮 */
- submitForm(type,is) {
- // 验证表单
- let p = [];
- if(type == 'draft') {
- this.form.feeLists.map((item, index) => {
- this.$refs["form" + item.normfeeId][0].clearValidate();
- })
- this.form.collStatus = 2;
- msg = "操作成功";
- this.$nextTick(() => {
- addGATHER(this.form).then((response) => {
- if (response.code == 200) {
- this.$modal.msgSuccess(msg);
- this.getList();
- this.open = false;
- this.openDetail = false;
- compute(this.form).then((response) => {});
- }
- });
- })
- return
- }else {
- p = this.form.feeLists.map((item, index) => {
- return new Promise((resolve, reject) => {
- this.$refs["form" + item.normfeeId][0].validate((valid) => {
- // this.$refs["form" + index].validate((valid) => {
- if (valid) {
- resolve(); //完成态
- } else {
- reject(); //已失败
- }
- });
- });
- });
- }
- let msg = "";
- Promise.all(p)
- .then(() => {
- if (type == "add") {
- this.form.collStatus = 1;
- msg = "录入成功";
- } else if (type == "edit") {
- this.form.collStatus = 1;
- if(is){
- wbUpdateGATHER(this.form).then((response) => {
- this.$modal.msgSuccess("修改成功");
- this.getList();
- this.wbopenDetail = false;
- compute(this.form).then((response) => {});
- });
- return;
- }else{
- updateGATHER(this.form).then((response) => {
- this.$modal.msgSuccess("修改成功");
- this.getList();
- this.openDetail = false;
- compute(this.form).then((response) => {});
- });
- return;
- }
- }else if(type == 'draft'){
- this.form.collStatus = 2;
- msg = "操作成功";
- }
- addGATHER(this.form).then((response) => {
- if (response.code == 200) {
- this.$modal.msgSuccess(msg);
- this.getList();
- this.open = false;
- this.openDetail = false;
- compute(this.form).then((response) => {});
- }
- });
- })
- .catch((err) => {
- this.$message.error("请检查是否有必填项未输入!");
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const ids = row.id || this.ids;
- this.$modal
- .confirm('是否确认删除数据采集编号为"' + ids + '"的数据项?')
- .then(function () {
- return delGATHER(ids);
- })
- .then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- })
- .catch(() => {});
- },
- /** 导出按钮操作 */
- handleExport() {
- this.download(
- "business/GATHER/export",
- {
- ...this.queryParams,
- },
- `GATHER_${new Date().getTime()}.xlsx`
- );
- },
- },
- };
- </script>
- <style scoped lang="scss">
- .el-form-item{
- margin-right: 5px;
- padding: 0 !important;
- }
- ::v-deep .el-form-item .el-form-item__label{
- font-size: 13px !important;
- }
- .remark {
- margin-top: 20px;
- .remark_title {
- margin-bottom: 30px;
- font-size: 18px;
- font-weight: bold;
- }
- .remark_text {
- padding: 2px;
- min-height: 150px;
- border: 1px solid #cccccc82;
- border-radius: 4px;
- color: #958383;
- font-size: 16px;
- background: #3333331a;
- }
- }
- </style>
|