1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405 |
- <template>
- <div class="app-container">
- <el-form
- :model="queryParams"
- ref="queryForm"
- :inline="true"
- v-show="showSearch"
- label-width="68px"
- class="shouForm"
- >
- <el-form-item prop="unitname">
- <el-input
- placeholder="请输入单位"
- v-model="queryParams.unitname"
- @input="handleQuery"
- />
- </el-form-item>
- <el-form-item>
- <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
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['grassrootsregistration:bdgldrill: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="['grassrootsregistration:bdgldrill: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="['grassrootsregistration:bdgldrill: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="['grassrootsregistration:bdgldrill:export']"
- >导出</el-button
- >
- </el-col> -->
- </el-row>
- <el-table
- :data="bdgldrillList"
- @selection-change="handleSelectionChange"
- :header-cell-style="{ background: '#003C69', color: 'white' }"
- >
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="序号" align="center" prop="id">
- <template scope="scope">
- <span>{{
- (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="训练类别"
- align="center"
- prop="trainingCategory"
- />
- <el-table-column label="训练地点" align="center" prop="address" />
- <el-table-column
- label="训练时间"
- align="center"
- prop="drillTime"
- width="150"
- >
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.drillTime, "{y}-{m}-{d}") }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="训练结束时间"
- align="center"
- prop="drillEndtime"
- width="150"
- >
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.drillEndtime, "{y}-{m}-{d}") }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="单位"
- align="center"
- prop="unitname"
- width="200"
- />
- <!-- <el-table-column label="应训" align="center" prop="oughtTo" /> -->
- <el-table-column
- label="文件名称"
- align="center"
- prop="filename"
- show-overflow-tooltip
- />
- <el-table-column label="装备" align="center" prop="equipment" />
- <el-table-column label="弹药" align="center" prop="ammunition" />
- <el-table-column label="摩托时间" align="center" prop="mototime" />
- <el-table-column
- label="备注"
- align="center"
- prop="fail"
- show-overflow-tooltip
- />
- <!-- <el-table-column label="创建人id" align="center" prop="createId" /> -->
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- width="200"
- fixed="right"
- >
- <template slot-scope="scope">
- <el-button size="btk" type="text" @click="handleChakan(scope.row)"
- ><span class="chakan">查看</span></el-button
- >
- <el-button
- size="btu"
- type="text"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['grassrootsregistration:bdgldrill:edit']"
- >修改</el-button
- >
- <el-button
- size="btd"
- type="text"
- @click="handleDelete(scope.row)"
- v-hasPermi="['grassrootsregistration:bdgldrill: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="1060px"
- append-to-body
- :close-on-click-modal="false"
- >
- <el-form
- ref="form"
- :model="form"
- :rules="rules"
- :inline="true"
- label-width="120px"
- >
- <div class="jiben">基本信息</div>
- <el-form-item label="单位" prop="unitId">
- <treeselect
- @select="selectPeo"
- v-model="form.unitId"
- :options="rese"
- placeholder="请选择单位"
- />
- </el-form-item>
- <el-form-item
- label="训练类别"
- prop="trainingCategory"
- style="margin-left: 100px"
- >
- <treeselect
- v-model="form.trainingCategory"
- :options="treeselects"
- :normalizer="defaultProps"
- placeholder="请选择训练类别"
- @select="trainingCategoryselectPeo"
- />
- </el-form-item>
- <el-form-item
- label="证明材料"
- prop="project2"
- style="display: inline-block; width: 900px"
- >
- <fileUpload
- v-model="form.filepath"
- style="display: inline-block"
- :show-file-list="false"
- class="m-l-20"
- :limit="1"
- />
- </el-form-item>
- <el-form-item label="训练开始时间" prop="drillTime">
- <el-date-picker
- clearable
- size="small"
- v-model="form.drillTime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择训练开始时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item
- label="训练结束时间"
- prop="drillEndtime"
- style="margin-left: 130px"
- >
- <!-- <el-date-picker
- clearable
- size="small"
- v-model="form.drillEndtime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择训练结束时间"
- @change="drillTimechange"
- >
- </el-date-picker> -->
- <el-date-picker
- clearable
- size="small"
- v-model="form.drillEndtime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择训练结束时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="周工作内容" class="boxtext">
- <el-input
- type="textarea"
- :rows="2"
- placeholder="请输入内容"
- v-model="form.trainingContent"
- autosize
- >
- </el-input>
- </el-form-item>
- <el-row>
- <el-checkbox
- v-model="form.safety"
- style="
- margin-right: 80px;
- height: 40px;
- margin-left: 70px;
- color: #fff;
- "
- >安全训练</el-checkbox
- >
- <el-checkbox
- v-model="form.chiefOfficial"
- style="
- margin-right: 80px;
- height: 40px;
- margin-left: 70px;
- color: #fff;
- "
- >主官训练</el-checkbox
- >
- <el-checkbox
- v-model="form.targeted"
- style="
- margin-right: 80px;
- height: 40px;
- margin-left: 70px;
- color: #fff;
- "
- >针对性训练</el-checkbox
- >
- <el-checkbox
- v-model="form.system"
- style="
- margin-right: 80px;
- height: 40px;
- margin-left: 70px;
- color: #fff;
- "
- >系统性训练</el-checkbox
- >
- </el-row>
- <el-form-item label="地点" prop="address">
- <el-input v-model="form.address" placeholder="请输入训练地点" />
- </el-form-item>
- <el-form-item label="弹药" prop="ammunition">
- <el-input v-model="form.ammunition" placeholder="请输入弹药" />
- </el-form-item>
- <el-form-item label="摩托时间" prop="mototime">
- <el-input v-model="form.mototime" placeholder="请输入摩托时间" />
- </el-form-item>
- <el-form-item label="装备" prop="equipment">
- <el-input v-model="form.equipment" placeholder="请输入装备" />
- </el-form-item>
- <el-row>
- <el-checkbox
- v-model="form.assessment"
- @change="checkboxs"
- style="
- margin-right: 80px;
- height: 40px;
- margin-left: 70px;
- color: #fff;
- "
- >是否参加考核</el-checkbox
- >
- </el-row>
- <el-form-item label="应训(人数)" prop="yingxun">
- <el-input
- v-model.number="form.yingxun"
- placeholder="请输入应训人数"
- @change="yingxun"
- />
- </el-form-item>
- <el-form-item label="实训(人数)" prop="shixun">
- <el-input
- v-model.number="form.shixun"
- placeholder="请输入实训人数"
- @change="shixun"
- />
- </el-form-item>
- <el-form-item label="参训率" prop="participationRate">
- <el-input v-model="form.participationRate" placeholder="" disabled />
- </el-form-item>
- <el-form-item label="效果(成绩)" prop="pass">
- <el-input
- v-model="form.pass"
- placeholder="请输入效果成绩"
- :disabled="dilabled"
- />
- </el-form-item>
- <el-form-item label="消耗" prop="excellent">
- <el-input v-model="form.excellent" placeholder="请输入消耗" />
- </el-form-item>
- <div class="jiben">备注</div>
- <el-form-item label="" prop="fail">
- <el-input
- v-model="form.fail"
- type="textarea"
- placeholder="请输入内容"
- autosize
- />
- </el-form-item>
- <el-row>
- <el-button
- type="primary"
- plain
- icon="el-icon-plus"
- size="mini"
- @click="adddrillFus"
- style="margin-left: 0px; width: 100px; margin-bottom: 20px"
- >添加人员</el-button
- >
- </el-row>
- <el-table
- :data="drillFus"
- :header-cell-style="{ background: '#003C69', color: 'white' }"
- >
- <el-table-column label="姓名" align="center" prop="peopleId">
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.peopleId"
- placeholder=""
- filterable
- disabled
- >
- <el-option
- :label="item.name"
- v-for="(item, i) in renYuan"
- :key="i"
- :value="item.id"
- class="input_xiala"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- label="参训状态"
- align="center"
- prop="trainingStatus"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.trainingStatus"
- placeholder="请选择参训状态"
- filterable
- >
- <el-option
- v-for="dict in dict.type.military_training"
- :key="dict.value"
- :label="dict.label"
- :value="dict.label"
- class="input_xiala"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column label="状态" align="center" prop="state">
- <template slot-scope="scope">
- <el-button size="btd" type="text" @click="deldeitem(scope.$index)"
- ><span class="delete">删除</span></el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">确 定</el-button>
- <el-button @click="cancel" size="btn">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 修改军事训练登记薄 -->
- <el-dialog
- :title="title"
- :visible.sync="open1"
- width="1060px"
- append-to-body
- :close-on-click-modal="false"
- >
- <el-form
- ref="form"
- :model="form"
- :rules="rules"
- :inline="true"
- label-width="120px"
- >
- <div class="jiben">基本信息</div>
- <el-form-item label="单位" prop="unitId">
- <treeselect
- @select="selectPeo"
- v-model="form.unitId"
- :options="rese"
- placeholder="请选择单位"
- disabled
- />
- </el-form-item>
- <el-form-item
- label="训练类别"
- prop="trainingCategory"
- style="margin-left: 100px"
- >
- <!-- <el-input
- v-model="form.trainingCategory"
- placeholder="请输入训练类别"
- /> -->
- <treeselect
- v-model="form.trainingCategory"
- :options="treeselects"
- :normalizer="defaultProps"
- placeholder="请选择训练类别"
- @select="trainingCategoryselectPeo"
- />
- </el-form-item>
- <!-- <el-form-item label="训练项目" prop="project">
- <el-input v-model="form.project" placeholder="请输入训练项目" />
- </el-form-item> -->
- <el-form-item
- label="证明材料"
- prop="project2"
- style="display: inline-block; width: 900px"
- >
- <!-- <input
- type="text"
- v-model="form.filename"
- style="
- width: 280px;
- height: 36px;
- background: transparent;
- color: #fff;
- border: 1px solid #fff !important;
- display: inline-block;
- "
- /> -->
- <fileUpload
- v-model="form.filepath"
- style="display: inline-block"
- :show-file-list="false"
- class="m-l-20"
- :limit="1"
- />
- </el-form-item>
- <el-form-item label="训练开始时间" prop="drillTime">
- <el-date-picker
- clearable
- size="small"
- v-model="form.drillTime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择训练开始时间"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item
- label="训练结束时间"
- prop="drillEndtime"
- style="margin-left: 130px"
- >
- <el-date-picker
- clearable
- size="small"
- v-model="form.drillEndtime"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择训练结束时间"
- @change="drillTimechange"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="周工作内容" class="boxtext">
- <el-input
- type="textarea"
- placeholder="请输入内容"
- v-model="form.trainingContent"
- autosize
- >
- </el-input>
- <!-- <input
- v-model="nr"
- placeholder=""
- style="
- width: 810px;
- height: 36px;
- background: transparent;
- color: #fff;
- border: 1px solid #fff !important;
- "
- disabled
- /> -->
- </el-form-item>
- <el-row>
- <el-checkbox
- v-model="form.safety"
- style="
- margin-right: 80px;
- height: 40px;
- margin-left: 70px;
- color: #fff;
- "
- >安全训练</el-checkbox
- >
- <el-checkbox
- v-model="form.chiefOfficial"
- style="
- margin-right: 80px;
- height: 40px;
- margin-left: 70px;
- color: #fff;
- "
- >主官训练</el-checkbox
- >
- <el-checkbox
- v-model="form.targeted"
- style="
- margin-right: 80px;
- height: 40px;
- margin-left: 70px;
- color: #fff;
- "
- >针对性训练</el-checkbox
- >
- <el-checkbox
- v-model="form.system"
- style="
- margin-right: 80px;
- height: 40px;
- margin-left: 70px;
- color: #fff;
- "
- >系统性训练</el-checkbox
- >
- </el-row>
- <el-form-item label="地点" prop="address">
- <el-input v-model="form.address" placeholder="请输入训练地点" />
- </el-form-item>
- <el-form-item label="弹药" prop="ammunition">
- <el-input v-model="form.ammunition" placeholder="请输入弹药" />
- </el-form-item>
- <el-form-item label="摩托时间" prop="mototime">
- <el-input v-model="form.mototime" placeholder="请输入摩托时间" />
- </el-form-item>
- <el-form-item label="装备" prop="equipment">
- <el-input v-model="form.equipment" placeholder="请输入装备" />
- </el-form-item>
- <el-row>
- <el-checkbox
- v-model="form.assessment"
- @change="checkboxs"
- style="
- margin-right: 80px;
- height: 40px;
- margin-left: 70px;
- color: #fff;
- "
- >是否参加考核</el-checkbox
- >
- </el-row>
- <el-form-item label="应训(人数)" prop="yingxun">
- <el-input
- v-model.number="form.yingxun"
- placeholder="请输入应训人数"
- @change="yingxun"
- />
- </el-form-item>
- <el-form-item label="实训(人数)" prop="shixun">
- <el-input
- v-model.number="form.shixun"
- placeholder="请输入实训人数"
- @change="shixun"
- />
- </el-form-item>
- <el-form-item label="参训率" prop="participationRate">
- <el-input v-model="form.participationRate" placeholder="" disabled />
- </el-form-item>
- <el-form-item label="效果(成绩)" prop="pass">
- <el-input
- v-model="form.pass"
- placeholder="请输入效果成绩"
- :disabled="dilabled"
- />
- </el-form-item>
- <el-form-item label="消耗" prop="excellent">
- <el-input v-model="form.excellent" placeholder="请输入消耗" />
- </el-form-item>
- <div class="jiben">备注</div>
- <el-form-item label="" prop="fail">
- <el-input
- v-model="form.fail"
- type="textarea"
- placeholder="请输入内容"
- autosize
- />
- </el-form-item>
- <el-row>
- <el-button
- type="primary"
- plain
- icon="el-icon-plus"
- size="mini"
- @click="adddrillFus"
- style="margin-left: 0px; width: 100px; margin-bottom: 20px"
- >添加人员</el-button
- >
- </el-row>
- <el-table
- :data="drillFus"
- :header-cell-style="{ background: '#003C69', color: 'white' }"
- >
- <el-table-column label="姓名" align="center" prop="peopleId">
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.peopleId"
- placeholder=""
- filterable
- disabled
- >
- <el-option
- :label="item.name"
- v-for="(item, i) in renYuan"
- :key="i"
- :value="item.id"
- class="input_xiala"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- label="参训状态"
- align="center"
- prop="trainingStatus"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.trainingStatus"
- placeholder="请选择参训状态"
- filterable
- >
- <el-option
- v-for="dict in dict.type.military_training"
- :key="dict.value"
- :label="dict.label"
- :value="dict.label"
- class="input_xiala"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column label="状态" align="center" prop="state">
- <template slot-scope="scope">
- <el-button
- size="btd"
- type="text"
- @click="deldeitem1(scope.$index, scope.row)"
- ><span class="delete">删除</span></el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">确 定</el-button>
- <el-button @click="cancel" size="btn">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 查看表格 -->
- <div class="fff">
- <el-dialog
- :visible.sync="menuRoleVisible"
- :title="title"
- append-to-body
- id="chakan"
- :close-on-click-modal="false"
- width="1060px"
- >
- <bdgldrill
- v-if="menuRoleVisible"
- ref="menuRole"
- :message="wordInfo"
- ></bdgldrill>
- </el-dialog>
- </div>
- <!-- 添加人员弹出层 -->
- <el-dialog
- title="添加人员"
- :visible.sync="open2"
- width="750px"
- append-to-body
- :close-on-click-modal="false"
- custom-class="boxs"
- >
- <el-transfer
- v-model="arr1"
- :data="renYuan"
- :props="{
- key: 'id',
- label: 'name',
- }"
- :titles="['全部人员', '已添加人员']"
- ></el-transfer>
- <div slot="footer" class="dialog-footer" style="margin-right: 28px">
- <el-button type="primary" @click="submitForm3">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- listBdgldrill,
- getBdgldrill,
- delBdgldrill,
- addBdgldrill,
- updateBdgldrill,
- exportBdgldrill,
- treeselect,
- getweekwork,
- drillFu,
- treeselects,
- getInfoByUnitId,
- } from "@/api/grassrootsregistration/bdgldrill";
- import bdgldrill from "@/components/look_word/bdgldrill.vue";
- // 导入树形结构
- import Treeselect from "@riophae/vue-treeselect";
- import "@riophae/vue-treeselect/dist/vue-treeselect.css";
- import {
- getDept,
- getZhuChiRen,
- getDept2,
- } from "@/api/grassrootsregistration/bdglmeeting";
- export default {
- name: "Bdgldrill",
- components: { Treeselect, bdgldrill },
- dicts: ["military_training"],
- data() {
- return {
- // 遮罩层
- loading: true,
- // 导出遮罩层
- exportLoading: false,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 军事训练登记簿表格数据
- bdgldrillList: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- project: null,
- drillTime: null,
- address: null,
- oughtTo: null,
- filename: null,
- filepath: null,
- equipment: null,
- ammunition: null,
- mototime: null,
- drillEndtime: null,
- unitId: null,
- trainingCategory: null,
- createtime: null,
- createId: null,
- },
- // 表单参数
- form: {
- safety: false,
- chiefOfficial: false,
- targeted: false,
- system: false,
- assessment: false,
- },
- // 表单校验
- rules: {
- unitId: [{ required: true, message: "请选择单位", trigger: "blur" }],
- },
- cities: ["安全训练"],
- cities2: ["主官组训施教"],
- cities3: ["针对性训练"],
- cities4: ["使用模拟训练系统"],
- checkedCities: [],
- checkedCities2: [],
- checkedCities3: [],
- checkedCities4: [],
- checkedCities5: [],
- drillFus: [],
- formdrillFus: {
- peopleName: "",
- state: "",
- trainingStatus: "",
- },
- open2: false,
- rese: [],
- renYuan: [],
- treeselects: [],
- defaultProps(node) {
- return {
- children: node.children,
- label: node.ancestors,
- };
- },
- menuRoleVisible: false,
- wordInfo: [],
- nr: null,
- fiel: [],
- // 修改弹出层的显示与隐藏
- open1: false,
- // 是否禁用效果成绩输入框
- dilabled: true,
- // 添加人员弹出层
- open2: false,
- arr1: [],
- falg: null,
- };
- },
- created() {
- this.getList();
- treeselect().then((res) => {
- this.treeselects = res.rows;
- });
- },
- methods: {
- // 添加人员确定
- submitForm3() {
- this.open2 = false;
- this.arr1.forEach((item) => {
- this.drillFus.push({
- peopleId: item,
- state: "",
- trainingStatus: "",
- });
- });
- for (var i = 0; i < this.drillFus.length - 1; i++) {
- for (var j = i + 1; j < this.drillFus.length; j++) {
- if (this.drillFus[i].peopleId == this.drillFus[j].peopleId) {
- this.drillFus.splice(j, 1);
- j--;
- }
- }
- }
- },
- // 应训人数触发
- yingxun() {
- if (this.form.yingxun && this.form.shixun) {
- var num = (this.form.shixun / this.form.yingxun) * 100;
- num = num.toFixed(2) + "%";
- this.$set(this.form, "participationRate", num);
- }
- },
- // 实训人数触发
- shixun() {
- if (this.form.yingxun && this.form.shixun) {
- var num = (this.form.shixun / this.form.yingxun) * 100;
- num = num.toFixed(2) + "%";
- this.$set(this.form, "participationRate", num);
- }
- },
- // 是否参加考核触发
- checkboxs(data) {
- this.dilabled = !data;
- if (!data) {
- this.form.pass = null;
- }
- },
- // 获取全部单位树形
- getQuanShu() {
- getDept2().then((res) => {
- this.rese = res.data;
- });
- },
- // 点击删除删除循环出来的当前数据
- deldeitem(row) {
- this.drillFus.splice(row.ids, 1);
- },
- // 修改中的删除循环数据
- deldeitem1(row, rows) {
- this.drillFus.splice(row.ids, 1);
- drillFu(rows.id).then((res) => {});
- },
- /** 查询军事训练登记簿列表 */
- getList() {
- this.loading = true;
- listBdgldrill(this.queryParams).then((response) => {
- this.bdgldrillList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.open2 = false;
- this.open1 = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- id: null,
- project: null,
- drillTime: null,
- address: null,
- oughtTo: null,
- filename: null,
- filepath: null,
- equipment: null,
- ammunition: null,
- mototime: null,
- remark: null,
- drillEndtime: null,
- unitId: null,
- trainingCategory: null,
- createtime: null,
- createId: null,
- };
- this.formdrillFus = {
- peopleName: null,
- state: null,
- trainingStatus: null,
- ids: null,
- };
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- 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.reset();
- this.open = true;
- this.getTreeselect();
- this.title = "添加军事训练登记簿";
- this.drillFus = [];
- this.nr = null;
- this.arr1 = [];
- this.falg = true;
- },
- //查看按钮操作
- handleChakan(row) {
- let unitId = row.unitId;
- // 是否隐藏按钮
- this.reset();
- // const id = row.id || this.ids;
- getInfoByUnitId(unitId).then((response) => {
- this.wordInfo = response.rows;
- this.title = "军事训练登记簿";
- this.menuRoleVisible = true;
- });
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.nr = null;
- this.falg = false;
- this.arr1 = [];
- this.reset();
- this.getQuanShu();
- const id = row.id || this.ids;
- getBdgldrill(id).then((response) => {
- this.form = response.data;
- if (response.data.filename != null || response.data.filepath != null) {
- this.fiel = [
- {
- name: response.data.filename,
- url: response.data.filepath,
- },
- ];
- this.form.filepath = this.fiel;
- }
- if (this.form.safety == 1) {
- this.form.safety = true;
- } else {
- this.form.safety = false;
- }
- if (this.form.chiefOfficial == 1) {
- this.form.chiefOfficial = true;
- } else {
- this.form.chiefOfficial = false;
- }
- if (this.form.targeted == 1) {
- this.form.targeted = true;
- } else {
- this.form.targeted = false;
- }
- if (this.form.system == 1) {
- this.form.system = true;
- } else {
- this.form.system = false;
- }
- if (this.form.assessment == 1) {
- this.form.assessment = true;
- } else {
- this.form.assessment = false;
- }
- this.nr = response.data.common;
- this.drillFus = response.data.drillFus;
- this.getRen(response.data.unitId);
- this.open1 = true;
- this.title = "修改军事训练登记簿";
- });
- },
- /** 提交按钮 */
- submitForm() {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- if (this.form.filepath) {
- if (typeof this.form.filepath != "string") {
- let documentProofs = this.form.filepath;
- this.form.filepath = documentProofs[0].url;
- this.form.filename = documentProofs[0].name;
- }
- }
- this.form.drillFus = this.drillFus;
- if (this.form.safety) {
- this.form.safety = 1;
- } else {
- this.form.safety = 0;
- }
- if (this.form.chiefOfficial) {
- this.form.chiefOfficial = 1;
- } else {
- this.form.chiefOfficial = 0;
- }
- if (this.form.targeted) {
- this.form.targeted = 1;
- } else {
- this.form.targeted = 0;
- }
- if (this.form.system) {
- this.form.system = 1;
- } else {
- this.form.system = 0;
- }
- if (this.form.assessment) {
- this.form.assessment = 1;
- } else {
- this.form.assessment = 0;
- }
- if (this.form.id != null) {
- updateBdgldrill(this.form).then((response) => {
- this.$modal.msgSuccess("修改成功");
- this.open1 = false;
- this.getList();
- });
- } else {
- console.log(this.form);
- addBdgldrill(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 delBdgldrill(ids);
- })
- .then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- })
- .catch(() => {});
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams;
- this.$modal
- .confirm("是否确认导出所有军事训练登记簿数据项?")
- .then(() => {
- this.exportLoading = true;
- return exportBdgldrill(queryParams);
- })
- .then((response) => {
- this.$download.name(response.msg);
- this.exportLoading = false;
- })
- .catch(() => {});
- },
- // 新增人员
- adddrillFus() {
- this.open2 = true;
- if (this.falg) {
- console.log(1);
- this.renYuan.map((item, i) => {
- if (this.drillFu) {
- if (item.id == this.drillFu[i]) {
- this.arr1[i] = item;
- }
- }
- return this.arr1;
- });
- } else if (this.falg == false) {
- // this.arr1=this.drillFus
- this.drillFus.forEach((item=>{
- this.arr1.push(item.peopleId)
- }))
- }
- },
- submitForm2() {
- this.drillFus.push(this.formdrillFus);
- this.open = true;
- this.open2 = false;
- },
- cancel2() {
- this.open = true;
- this.open2 = false;
- this.reset();
- },
- handleCheckedCitiesChange() {},
- /** 新增查询部门下拉树结构 */
- getTreeselect() {
- getDept().then((response) => {
- this.rese = response.data;
- });
- },
- // 单位选择触发
- selectPeo(data) {
- this.form.unitname = data.label;
- this.getRen(data.id);
- },
- // 获取人员
- getRen(id) {
- getZhuChiRen(id).then((res) => {
- this.renYuan = res.data;
- });
- },
- trainingCategoryselectPeo(val) {},
- // 训练开始时间触发
- drillTimechange() {
- if (this.form.drillTime && this.form.drillEndtime && this.form.unitId) {
- getweekwork({
- drillTime: this.form.drillTime,
- drillEndtime: this.form.drillEndtime,
- unitId: this.form.unitId,
- }).then((res) => {
- this.nr = "";
- res.data.map((item, i) => {
- if (i == 0) {
- this.nr += item.contents;
- } else {
- this.nr += "," + item.contents;
- }
- });
- });
- }
- },
- },
- };
- </script>
- <style scoped>
- ::v-deep .el-dialog {
- /* width: 1060px !important; */
- background-color: #004d86;
- margin: auto;
- }
- ::v-deep .el-dialog__header {
- border-bottom: 1px solid #718a9d;
- margin: auto;
- }
- ::v-deep .el-dialog__title {
- color: #fff;
- font: 18px;
- }
- ::v-deep .el-dialog__headerbtn .el-dialog__close {
- color: #fff;
- }
- ::v-deep .el-form-item__label {
- font: 16px;
- color: #fff;
- width: 100px !important;
- }
- .el-form-item ::v-deep .el-input__inner {
- width: 350px;
- height: 36px;
- background: transparent;
- color: #fff;
- border: 1px solid #fff !important;
- }
- ::v-deep .vue-treeselect__control {
- background: #004d86 !important;
- color: #fff !important;
- }
- ::v-deep .vue-treeselect__control {
- width: 250px;
- color: #fff !important;
- }
- /* ::v-deep .el-textarea__inner {
- width: 920px;
- height: 104px;
- }
- ::v-deep .el-select-dropdown__list {
- border: none;
- }
- .el-date-table,
- .el-select-dropdown__item {
- color: #fff;
- }
- .el-select-dropdown__item.hover,
- .el-select-dropdown__item:hover {
- background-color: #196299;
- } */
- ::v-deep .el-upload__tip {
- display: none;
- }
- /* 去掉上面的线 */
- /* ::v-deep .el-dialog .el-table th.is-leaf {
- border: 1px solid white !important;
- } */
- /* 去掉最下面的那一条线 */
- /* ::v-deep .el-dialog .el-table::before {
- border: 1px solid white !important;
- } */
- /* 去掉表格内的线 */
- /* ::v-deep .el-dialog table td {
- border: 1px solid white !important;
- } */
- ::v-deep .el-upload-list {
- display: inline-block;
- margin-left: 10px;
- }
- ::v-deep .upload-file-uploader {
- display: inline-block;
- }
- ::v-deep .vue-treeselect__single-value {
- color: #fff !important;
- }
- ::v-deep .el-link--inner .el-icon-document {
- color: #fff !important;
- }
- ::v-deep .el-input--medium .el-input__inner {
- background: transparent;
- color: #fff;
- }
- ::v-deep .vue-treeselect--single .vue-treeselect__input {
- color: #fff;
- }
- ::v-deep .el-textarea__inner {
- width: 920px;
- margin: auto;
- min-height: 120px !important;
- }
- #chakan /deep/ .el-dialog__body {
- padding: 30px 64px;
- margin-left: 39px;
- }
- .shouForm /deep/ .el-input__inner {
- width: 220px;
- }
- ::v-deep .boxtext .el-textarea__inner {
- width: 810px;
- }
- ::v-deep .el-dialog__body {
- margin-left: 53px;
- }
- ::v-deep .el-form .el-table {
- width: 921px;
- }
- ::v-deep .el-dialog__footer {
- margin-right: 47px;
- }
- ::v-deep
- .el-transfer-panel
- .el-transfer-panel__header
- .el-checkbox
- .el-checkbox__label
- span {
- color: #fff;
- }
- ::v-deep .el-transfer-panel__item.el-checkbox {
- color: #fff;
- }
- ::v-deep
- .el-transfer-panel
- .el-transfer-panel__header
- .el-checkbox
- .el-checkbox__label {
- color: #fff;
- }
- ::v-deep
- .el-transfer-panel
- .el-transfer-panel__header
- .el-checkbox
- .el-checkbox__label {
- color: #fff;
- }
- ::v-deep .el-transfer-panel {
- background: rgba(255, 255, 255, 0.2);
- }
- ::v-deep .el-transfer-panel .el-transfer-panel__header {
- background: rgba(255, 255, 255, 0.2);
- }
- ::v-deep .el-transfer-panel .el-transfer-panel__empty {
- color: #fff;
- }
- ::v-deep .boxs .el-dialog__body{
- margin-left: 59px;
- }
- </style>
|