123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993 |
- <template>
- <div class="mainContentBox">
- <avue-crud
- ref="crudRef"
- v-model:search="search"
- v-model="form"
- :data="data"
- :option="option"
- v-model:page="page"
- @row-save="createRow"
- @row-update="updateRow"
- @row-del="deleteRow"
- @search-change="searchChange"
- @search-reset="resetChange"
- @size-change="dataList"
- @current-change="dataList"
- @selection-change="selectionChange"
- >
- <template #menu-left="{ size }">
- <el-button
- :disabled="toDeleteIds.length < 1"
- type="danger"
- icon="el-icon-delete"
- :size="size"
- v-hasPerm="[ButtonPermKeys.DEVICE.BTNS.allocate_del]"
- @click="multipleDelete"
- >删除</el-button
- >
- </template>
- <template #menu="{ size, row, index }">
- <el-button
- @click="maintenance(row, 0, false)"
- icon="el-icon-check"
- text
- v-hasPerm="[ButtonPermKeys.DEVICE.BTNS.allocate_audit]"
- type="primary"
- :size="size"
- >流程</el-button
- >
- <el-button
- @click="maintenance(row, 1, true)"
- icon="el-icon-fold"
- text
- type="primary"
- :size="size"
- >记录</el-button
- >
- <el-button
- @click="handleExport(row)"
- icon="el-icon-download"
- text
- v-hasPerm="[ButtonPermKeys.DEVICE.BTNS.allocate_export]"
- type="primary"
- :size="size"
- >导出履历</el-button
- >
- </template>
- </avue-crud>
- <el-dialog
- v-model="dialog.visible"
- :title="dialog.title"
- width="850px"
- @close="dialog.visible = false"
- >
- <device-page @device-info="deviceInfo" />
- </el-dialog>
- <el-dialog
- v-model="dialog1.visible"
- :title="dialog1.title"
- width="750px"
- height="80%"
- @close="dialog1.visible = false"
- >
- <el-timeline style="max-width: 500px; margin-left: 100px">
- <el-timeline-item center type="success" placement="top">
- <el-card>
- <h4>调拨申请</h4>
- <p>设备编号: {{ maintenanceInfo.deviceNo }}</p>
- <p>设备名称: {{ maintenanceInfo.deviceName }}</p>
- <p>新责任人: {{ maintenanceInfo.newHead }}</p>
- <p>申请人员: {{ maintenanceInfo.creator }}</p>
- <!-- <p>调拨周期: {{maintenanceInfo.allocateCycle}}天</p>-->
- <p>调拨目标位置: {{ maintenanceInfo.deviceToPosition }}</p>
- <p>申请时间: {{ maintenanceInfo.created }}</p>
- <el-form-item label="是否需要公司分管领导审批">
- <el-radio-group
- :disabled="
- maintenanceInfo.state > 8 || maintenanceInfo.disabled == true
- "
- v-model="maintenanceInfo.isApprove"
- class="ml-4"
- @change="showCard"
- >
- <el-radio :value="0">否</el-radio>
- <el-radio :value="1">是</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-card>
- </el-timeline-item>
- <el-timeline-item
- center
- placement="top"
- :type="
- maintenanceInfo.state === 0
- ? 'primary'
- : maintenanceInfo.state === 0
- ? 'info'
- : 'success'
- "
- >
- <el-card v-if="viewPage">
- <h4>调出部门领导</h4>
- <p>审批人员: {{ maintenanceInfo.auditUser }}</p>
- <p>审批意见: {{ maintenanceInfo.auditOpinion }}</p>
- <p>
- 审批结果:
- {{
- maintenanceInfo.auditUser
- ? maintenanceInfo.auditResult === 0
- ? "通过"
- : "不通过"
- : ""
- }}
- </p>
- <p>审批时间: {{ maintenanceInfo.auditTime }}</p>
- </el-card>
- <el-card v-if="!viewPage">
- <h4>调出部门领导</h4>
- <el-form
- ref="maintenanceInfoForm"
- :model="maintenanceInfo"
- label-width="auto"
- style="max-width: 400px"
- :rules="rules"
- >
- <el-form-item label="审批意见" prop="auditOpinion">
- <el-input
- :disabled="maintenanceInfo.state !== 0"
- type="textarea"
- :rows="2"
- v-model="maintenanceInfo.auditOpinion"
- />
- </el-form-item>
- <el-form-item label="审批人员" prop="auditUser">
- <el-select
- :disabled="maintenanceInfo.state !== 0"
- v-model="maintenanceInfo.auditUser"
- filterable
- placeholder="审批人员"
- >
- <el-option
- v-for="item in userList"
- :key="item.userName"
- :label="item.userName"
- :value="item.userName"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="审批结果">
- <el-radio-group
- :disabled="maintenanceInfo.state !== 0"
- v-model="maintenanceInfo.auditResult"
- class="ml-4"
- >
- <el-radio :value="0">通过</el-radio>
- <el-radio :value="1">驳回</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item style="margin-left: 45%">
- <el-button
- type="primary"
- v-if="maintenanceInfo.state === 0"
- @click="maintenanceSubmit"
- >保存</el-button
- >
- </el-form-item>
- </el-form>
- </el-card>
- </el-timeline-item>
- <el-timeline-item
- center
- placement="top"
- :type="
- maintenanceInfo.state === 2
- ? 'primary'
- : maintenanceInfo.state < 2
- ? 'info'
- : 'success'
- "
- >
- <el-card v-if="viewPage">
- <h4>调入部门领导</h4>
- <p>审批人员: {{ maintenanceInfo.auditUser1 }}</p>
- <p>
- 审批结果:
- {{
- maintenanceInfo.auditUser1
- ? maintenanceInfo.auditResult1 === 0
- ? "通过"
- : "不通过"
- : ""
- }}
- </p>
- <p>审批意见: {{ maintenanceInfo.auditOpinion1 }}</p>
- <p>审批时间: {{ maintenanceInfo.auditTime1 }}</p>
- </el-card>
- <el-card v-if="!viewPage">
- <h4>调入部门领导</h4>
- <el-form
- ref="maintenanceInfoForm1"
- v-if="maintenanceInfo.state >= 2"
- :model="maintenanceInfo"
- label-width="auto"
- style="max-width: 400px"
- :rules="rules"
- >
- <el-form-item label="审批意见" prop="auditOpinion1">
- <el-input
- :disabled="maintenanceInfo.state !== 2"
- type="textarea"
- :rows="2"
- v-model="maintenanceInfo.auditOpinion1"
- />
- </el-form-item>
- <el-form-item label="审批人员" prop="auditUser1">
- <el-select
- :disabled="maintenanceInfo.state !== 2"
- v-model="maintenanceInfo.auditUser1"
- filterable
- placeholder="审批人员"
- >
- <el-option
- v-for="item in userList"
- :key="item.userName"
- :label="item.userName"
- :value="item.userName"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="审批结果">
- <el-radio-group
- :disabled="maintenanceInfo.state !== 2"
- v-model="maintenanceInfo.auditResult1"
- class="ml-4"
- >
- <el-radio :value="0">通过</el-radio>
- <el-radio :value="1">驳回</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item style="margin-left: 45%">
- <el-button
- type="primary"
- v-if="maintenanceInfo.state === 2"
- @click="maintenanceSubmit1"
- >保存</el-button
- >
- </el-form-item>
- </el-form>
- </el-card>
- </el-timeline-item>
- <el-timeline-item
- center
- placement="top"
- :type="
- maintenanceInfo.state === 4
- ? 'primary'
- : maintenanceInfo.state < 4
- ? 'info'
- : 'success'
- "
- >
- <el-card v-if="viewPage">
- <h4>科研生产部设备管理员</h4>
- <p>审批人员: {{ maintenanceInfo.auditUser2 }}</p>
- <p>审批意见: {{ maintenanceInfo.auditOpinion2 }}</p>
- <p>
- 审批结果:
- {{
- maintenanceInfo.auditUser2
- ? maintenanceInfo.auditResult2 === 0
- ? "通过"
- : "不通过"
- : ""
- }}
- </p>
- <p>审批时间: {{ maintenanceInfo.auditTime2 }}</p>
- </el-card>
- <el-card v-if="!viewPage">
- <h4>科研生产部设备管理员</h4>
- <el-form
- ref="maintenanceInfoForm2"
- v-if="maintenanceInfo.state >= 4"
- :model="maintenanceInfo"
- label-width="auto"
- style="max-width: 400px"
- :rules="rules"
- >
- <el-form-item label="审批意见" prop="auditOpinion2">
- <el-input
- :disabled="maintenanceInfo.state !== 4"
- type="textarea"
- :rows="2"
- v-model="maintenanceInfo.auditOpinion2"
- />
- </el-form-item>
- <el-form-item label="审批人员" prop="auditUser2">
- <el-select
- :disabled="maintenanceInfo.state !== 4"
- v-model="maintenanceInfo.auditUser2"
- filterable
- placeholder="审批人员"
- >
- <el-option
- v-for="item in userList"
- :key="item.userName"
- :label="item.userName"
- :value="item.userName"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="审批结果">
- <el-radio-group
- :disabled="maintenanceInfo.state !== 4"
- v-model="maintenanceInfo.auditResult2"
- class="ml-4"
- >
- <el-radio :value="0">通过</el-radio>
- <el-radio :value="1">驳回</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item style="margin-left: 45%">
- <el-button
- type="primary"
- v-if="maintenanceInfo.state === 4"
- @click="maintenanceSubmit2"
- >保存</el-button
- >
- </el-form-item>
- </el-form>
- </el-card>
- </el-timeline-item>
- <el-timeline-item
- center
- placement="top"
- :type="
- maintenanceInfo.state === 6
- ? 'primary'
- : maintenanceInfo.state < 6
- ? 'info'
- : 'success'
- "
- >
- <el-card v-if="viewPage">
- <h4>科研生产部负责人</h4>
- <p>审批人员: {{ maintenanceInfo.auditUser3 }}</p>
- <p>审批意见: {{ maintenanceInfo.auditOpinion3 }}</p>
- <p>
- 审批结果:
- {{
- maintenanceInfo.auditUser3
- ? maintenanceInfo.auditResult3 === 0
- ? "通过"
- : "不通过"
- : ""
- }}
- </p>
- <p>审批时间: {{ maintenanceInfo.auditTime3 }}</p>
- </el-card>
- <el-card v-if="!viewPage">
- <h4>科研生产部负责人</h4>
- <el-form
- ref="maintenanceInfoForm3"
- v-if="maintenanceInfo.state >= 6"
- :model="maintenanceInfo"
- label-width="auto"
- style="max-width: 400px"
- :rules="rules"
- >
- <el-form-item label="审批意见" prop="auditOpinion3">
- <el-input
- :disabled="maintenanceInfo.state !== 6"
- type="textarea"
- :rows="2"
- v-model="maintenanceInfo.auditOpinion3"
- />
- </el-form-item>
- <el-form-item label="审批人员" prop="auditUser3">
- <el-select
- :disabled="maintenanceInfo.state !== 6"
- v-model="maintenanceInfo.auditUser3"
- filterable
- placeholder="审批人员"
- >
- <el-option
- v-for="item in userList"
- :key="item.userName"
- :label="item.userName"
- :value="item.userName"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="审批结果">
- <el-radio-group
- :disabled="maintenanceInfo.state !== 6"
- v-model="maintenanceInfo.auditResult3"
- class="ml-4"
- >
- <el-radio :value="0">通过</el-radio>
- <el-radio :value="1">驳回</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item style="margin-left: 45%">
- <el-button
- type="primary"
- v-if="maintenanceInfo.state === 6"
- @click="maintenanceSubmit3"
- >保存</el-button
- >
- </el-form-item>
- </el-form>
- </el-card>
- </el-timeline-item>
- <el-timeline-item
- center
- placement="top"
- v-show="showItem"
- :type="
- maintenanceInfo.state === 8
- ? 'primary'
- : maintenanceInfo.state < 8
- ? 'info'
- : 'success'
- "
- >
- <el-card v-if="viewPage">
- <h4>公司分管领导</h4>
- <p>审批人员: {{ maintenanceInfo.auditUser4 }}</p>
- <p>审批意见: {{ maintenanceInfo.auditOpinion4 }}</p>
- <p>
- 审批结果:
- {{
- maintenanceInfo.auditUser4
- ? maintenanceInfo.auditResult4 === 0
- ? "通过"
- : "不通过"
- : ""
- }}
- </p>
- <p>审批时间: {{ maintenanceInfo.auditTime4 }}</p>
- </el-card>
- <el-card v-if="!viewPage">
- <h4>公司分管领导</h4>
- <el-form
- ref="maintenanceInfoForm4"
- v-if="maintenanceInfo.state >= 8"
- :model="maintenanceInfo"
- label-width="auto"
- style="max-width: 400px"
- :rules="rules"
- >
- <el-form-item label="审批意见" prop="auditOpinion4">
- <el-input
- :disabled="maintenanceInfo.state !== 8"
- type="textarea"
- :rows="2"
- v-model="maintenanceInfo.auditOpinion4"
- />
- </el-form-item>
- <el-form-item label="审批人员" prop="auditUser4">
- <el-select
- :disabled="maintenanceInfo.state !== 8"
- v-model="maintenanceInfo.auditUser4"
- filterable
- placeholder="审批人员"
- >
- <el-option
- v-for="item in userList"
- :key="item.userName"
- :label="item.userName"
- :value="item.userName"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="审批结果">
- <el-radio-group
- :disabled="maintenanceInfo.state !== 8"
- v-model="maintenanceInfo.auditResult4"
- class="ml-4"
- >
- <el-radio :value="0">通过</el-radio>
- <el-radio :value="1">驳回</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item style="margin-left: 45%">
- <el-button
- type="primary"
- v-if="maintenanceInfo.state === 8"
- @click="maintenanceSubmit4"
- >保存</el-button
- >
- </el-form-item>
- </el-form>
- </el-card>
- </el-timeline-item>
- </el-timeline>
- </el-dialog>
- </div>
- </template>
- <script setup>
- import { ref, getCurrentInstance } from "vue";
- import { useCrud } from "@/hooks/userCrud";
- import ButtonPermKeys from "@/common/configs/buttonPermission";
- import { checkPerm } from "@/directive/permission";
- import { getUserList } from "@/api/system/user";
- import { allocateAudit, allocateExport } from "@/api/device/index";
- import { useCommonStoreHook } from "@/store";
- import dictDataUtil from "@/common/configs/dictDataUtil";
- const { isShowTable, tableType } = toRefs(useCommonStoreHook());
- const showItem = ref(false);
- const test = () => {
- isShowTable.value = true;
- tableType.value = tableType.value == 1 ? 2 : 1;
- };
- const permission = reactive({
- delBtn: checkPerm(ButtonPermKeys.DEVICE.BTNS.allocate_del),
- addBtn: checkPerm(ButtonPermKeys.DEVICE.BTNS.allocate_add),
- editBtn: checkPerm(ButtonPermKeys.DEVICE.BTNS.allocate_edit),
- menu: true,
- });
- const viewPage = ref(true);
- const dialog = reactive({
- title: "设备选择",
- visible: false,
- });
- const dialog1 = reactive({
- title: "调拨详情",
- visible: false,
- });
- const userList = ref([]);
- // 传入一个url,后面不带/
- const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
- useCrud({
- src: "/api/v1/device/allocate",
- });
- const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
- Methords; //增删改查
- const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
- const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
- const crudRef = ref(null); //crudRef.value 获取avue-crud对象
- const deviceInfo = (value) => {
- form.value.deviceNo = value.deviceNo;
- form.value.deviceName = value.deviceName;
- form.value.deviceType = value.deviceType;
- form.value.devicePosition = value.devicePosition;
- form.value.oldHead = value.head;
- form.value.devicePosition = value.devicePosition;
- form.value.oldDept = value.deptId;
- dialog.visible = false;
- form.value.serialNumber = value.serialNumber;
- form.value.originalValue = value.originalValue;
- form.value.specifications = value.specifications;
- };
- const showCard = () => {
- if (maintenanceInfo.value.isApprove === 1) {
- showItem.value = true;
- }
- if (maintenanceInfo.value.isApprove === 0) {
- showItem.value = false;
- }
- };
- const maintenanceInfo = ref({});
- const maintenance = (row, type, status) => {
- viewPage.value = type === 0 ? false : true;
- maintenanceInfo.value = row;
- maintenanceInfo.value.disabled = status;
- dialog1.visible = true;
- if (null == maintenanceInfo.value.auditResult) {
- maintenanceInfo.value.auditResult = 0;
- }
- if (null == maintenanceInfo.value.isApprove) {
- maintenanceInfo.value.isApprove = 0;
- }
- if (null == maintenanceInfo.value.auditResult1) {
- maintenanceInfo.value.auditResult1 = 0;
- }
- if (null == maintenanceInfo.value.auditResult2) {
- maintenanceInfo.value.auditResult2 = 0;
- }
- if (null == maintenanceInfo.value.auditResult3) {
- maintenanceInfo.value.auditResult3 = 0;
- }
- if (null == maintenanceInfo.value.auditResult4) {
- maintenanceInfo.value.auditResult4 = 0;
- }
- };
- const queryUserList = () => {
- getUserList({}).then((data) => {
- userList.value = data.data;
- });
- };
- const handleExport = (row) => {
- allocateExport(row.deviceNo).then((response) => {
- downFile(response);
- });
- };
- /** 文件下载 */
- const downFile = (response) => {
- const fileData = response.data;
- const fileName = decodeURI(
- response.headers["content-disposition"].split(";")[1].split("=")[1]
- );
- const fileType =
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
- const blob = new Blob([fileData], { type: fileType });
- const downloadUrl = window.URL.createObjectURL(blob);
- const downloadLink = document.createElement("a");
- downloadLink.href = downloadUrl;
- downloadLink.download = fileName;
- document.body.appendChild(downloadLink);
- downloadLink.click();
- document.body.removeChild(downloadLink);
- window.URL.revokeObjectURL(downloadUrl);
- };
- const maintenanceInfoForm = ref("maintenanceInfoForm");
- const maintenanceInfoForms = ref("maintenanceInfoForms");
- const maintenanceInfoForm1 = ref("maintenanceInfoForm1");
- const maintenanceInfoForm2 = ref("maintenanceInfoForm2");
- const maintenanceInfoForm3 = ref("maintenanceInfoForm3");
- const maintenanceInfoForm4 = ref("maintenanceInfoForm4");
- const maintenanceSubmit = () => {
- //alert(JSON.stringify(maintenanceInfo.value))
- maintenanceInfoForm.value.validate((isValid, invalidFields) => {
- if (isValid) {
- allocateAudit(maintenanceInfo.value).then((data) => {
- ElMessage({
- message: data.msg,
- type: "success",
- });
- dialog1.visible = false;
- dataList();
- });
- }
- });
- };
- const maintenanceSubmit1 = () => {
- //alert(JSON.stringify(maintenanceInfo.value))
- maintenanceInfoForm1.value.validate((isValid, invalidFields) => {
- if (isValid) {
- maintenanceInfo.value.auditResult = maintenanceInfo.value.auditResult1;
- maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion1;
- maintenanceInfo.value.auditUser = maintenanceInfo.value.auditUser1;
- maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion1;
- allocateAudit(maintenanceInfo.value).then((data) => {
- ElMessage({
- message: data.msg,
- type: "success",
- });
- dialog1.visible = false;
- dataList();
- });
- }
- });
- };
- const maintenanceSubmit2 = () => {
- //alert(JSON.stringify(maintenanceInfo.value))
- maintenanceInfoForm2.value.validate((isValid, invalidFields) => {
- if (isValid) {
- maintenanceInfo.value.auditResult = maintenanceInfo.value.auditResult2;
- maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion2;
- maintenanceInfo.value.auditUser = maintenanceInfo.value.auditUser2;
- maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion2;
- allocateAudit(maintenanceInfo.value).then((data) => {
- ElMessage({
- message: data.msg,
- type: "success",
- });
- dialog1.visible = false;
- dataList();
- });
- }
- });
- };
- const maintenanceSubmit3 = () => {
- //alert(JSON.stringify(maintenanceInfo.value))
- maintenanceInfoForm3.value.validate((isValid, invalidFields) => {
- if (isValid) {
- maintenanceInfo.value.auditResult = maintenanceInfo.value.auditResult3;
- maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion3;
- maintenanceInfo.value.auditUser = maintenanceInfo.value.auditUser3;
- maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion3;
- allocateAudit(maintenanceInfo.value).then((data) => {
- ElMessage({
- message: data.msg,
- type: "success",
- });
- dialog1.visible = false;
- dataList();
- });
- }
- });
- };
- const maintenanceSubmit4 = () => {
- //alert(JSON.stringify(maintenanceInfo.value))
- maintenanceInfoForm4.value.validate((isValid, invalidFields) => {
- if (isValid) {
- maintenanceInfo.value.auditResult = maintenanceInfo.value.auditResult4;
- maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion4;
- maintenanceInfo.value.auditUser = maintenanceInfo.value.auditUser4;
- maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion4;
- allocateAudit(maintenanceInfo.value).then((data) => {
- ElMessage({
- message: data.msg,
- type: "success",
- });
- dialog1.visible = false;
- dataList();
- });
- }
- });
- };
- const rules = reactive({
- auditUser: [{ required: true, message: "审核人员不能为空", trigger: "blur" }],
- auditOpinion: [
- { required: true, message: "审批意见不能为空", trigger: "blur" },
- ],
- auditUser1: [
- { required: true, message: "审核人员不能为空", trigger: "blur" },
- ],
- auditOpinion1: [
- { required: true, message: "审批意见不能为空", trigger: "blur" },
- ],
- auditUser2: [
- { required: true, message: "审核人员不能为空", trigger: "blur" },
- ],
- auditOpinion2: [
- { required: true, message: "审批意见不能为空", trigger: "blur" },
- ],
- auditUser3: [
- { required: true, message: "审核人员不能为空", trigger: "blur" },
- ],
- auditOpinion3: [
- { required: true, message: "审批意见不能为空", trigger: "blur" },
- ],
- auditUser4: [
- { required: true, message: "审核人员不能为空", trigger: "blur" },
- ],
- auditOpinion4: [
- { required: true, message: "审批意见不能为空", trigger: "blur" },
- ],
- });
- // 设置表格列或者其他自定义的option
- option.value = Object.assign(option.value, {
- delBtn: false,
- selection: true,
- labelWidth: 150,
- menuWidth: 300,
- viewBtn: false,
- editBtn: false,
- selectable: (row, index) => {
- return row.state === 0;
- },
- column: [
- /*{
- label: "调拨单号",
- prop: "allocateNo",
- display: false,
- width: 130,
- overHidden: true,
- },*/
- {
- label: "资产编号",
- prop: "deviceNo",
- width: 130,
- overHidden: true,
- search: true,
- rules: [
- {
- required: true,
- message: "公司资产号不能为空",
- trigger: "trigger",
- },
- ],
- click: ({ value, column }) => {
- if (column.boxType) {
- dialog.visible = true;
- }
- },
- change: ({ value, column }) => {
- if (column.boxType) {
- if (value != form.value.deviceNo) {
- if (column.boxType) {
- dialog.visible = true;
- }
- }
- }
- },
- },
- {
- label: "名称",
- prop: "deviceName",
- addDisabled: true,
- width: 130,
- overHidden: true,
- search: true,
- },
- {
- label: "型号",
- prop: "specifications",
- addDisabled: true,
- width: 130,
- overHidden: true,
- search: true,
- },
- {
- label: "出厂编号",
- prop: "serialNumber",
- addDisabled: true,
- width: 130,
- overHidden: true,
- search: true,
- },
- {
- label: "原值",
- prop: "originalValue",
- addDisabled: true,
- width: 130,
- overHidden: true,
- },
- {
- label: "设备类型",
- prop: "deviceType",
- type: "select",
- width: 100,
- overHidden: true,
- addDisabled: true,
- display: false,
- hide: true,
- search: true,
- dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.device_type,
- props: {
- label: "dictLabel",
- value: "dictValue",
- },
- rules: [
- {
- required: true,
- message: "设备类型不能为空",
- trigger: "trigger",
- },
- ],
- },
- {
- label: "调出部门",
- prop: "oldDept",
- type: "tree",
- width: 130,
- overHidden: true,
- addDisabled: true,
- dicUrl: dictDataUtil.dept_tree_url,
- props: {
- label: "deptName",
- value: "id",
- },
- },
- {
- label: "调入部门",
- prop: "applyDept",
- type: "tree",
- width: 130,
- overHidden: true,
- dicUrl: dictDataUtil.dept_tree_url,
- props: {
- label: "deptName",
- value: "id",
- },
- rules: [
- {
- required: true,
- message: "调入部门不能为空",
- trigger: "trigger",
- },
- ],
- },
- {
- label: "原负责人",
- prop: "oldHead",
- overHidden: true,
- addDisabled: true,
- display: false,
- hide: true,
- },
- {
- label: "新责任人",
- prop: "newHead",
- overHidden: true,
- rules: [
- {
- required: true,
- message: "新责任人不能为空",
- trigger: "trigger",
- },
- ],
- },
- {
- label: "设备原位置",
- addDisabled: true,
- prop: "devicePosition",
- overHidden: true,
- display: false,
- hide: true,
- },
- {
- label: "新安置地点",
- prop: "deviceToPosition",
- overHidden: true,
- rules: [
- {
- required: true,
- message: "新安置地点不能为空",
- trigger: "trigger",
- },
- ],
- },
- /*{
- label: "调拨周期(天)",
- prop: "allocateCycle",
- type: "number",
- width: "105",
- min: 0,
- max: 999,
- rules: [
- {
- required: true,
- message: "调拨周期不能为空",
- trigger: "trigger",
- },
- ],
- },*/
- {
- label: "状态",
- prop: "state",
- display: false,
- overHidden: true,
- width: 160,
- type: "select",
- dicData: [
- { label: "待调出部门领导审核", value: 0 },
- { label: "驳回", value: 1 },
- { label: "待调入部门领导审核", value: 2 },
- { label: "驳回", value: 3 },
- { label: "待设备管理员审核", value: 4 },
- { label: "驳回", value: 5 },
- { label: "待科研生产部负责人审核", value: 6 },
- { label: "驳回", value: 7 },
- { label: "待公司分管领导审核", value: 8 },
- { label: "驳回", value: 9 },
- { label: "完成", value: 10 },
- ],
- },
- {
- label: "申请人",
- prop: "applyUser",
- width: 130,
- overHidden: true,
- display: false,
- },
- {
- label: "申请时间",
- prop: "created",
- overHidden: true,
- display: false,
- },
- ],
- });
- onMounted(() => {
- dataList();
- queryUserList();
- });
- </script>
|