123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
- <el-form-item :label="$t('开票日期')" prop="kprq">
- <el-date-picker
- v-model="chooseDate"
- @change="handleQuery"
- type="daterange"
- style="width: 508px"
- align="right"
- unlink-panels
- :range-separator="$t('至')"
- :start-placeholder="$t('开始日期')"
- :end-placeholder="$t('结束日期')"
- value-format="yyyy-MM-dd"
- :picker-options="pickerOptions">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('新票/续票')" prop="xpxp">
- <el-select v-model="queryParams.xpxp" :placeholder="$t('请选择') + $t('新票/续票')" clearable size="small"
- @change="handleQuery">
- <el-option
- v-for="dict in xpxpOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="票号" prop="allNo">
- <el-input
- v-model="queryParams.allNo"
- placeholder="请输入联系人"
- clearable
- size="small"
- @input="handleQuery"
- />
- </el-form-item>
- <el-form-item :label="$t('火票级别')" prop="hpjb">
- <el-select v-model="queryParams.hpjb" :placeholder="$t('请选择') + $t('火票级别')" clearable size="small"
- @change="handleQuery">
- <el-option
- v-for="dict in hpjbOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="高处作业级别" prop="gczyjb">
- <el-select v-model="queryParams.gczyjb" :placeholder="$t('请选择') + $t('高处作业级别')" clearable size="small"
- @change="handleQuery">
- <el-option
- v-for="dict in gczyjbOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="工作内容" prop="content">
- <el-input
- v-model="queryParams.content"
- placeholder="请输入工作内容"
- clearable
- size="small" @input="handleQuery"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="BYC负责单位/联系人" label-width="150" prop="byclxr">
- <el-input
- v-model="queryParams.byclxr"
- placeholder="请输入BYC负责单位/联系人"
- clearable
- size="small" @input="handleQuery"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="施工单位" prop="sgdw">
- <el-input
- v-model="queryParams.sgdw"
- placeholder="请输入施工单位"
- clearable
- size="small" @input="handleQuery"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="销票时间" prop="xpsj">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="queryParams.xpsj"
- type="date"
- @change="handleQuery"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('销票时间')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('作业票状态')" prop="zypzt">
- <el-select v-model="queryParams.zypzt" :placeholder="$t('请选择') + $t('作业票状态')" clearable size="small"
- @change="handleQuery">
- <el-option
- v-for="dict in zypztOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <!-- <el-form-item label="未撤销项编号" prop="wcxxbh">-->
- <!-- <el-input-->
- <!-- v-model="queryParams.wcxxbh"-->
- <!-- placeholder="请输入未撤销项编号"-->
- <!-- clearable-->
- <!-- size="small" @input="handleQuery"-->
- <!-- @keyup.enter.native="handleQuery"-->
- <!-- />-->
- <!-- </el-form-item>-->
- <el-form-item label="未撤销状态" prop="wcxzt">
- <el-select v-model="queryParams.wcxzt" style="width: 200px" :placeholder="$t('请选择') + $t('未撤销状态')"
- @change="handleQuery" clearable>
- <el-option
- v-for="dict in wcxztOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="撤销时间" prop="cxsj">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="queryParams.cxsj"
- type="date"
- @change="handleQuery"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('撤销时间')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('索引')" prop="tag">
- <el-select v-model="queryParams.tag" clearable filterable @change="handleQuery" placeholder="请选择索引">
- <el-option-group
- v-for="group in tagOptions"
- :key="group.tag"
- :label="group.tag">
- <el-option
- v-for="item in group.children"
- :key="item.tag"
- :label="item.tag"
- :value="item.tag">
- </el-option>
- </el-option-group>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('重置') }}</el-button>
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['ehs:jobticket:add']"
- >{{ $t('新增') }}
- </el-button>
- </el-col>
- <!-- <el-col :span="1.5">
- <el-button
- type="success"
- icon="el-icon-edit"
- size="mini"
- :disabled="single"
- @click="handleUpdate"
- v-hasPermi="['ehs:jobticket:edit']"
- >{{ $t('修改') }}</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- icon="el-icon-delete"
- size="mini"
- :disabled="multiple"
- @click="handleDelete"
- v-hasPermi="['ehs:jobticket:remove']"
- >{{ $t('删除') }}</el-button>
- </el-col>-->
- <el-col :span="1.5">
- <el-button
- type="warning"
- icon="el-icon-download"
- size="mini"
- @click="handleExport"
- v-hasPermi="['ehs:jobticket:export']"
- >{{ $t('导出') }}
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="primary"
- icon="el-icon-s-data"
- size="mini"
- @click="handleData"
- >{{ $t('数据分析') }}
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-radio-group v-model="tableType" @input="getList">
- <el-radio-button label="1">树形列表</el-radio-button>
- <el-radio-button label="2">平级列表</el-radio-button>
- </el-radio-group>
- </el-col>
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-table v-if="tableType == 1" v-loading="loading" :data="jobticketList"
- :height="clientHeight" border :cell-style="myclass"
- row-key="id"
- :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
- :default-expand-all=true
- @sort-change="sortList"
- >
- <el-table-column :label="$t('开票日期')" align="center" prop="kprq" width="125">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.kprq, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('新票/续票')" align="center" prop="xpxp" width="100" :formatter="xpxpFormat"/>
- <el-table-column :label="$t('延期许可证号')" align="center" sortable="custom" prop="yqxkzh" width="120"
- :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('危害工作许可证号')" align="center" sortable="custom" prop="whgzxkzh" width="120"
- :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('动火作业许可证号')" align="center" sortable="custom" prop="dhzyxkzh" width="120"
- :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('火票级别')" align="center" sortable="custom" prop="hpjb" :formatter="hpjbFormat"/>
- <el-table-column :label="$t('限制空间许可证号')" align="center" sortable="custom" prop="xzkjxkzh" width="120"
- :show-overflow-tooltip="true"/>
- <el-table-column label="盲板作业许可证号" align="center" sortable="custom" prop="mbzyxkzh" width="120" :show-overflow-tooltip="true"/>
- <el-table-column label="高处作业许可证号" align="center" sortable="custom" prop="gczyxkzh" width="120" :show-overflow-tooltip="true"/>
- <el-table-column label="高处作业级别" align="center" sortable="custom" prop="gczyjb" :formatter="gczyjbFormat"/>
- <el-table-column :label="$t('工作内容')" align="center" prop="content" width="300" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('BYC负责单位/联系人')" align="center" prop="byclxr" width="100"
- :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('施工单位')" align="center" prop="sgdw" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('联系人')" align="center" prop="lxr" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('联系电话')" align="center" prop="lxdh" width="100" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('销票时间')" align="center" prop="xpsj" width="100">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.xpsj, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('作业票状态')" align="center" prop="zypzt" width="200" :formatter="zypztFormat">
- <template slot-scope="scope" v-if="scope.row.zypzt != null">
- <el-dropdown placement="bottom" trigger="click">
- <span class="el-dropdown-link">
- <span style=" font-size: 13px" v-if="scope.row.zypzt==10">{{ "作业票未销" }}</span>
- <span style=" font-size: 13px" v-if="scope.row.zypzt==18">{{ "作业票收回,作业票关闭" }}</span>
- <span style="font-size: 13px" v-if="scope.row.zypzt==16">{{ "作业票延期" }}</span>
- <span style="font-size: 13px" v-if="scope.row.zypzt==20">{{ "作业票作废" }}</span>
- <i class="el-icon-caret-bottom"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="statusChange(10, scope.row)">{{ $t('作业票未销') }}</el-dropdown-item>
- <el-dropdown-item @click.native="statusChange(18, scope.row)">{{ $t('作业票关闭,作业票收回') }}</el-dropdown-item>
- <el-dropdown-item @click.native="statusChange(16, scope.row)">{{ $t('作业票延期') }}</el-dropdown-item>
- <el-dropdown-item @click.native="statusChange(20, scope.row)">{{ $t('作业票作废') }}</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </template>
- </el-table-column>
- <el-table-column :label="$t('未撤销项编号')" align="center" prop="wcxxbh" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('未撤销状态')" align="center" prop="wcxzt" :formatter="wcxztFormat">
- <template slot-scope="scope" v-if="scope.row.wcxzt != null">
- <el-dropdown placement="bottom" trigger="click">
- <span class="el-dropdown-link">
- <span style=" font-size: 13px" v-if="scope.row.wcxzt==10">{{ "有" }}</span>
- <span style=" font-size: 13px" v-if="scope.row.wcxzt==12">{{ "无" }}</span>
- <i class="el-icon-caret-bottom"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="wcxztYOU(0, scope.row)">{{ $t('有') }}</el-dropdown-item>
- <el-dropdown-item @click.native="wcxztWU(0, scope.row)">{{ $t('无') }}</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </template>
- </el-table-column>
- <el-table-column :label="$t('撤销时间')" align="center" prop="cxsj" width="100">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.cxsj, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('索引')" align="center" prop="tag" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('操作')" align="center" fixed="right" width="160"
- class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['ehs:jobticket:edit']"
- >{{ $t('修改') }}
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['ehs:jobticket:remove']"
- >{{ $t('删除') }}
- </el-button>
- <el-button
- v-if="scope.row.xpxp=='10'"
- size="mini"
- type="text"
- icon="el-icon-date"
- @click="handlePostpone(scope.row)"
- v-hasPermi="['ehs:jobticket:add']"
- >{{ $t('延期') }}
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-table v-else v-loading="loading" :data="jobticketList"
- :height="clientHeight" border :cell-style="myclass"
- @sort-change="sortList"
- >
- <el-table-column :label="$t('开票日期')" align="center" prop="kprq" width="125">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.kprq, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('新票/续票')" align="center" prop="xpxp" width="100" :formatter="xpxpFormat"/>
- <el-table-column :label="$t('延期许可证号')" align="center" sortable="custom" prop="yqxkzh" width="120"
- :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('危害工作许可证号')" align="center" sortable="custom" prop="whgzxkzh" width="120"
- :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('动火作业许可证号')" align="center" sortable="custom" prop="dhzyxkzh" width="120"
- :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('火票级别')" align="center" sortable="custom" prop="hpjb" :formatter="hpjbFormat"/>
- <el-table-column :label="$t('限制空间许可证号')" align="center" sortable="custom" prop="xzkjxkzh" width="120"
- :show-overflow-tooltip="true"/>
- <el-table-column label="盲板作业许可证号" align="center" sortable="custom" prop="mbzyxkzh" width="120" :show-overflow-tooltip="true"/>
- <el-table-column label="高处作业许可证号" align="center" sortable="custom" prop="gczyxkzh" width="120" :show-overflow-tooltip="true"/>
- <el-table-column label="高处作业级别" align="center" sortable="custom" prop="gczyjb" :formatter="gczyjbFormat"/>
- <el-table-column :label="$t('工作内容')" align="center" prop="content" width="300" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('BYC负责单位/联系人')" align="center" prop="byclxr" width="100"
- :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('施工单位')" align="center" prop="sgdw" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('联系人')" align="center" prop="lxr" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('联系电话')" align="center" prop="lxdh" width="100" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('销票时间')" align="center" prop="xpsj" width="100">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.xpsj, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('作业票状态')" align="center" prop="zypzt" width="200" :formatter="zypztFormat">
- <template slot-scope="scope" v-if="scope.row.zypzt != null">
- <el-dropdown placement="bottom" trigger="click">
- <span class="el-dropdown-link">
- <span style=" font-size: 13px" v-if="scope.row.zypzt==10">{{ "作业票未销" }}</span>
- <span style=" font-size: 13px" v-if="scope.row.zypzt==18">{{ "作业票收回,作业票关闭" }}</span>
- <span style="font-size: 13px" v-if="scope.row.zypzt==16">{{ "作业票延期" }}</span>
- <span style="font-size: 13px" v-if="scope.row.zypzt==20">{{ "作业票作废" }}</span>
- <i class="el-icon-caret-bottom"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="statusChange(10, scope.row)">{{ $t('作业票未销') }}</el-dropdown-item>
- <el-dropdown-item @click.native="statusChange(18, scope.row)">{{ $t('作业票关闭,作业票收回') }}</el-dropdown-item>
- <el-dropdown-item @click.native="statusChange(16, scope.row)">{{ $t('作业票延期') }}</el-dropdown-item>
- <el-dropdown-item @click.native="statusChange(20, scope.row)">{{ $t('作业票作废') }}</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </template>
- </el-table-column>
- <el-table-column :label="$t('未撤销项编号')" align="center" prop="wcxxbh" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('未撤销状态')" align="center" prop="wcxzt" :formatter="wcxztFormat">
- <template slot-scope="scope" v-if="scope.row.wcxzt != null">
- <el-dropdown placement="bottom" trigger="click">
- <span class="el-dropdown-link">
- <span style=" font-size: 13px" v-if="scope.row.wcxzt==10">{{ "有" }}</span>
- <span style=" font-size: 13px" v-if="scope.row.wcxzt==12">{{ "无" }}</span>
- <i class="el-icon-caret-bottom"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="wcxztYOU(0, scope.row)">{{ $t('有') }}</el-dropdown-item>
- <el-dropdown-item @click.native="wcxztWU(0, scope.row)">{{ $t('无') }}</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </template>
- </el-table-column>
- <el-table-column :label="$t('撤销时间')" align="center" prop="cxsj" width="100">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.cxsj, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('索引')" align="center" prop="tag" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('操作')" align="center" fixed="right" width="160"
- class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['ehs:jobticket:edit']"
- >{{ $t('修改') }}
- </el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['ehs:jobticket:remove']"
- >{{ $t('删除') }}
- </el-button>
- <el-button
- v-if="scope.row.xpxp=='10'"
- size="mini"
- type="text"
- icon="el-icon-date"
- @click="handlePostpone(scope.row)"
- v-hasPermi="['ehs:jobticket:add']"
- >{{ $t('延期') }}
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :page-sizes="[20,100,200,500]"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 添加或修改工作票对话框 -->
- <el-dialog v-dialogDrag :title="title" :visible.sync="open" width="700px" :close-on-click-modal="false"
- append-to-body>
- <el-form ref="form" :model="form" :rules="rules" label-width="130px">
- <el-form-item :label="$t('开票日期')" prop="kprq">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.kprq"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('开票日期')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('签发时间')" prop="qfsj">
- <el-input v-model="form.qfsj" :placeholder="$t('请输入') + $t('签发时间')"/>
- </el-form-item>
- <el-form-item :label="$t('签发班组')" prop="qfbz">
- <el-select v-model="form.qfbz" :placeholder="$t('请选择') + $t('签发班组')">
- <el-option
- v-for="dict in qfbzOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('新票/续票')" prop="xpxp" v-if="isxp" >
- <el-select v-model="form.xpxp" :placeholder="$t('请选择') + $t('新票/续票')" :disabled="isxp">
- <el-option
- v-for="dict in xpxpOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('延期许可证号')" prop="yqxkzh">
- <el-input v-model="form.yqxkzh" :placeholder="$t('请输入') + $t('延期许可证号')"/>
- </el-form-item>
- <el-form-item :label="$t('危害工作许可证号')" prop="whgzxkzh">
- <el-input v-model="form.whgzxkzh" :placeholder="$t('请输入') + $t('危害工作许可证号')"/>
- </el-form-item>
- <el-form-item :label="$t('动火作业许可证号')" prop="dhzyxkzh">
- <el-input v-model="form.dhzyxkzh" :placeholder="$t('请输入') + $t('动火作业许可证号')"/>
- </el-form-item>
- <el-form-item :label="$t('火票级别')" prop="hpjb">
- <el-select v-model="form.hpjb" :placeholder="$t('请选择') + $t('火票级别')" clearable>
- <el-option
- v-for="dict in hpjbOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('限制空间许可证号')" prop="xzkjxkzh">
- <el-input v-model="form.xzkjxkzh" :placeholder="$t('请输入') + $t('限制空间许可证号')"/>
- </el-form-item>
- <el-form-item :label="$t('盲板作业许可证号')" prop="mbzyxkzh">
- <el-input v-model="form.mbzyxkzh" :placeholder="$t('请输入') + $t('盲板作业许可证号')"/>
- </el-form-item>
- <el-form-item :label="$t('高处作业许可证号')" prop="gczyxkzh">
- <el-input v-model="form.gczyxkzh" :placeholder="$t('请输入') + $t('高处作业许可证号')"/>
- </el-form-item>
- <el-form-item :label="$t('高处作业级别')" prop="hpjb">
- <el-select v-model="form.gczyjb" :placeholder="$t('请选择') + $t('高处作业级别')" clearable>
- <el-option
- v-for="dict in gczyjbOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('内容')" prop="content">
- <el-input v-model="form.content" :placeholder="$t('请输入') + $t('内容')"/>
- </el-form-item>
- <el-form-item label="用户单位" prop="userUnit">
- <el-select v-model="form.userUnit" placeholder="请选择用户单位"
- @change="checkCategoryPromotionUpdate(form.userUnit)">
- <el-option
- v-for="dict in userUnitOptions"
- :key="dict.userUnit"
- :label="dict.userUnit"
- :value="dict.userUnit"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="用户主管" prop="userMg">
- <el-select v-model="form.userMg" placeholder="请先选择好用户单位" @change="pick">
- <el-option
- v-for="dict in userMgOptions"
- :key="dict.userId"
- :label="dict.nickName"
- :value="dict.userId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('施工单位')" prop="sgdw">
- <el-select v-model="form.sgdw" placeholder="请选择施工单位" @change="selectworkUnit(form.sgdw)">
- <el-option
- v-for="dict in sgdwOptions"
- :key="dict.id"
- :label="dict.label"
- :value="dict.label"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('联系人')" prop="lxr">
- <el-input v-model="form.lxr" :placeholder="$t('请输入') + $t('联系人')"/>
- </el-form-item>
- <el-form-item :label="$t('联系电话')" prop="lxdh">
- <el-input v-model="form.lxdh" :placeholder="$t('请输入') + $t('联系电话')"/>
- </el-form-item>
- <el-form-item :label="$t('销票时间')" prop="xpsj">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.xpsj"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('销票时间')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('作业票状态')" prop="zypzt">
- <el-select v-model="form.zypzt" :placeholder="$t('请选择') + $t('作业票状态')">
- <el-option
- v-for="dict in zypztOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('未撤销项编号')" prop="wcxxbh">
- <el-input v-model="form.wcxxbh" :placeholder="$t('请输入') + $t('未撤销项编号')"/>
- </el-form-item>
- <el-form-item :label="$t('未撤销状态')" prop="wcxzt">
- <el-select v-model="form.wcxzt" :placeholder="$t('请选择') + $t('未撤销状态')" clearable>
- <el-option
- v-for="dict in wcxztOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('撤销时间')" prop="cxsj">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.cxsj"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('撤销时间')">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="索引" prop="tag">
- <el-select v-model="form.tag" filterable clearable placeholder="请选择索引">
- <el-option-group
- v-for="group in tagOptions"
- :key="group.tag"
- :label="group.tag">
- <el-option
- v-for="item in group.children"
- :key="item.tag"
- :label="item.tag"
- :value="item.tag">
- </el-option>
- </el-option-group>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('备注')" prop="remarks">
- <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')"/>
- </el-form-item>
- <el-form-item :label="$t('归属部门')" prop="deptId">
- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true"
- :placeholder="$t('请选择') + $t('归属部门')"/>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
- <el-button @click="cancel">{{ $t('取 消') }}</el-button>
- </div>
- </el-dialog>
- <!-- 用户导入对话框 -->
- <el-dialog v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px"
- :close-on-click-modal="false" append-to-body>
- <el-upload
- ref="upload"
- :limit="1"
- accept=".xlsx, .xls"
- :headers="upload.headers"
- :action="upload.url"
- :disabled="upload.isUploading"
- :on-progress="handleFileUploadProgress"
- :on-success="handleFileSuccess"
- :auto-upload="false"
- drag
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">
- {{ $t('将文件拖到此处,或') }}
- <em>{{ $t('点击上传') }}</em>
- </div>
- <div class="el-upload__tip" slot="tip">
- <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
- <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
- </div>
- <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
- <input name="type" :value="upload.type" hidden/>
- </form>
- <div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
- </el-upload>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>
- <el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
- </div>
- </el-dialog>
- <el-drawer
- :title="$t('数据分析')"
- size="600px"
- :visible.sync="drawer"
- :direction="direction">
- <el-row>
- <el-col>
- <el-card class="box-card" shadow="hover">
- <div slot="header" class="clearfix">
- <span>{{ this.$t('火票级别统计') }}</span>
- </div>
- <div class="text item">
- <fire-data></fire-data>
- </div>
- </el-card>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-card class="box-card" shadow="hover">
- <div slot="header" class="clearfix">
- <span>{{ this.$t('作业票状态统计') }}</span>
- </div>
- <div class="text item">
- <status-data></status-data>
- </div>
- </el-card>
- </el-col>
- </el-row>
- </el-drawer>
- <el-dialog title="延期作业许可" :visible.sync="guanlianVisible" width="30%" :close-on-click-modal="false" center>
- <el-form ref="form" :model="postponeform" :rules="rules1" label-width="80px">
- <el-form-item :label="$t('开票日期')" prop="kprq">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="postponeform.kprq"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('开票日期')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('签发时间')" prop="qfsj">
- <el-input v-model="postponeform.qfsj" :placeholder="$t('请输入') + $t('签发时间')"/>
- </el-form-item>
- <el-form-item :label="$t('签发班组')" prop="qfbz">
- <el-select v-model="postponeform.qfbz" :placeholder="$t('请选择') + $t('签发班组')">
- <el-option
- v-for="dict in qfbzOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('延期许可证号')" prop="yqxkzh">
- <el-input v-model="postponeform.yqxkzh" :placeholder="$t('请输入') + $t('延期许可证号')"/>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="guanlianVisible=false">取 消</el-button>
- <el-button type="primary" @click="submitPostpone()">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- listJobticket,
- getJobticket,
- delJobticket,
- addJobticket,
- updateJobticket,
- exportJobticket,
- updateJobticketStatus
- } from "@/api/ehs/jobticket";
- import {
- listUnit,
- getUnit,
- delUnit,
- addUnit,
- updateUnit,
- exportUnit,
- getUserByUnit,
- getAllUserUnit
- } from "@/api/invoice/unit";
- import {treeselect, getDept} from "@/api/system/dept";
- import {getToken} from "@/utils/auth";
- import Treeselect from "@riophae/vue-treeselect";
- import "@riophae/vue-treeselect/dist/vue-treeselect.css";
- import FireData from "./fireData";
- import StatusData from "./statusData";
- import {listTagAll} from "@/api/invoice/tag";
- import base from "@/assets/js/base";
- import {listSpecYlrq} from "@/api/sems/specYlrq";
- export default {
- name: "Jobticket",
- components: {FireData, Treeselect, StatusData},
- data() {
- return {
- //新票新增
- isxp: false,
- //延期对话框
- guanlianVisible: false,
- yqzyxkzh: "",
- drawer: false,
- direction: 'rtl',
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: false,
- // 总条数
- total: 0,
- // 工作票表格数据
- jobticketList: [],
- // 弹出层标题
- title: "",
- // 部门树选项
- deptOptions: undefined,
- clientHeight: 300,
- // 是否显示弹出层
- open: false,
- // 装置字典
- plantCodeOptions: [],
- // 签发班组字典
- qfbzOptions: [],
- // 新票/续票字典
- xpxpOptions: [],
- // 火票级别字典
- hpjbOptions: [],
- // 作业票状态字典
- zypztOptions: [],
- // 高处作业级别字典
- gczyjbOptions: [],
- //作业票未撤销状态字典
- wcxztOptions: [],
- //施工单位字典
- sgdwOptions: [],
- // 用户单位字典
- userUnitOptions: [],
- // 用户主管字典
- userMgOptions: [],
- tagOptions: [],
- // 用户导入参数
- upload: {
- //下载模板请求地址
- downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
- //下载模板类型
- type: "jobticket",
- // 是否显示弹出层(用户导入)
- open: false,
- // 弹出层标题(用户导入)
- title: "",
- // 是否禁用上传
- isUploading: false,
- // 是否更新已经存在的用户数据
- updateSupport: 0,
- // 设置上传的请求头部
- headers: {Authorization: "Bearer " + getToken()},
- // 上传的地址
- url: process.env.VUE_APP_BASE_API + "/ehs/jobticket/importData"
- },
- // 查询参数
- tableType: 1,
- queryParams: {
- tableType: 1,
- pageNum: 1,
- pageSize: 100,
- plantCode: null,
- kprq: null,
- startDate: null,
- endDate: null,
- qfsj: null,
- qfbz: null,
- qfr: null,
- xpxp: null,
- whgzxkzh: null,
- dhzyxkzh: null,
- hpjb: null,
- xzkjxkzh: null,
- content: null,
- byclxr: null,
- sgdw: null,
- lxr: null,
- lxdh: null,
- xpsj: null,
- zypzt: null,
- jccdr: null,
- wcxxbh: null,
- wcxzt: null,
- cxsj: null,
- tag: null,
- orderByColumn: null,
- isAsc: null,
- allNo: null
- },
- //日期快速选择
- pickerOptions: {
- shortcuts: [{
- text: this.$t('最近一周'),
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: this.$t('最近一个月'),
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: this.$t('最近三个月'),
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
- picker.$emit('pick', [start, end]);
- }
- }]
- },
- //日期选择器
- chooseDate: [],
- // 表单参数
- form: {},
- //延期参数
- postponeParams: {},
- //延期表单
- postponeform: {},
- // 表单校验
- rules: {
- plantCode: [
- {required: true, message: this.$t('装置') + this.$t('不能为空'), trigger: "change"}
- ],
- deptId: [
- {required: true, message: this.$t('部门编号') + this.$t('不能为空'), trigger: "blur"}
- ],
- xpxp: [
- {required: true, message: this.$t('手动新增只能为新票'), trigger: "blur"},
- {validator: this.xpxp, trigger: 'blur'}
- ]
- },
- rules1: {
- yqxkzh: [
- {required: true, message: this.$t('当前续票必填'), trigger: "blur"}
- ],
- }
- };
- },
- watch: {
- // 根据名称筛选部门树
- deptName(val) {
- this.$refs.tree.filter(val);
- }
- },
- created() {
- //设置表格高度对应屏幕高度
- this.$nextTick(() => {
- this.clientHeight = (document.body.clientHeight - 80) * 0.8
- })
- this.getList();
- this.getTreeselect();
- this.getChengbaoshang();
- this.getTagList()
- this.getDicts("PLANT_DIVIDE").then(response => {
- this.plantCodeOptions = response.data;
- });
- this.getDicts("QFBZ").then(response => {
- this.qfbzOptions = response.data;
- });
- this.getDicts("XPXP").then(response => {
- this.xpxpOptions = response.data;
- });
- this.getDicts("HPJB").then(response => {
- this.hpjbOptions = response.data;
- });
- this.getDicts("ZYPZT").then(response => {
- this.zypztOptions = response.data;
- });
- //高处作业级别
- this.getDicts("GCZYJB").then(response => {
- this.gczyjbOptions = response.data;
- });
- this.getDicts("TICKED_WCXZT").then(response => {
- this.wcxztOptions = response.data;
- });
- getAllUserUnit({}).then(response => {
- this.userUnitOptions = response.data;
- console.log(this.userUnitOptions)
- });
- },
- methods: {
- //当前时间
- getNowFormatDate() {
- var date = new Date();
- var seperator1 = "-";
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- var currentdate = year + seperator1 + month + seperator1 + strDate;
- return currentdate;
- },
- //根据用户单位 查询对应选择的用户主管 根据用户单位 字段 查找对应的多个主管 返回 Sysuser的集合(id,name)
- checkCategoryPromotion(oneId) {
- getUserByUnit(oneId).then(response => {
- // this.form.userMg=null;
- this.userMgOptions = response.data;
- // let arr= response.data.userIds.split(',');
- });
- },
- //修改用户单位时,级联的用户主管下拉数据应清空,否则会造成用户修改了用户单位,但未重新选择相应的用户主管
- checkCategoryPromotionUpdate(oneId) {
- this.form.userMg = null;
- getUserByUnit(oneId).then(response => {
- // this.form.userMg=null;
- this.userMgOptions = response.data;
- // let arr= response.data.userIds.split(',');
- });
- },
- //修改延期时的用户单位
- checkCategoryPromotionRenew(oneId) {
- this.postponeform.userMg = null;
- getUserByUnit(oneId).then(response => {
- this.userMgOptions = response.data;
- });
- },
- //主管下拉框变动重新刷新赋值
- pick() {
- this.$forceUpdate()
- },
- //查找施工单位
- selectworkUnit(oneId) {
- //选中的数据和options进行匹配
- var obj = {}
- obj = this.sgdwOptions.find(function (i) {
- return i.label === oneId
- });
- getDept(obj.id).then(response => {
- this.form.lxr = response.data.leader;
- this.form.lxdh = response.data.phone
- });
- },
- //查找承包商列表
- getChengbaoshang() {
- treeselect().then(response => {
- this.sgdwOptions = response.data[1].children;
- });
- },
- //得到索引下拉框
- getTagList() {
- listTagAll().then(response => {
- this.tagOptions = response
- });
- },
- //延期 即新增一条 改为续票
- handlePostpone(row) {
- this.guanlianVisible = true
- const id = row.id || this.ids
- getJobticket(id).then(response => {
- this.postponeform = response.data;
- this.postponeform.kprq = this.getNowFormatDate()
- // this.checkCategoryPromotion(response.data.userUnit);
- });
- this.postponeParams = base.deepClone(row)
- },
- //新的 续票 构造票号 最多五次
- submitPostpone() {
- this.guanlianVisible = false
- //保留新票的参数 用来修改新票
- const id = this.postponeParams.id
- const postponeNumber = this.postponeParams.postponeNumber + 1;
- const yqxkzh = this.postponeform.yqxkzh
- //续票的参数
- this.postponeParams.id = null
- this.postponeParams.yqxkzh = this.postponeform.yqxkzh
- this.postponeParams.xpxp = "12"
- this.postponeParams.zypzt = "10"
- this.postponeParams.kprq = this.postponeform.kprq
- this.postponeParams.qfsj = this.postponeform.qfsj
- this.postponeParams.qfbz = this.postponeform.qfbz
- this.postponeParams.qfr = this.postponeform.qfr
- if (postponeNumber > 15) {
- return this.msgError("当前作业票最多可以延期十五次,请重新开票");
- } else {
- if (this.postponeParams.yqxkzh.endsWith('-6')) {
- this.msgError("每张续票最多可以延期五次,请重新命名生成新的续票");
- this.getList();
- } else {
- //若果是第一次延期 延期许可证取输入的 后续的都是原来
- let putData = {}
- putData.id = id
- putData.postponeNumber = postponeNumber
- if (putData.postponeNumber == 1) {
- putData.yqxkzh = yqxkzh.substring(0, yqxkzh.indexOf("-"));
- updateJobticket(putData).then(response => {
- });
- } else {
- putData.yqxkzh = yqxkzh
- }
- addJobticket(this.postponeParams).then(response => {
- this.msgSuccess(this.$t('延期成功,请查看新的续票'));
- this.open = false;
- this.getList();
- });
- }
- }
- },
- //修改单元格样式的方法
- myclass({row, column, rowIndex, columnIndex}) {
- if (row.zypzt == 10) {
- return "background-color:rgba(255, 68,68, 0.5);"
- }
- if (row.zypzt == 18 || row.zypzt == 14) {
- return "background-color:rgba(21,180,51, 0.5);"
- }
- if (row.zypzt == 16) {
- return "background-color:rgba(221,248,9, 0.5);"
- }
- if (row.zypzt == 20) {
- return "background-color:rgba(163, 150,150, 0.5);"
- }
- },
- /** 查询工作票列表 */
- getList() {
- this.loading = true;
- this.queryParams.tableType = this.tableType
- listJobticket(this.queryParams).then(response => {
- this.jobticketList = []
- this.jobticketList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- //element表格排序
- sortList(val) {
- var sort = "asc";
- let sortTip = val.order
- this.queryParams.orderByColumn = val.prop;
- if (sortTip === 'descending') {
- this.queryParams.isAsc = 'desc' // 降序
- } else if (sortTip === 'ascending') {
- this.queryParams.isAsc = 'asc' // 升序
- } else if (sortTip === null) {
- this.queryParams.isAsc = null;
- this.queryParams.orderByColumn = null;
- }
- this.getList();
- },
- /** 查询部门下拉树结构 */
- getTreeselect() {
- treeselect().then(response => {
- this.deptOptions = response.data;
- });
- },
- // 装置字典翻译
- plantCodeFormat(row, column) {
- return this.selectDictLabel(this.plantCodeOptions, row.plantCode);
- },
- // 签发班组字典翻译
- qfbzFormat(row, column) {
- return this.selectDictLabel(this.qfbzOptions, row.qfbz);
- },
- // 新票/续票字典翻译
- xpxpFormat(row, column) {
- return this.selectDictLabel(this.xpxpOptions, row.xpxp);
- },
- // 火票级别字典翻译
- hpjbFormat(row, column) {
- return this.selectDictLabel(this.hpjbOptions, row.hpjb);
- },
- // 作业票状态字典翻译
- zypztFormat(row, column) {
- return this.selectDictLabel(this.zypztOptions, row.zypzt);
- },
- // 高处作业级别字典翻译
- gczyjbFormat(row, column) {
- return this.selectDictLabel(this.gczyjbOptions, row.gczyjb);
- },
- wcxztFormat(row, column) {
- return this.selectDictLabel(this.wcxztOptions, row.wcxzt);
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.reset();
- },
- //变换作业票状态
- statusChange(index, row) {
- this.form = row;
- row.zypzt = index;
- this.form.zypzt = index;
- updateJobticketStatus(this.form).then(response => {
- this.msgSuccess(this.$t('修改成功'));
- this.open = false;
- this.getList();
- });
- },
- wcxztYOU(index, row) {
- this.form = row;
- this.form.wcxzt = 10;
- updateJobticket(this.form).then(response => {
- this.msgSuccess(this.$t('修改成功'));
- this.open = false;
- this.getList();
- });
- },
- wcxztWU(index, row) {
- this.form = row;
- this.form.wcxzt = 12;
- this.form.cxsj = this.getNowFormatDate()
- updateJobticket(this.form).then(response => {
- this.msgSuccess(this.$t('修改成功'));
- this.open = false;
- this.getList();
- });
- },
- // 表单重置
- reset() {
- this.form = {
- id: null,
- plantCode: null,
- kprq: null,
- startDate: null,
- endDate: null,
- qfsj: null,
- qfbz: null,
- qfr: null,
- xpxp: null,
- yqxkzh: null,
- whgzxkzh: null,
- dhzyxkzh: null,
- hpjb: null,
- xzkjxkzh: null,
- content: null,
- byclxr: null,
- sgdw: null,
- lxr: null,
- lxdh: null,
- xpsj: null,
- zypzt: null,
- jccdr: null,
- wcxxbh: null,
- wcxzt: null,
- cxsj: null,
- delFlag: null,
- createrCode: null,
- createdate: null,
- updaterCode: null,
- updatedate: null,
- deptId: null,
- remarks: null
- };
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- console.log(this.queryParams)
- if (this.chooseDate == null) {
- this.chooseDate = []
- }
- this.queryParams.startDate = this.chooseDate[0]
- this.queryParams.endDate = this.chooseDate[1]
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.chooseDate = "";
- 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.title = this.$t('新增') + " " + this.$t('工作票');
- this.form.kprq = this.getNowFormatDate()
- this.form.qfsj = '8:30'
- this.form.zypzt = "10"
- this.form.xpxp = "10"
- this.isxp = false
- this.form.deptId = this.$store.state.user.deptId
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.isxp = true
- this.reset();
- const id = row.id || this.ids
- getJobticket(id).then(response => {
- this.form = response.data;
- this.checkCategoryPromotion(this.form.userUnit);
- this.open = true;
- this.title = this.$t('修改') + this.$t('工作票');
- });
- },
- /** 提交按钮 */
- submitForm() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- if (this.form.id != null) {
- updateJobticket(this.form).then(response => {
- this.msgSuccess(this.$t('修改成功'));
- this.open = false;
- this.getList();
- });
- } else {
- addJobticket(this.form).then(response => {
- this.msgSuccess(this.$t('新增成功'));
- this.open = false;
- this.getList();
- });
- }
- }
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- if (row.children != null && row.children.length > 0) {
- this.msgError('存在续票,无法删除主票')
- return
- }
- const ids = row.id || this.ids;
- this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
- confirmButtonText: this.$t('确定'),
- cancelButtonText: this.$t('取消'),
- type: "warning"
- }).then(function () {
- return delJobticket(ids);
- }).then(() => {
- this.getList();
- this.msgSuccess(this.$t('删除成功'));
- })
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams;
- this.$confirm(this.$t('是否确认导出所有工作票数据项?'), this.$t('警告'), {
- confirmButtonText: this.$t('确定'),
- cancelButtonText: this.$t('取消'),
- type: "warning"
- }).then(function () {
- return exportJobticket(queryParams);
- }).then(response => {
- this.download(response.msg);
- })
- },
- /** 导入按钮操作 */
- handleImport() {
- this.upload.title = this.$t('用户导入');
- this.upload.open = true;
- },
- /** 下载模板操作 */
- importTemplate() {
- this.$refs['downloadFileForm'].submit()
- },
- // 文件上传中处理
- handleFileUploadProgress(event, file, fileList) {
- this.upload.isUploading = true;
- },
- // 文件上传成功处理
- handleFileSuccess(response, file, fileList) {
- this.upload.open = false;
- this.upload.isUploading = false;
- this.$refs.upload.clearFiles();
- if (response.data[0] != null) {
- this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败') + "。", this.$t('导入结果'), {dangerouslyUseHTMLString: true});
- } else {
- this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), {dangerouslyUseHTMLString: true});
- }
- this.getList();
- },
- // 提交上传文件
- submitFileForm() {
- this.$refs.upload.submit();
- },
- //数据分析
- handleData() {
- this.drawer = true
- }
- }
- };
- </script>
- <style>
- .text {
- font-size: 14px;
- }
- .item {
- margin-bottom: 18px;
- }
- .clearfix {
- color: #1e1e1e;
- }
- .clearfix:before,
- .clearfix:after {
- display: table;
- content: "";
- }
- .clearfix:after {
- clear: both
- }
- .box-card {
- width: 100%;
- }
- .el-drawer__body {
- overflow: auto;
- }
- .el-drawer__container ::-webkit-scrollbar {
- display: none;
- }
- </style>
|