123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- <template>
- <div class="body">
- <!-- 剔除 -->
- <el-scrollbar class="containerBox">
- <div
- style="margin-bottom: 10px; display: flex"
- :style="{ justifyContent: !formStatus ? 'center' : '' }"
- >
- <el-button
- type="primary"
- style="font-size: 16px"
- v-if="formStatus"
- @click="toAdd"
- >新增</el-button
- >
- <el-button type="primary" v-else @click="toList">返回</el-button>
- </div>
- <template v-if="formStatus">
- <el-table class="table" :data="tableData">
- <el-table-column label="物料名称" prop="materialName" />
- <el-table-column label="状态" prop="num">
- <template #default="scope">
- <span v-if="scope.row.state === 0">待处理</span>
- <span v-else-if="scope.row.state === 1">审核中</span>
- <span v-else-if="scope.row.state === 2">审核驳回</span>
- <span v-else-if="scope.row.state === 3">审核完成</span>
- </template>
- </el-table-column>
- <el-table-column label="操作">
- <template #default="{ row }">
- <el-button
- v-if="row.state === 0"
- link
- type="danger"
- @click="del(row.id)"
- style="font-size: 20px"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <Pagination
- v-model:limit="limit"
- v-model:page="page"
- :position="'right'"
- :total="total"
- @pagination="getPagination"
- />
- </template>
- <template v-else>
- <el-scrollbar class="form">
- <el-form
- ref="ruleFormRef1"
- :model="ruleForm1"
- :rules="rules1"
- label-width="100"
- >
- <el-form-item label="流转卡号" prop="seqs">
- <el-select
- v-model="ruleForm1.seqs"
- multiple
- placeholder="请选择"
- value-key="value"
- >
- <el-option
- v-for="item in infoData?.processWorkSeq"
- :key="item"
- :label="item"
- :value="item"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="发生地点" prop="address">
- <el-input v-model="ruleForm1.address" />
- </el-form-item>
- <el-form-item label="数量" prop="address">
- <el-input v-model="ruleForm1.remark1.num" />
- </el-form-item>
- <el-form-item label="问题描述" prop="remark1[content]">
- <el-input type="textarea" v-model="ruleForm1.remark1.content" />
- </el-form-item>
- <el-form-item label="审理级别:" prop="remark1[content]">
- <el-radio-group v-model="ruleForm1.remark1.lv">
- <el-radio value="1">一级</el-radio>
- <el-radio value="2">二级</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="填表人" prop="reason">
- <el-select
- v-model="ruleForm1.remark1.user1"
- filterable
- placeholder="请选择人员"
- value-key="id"
- >
- <el-option
- v-for="item in dictStroe.allUsers"
- :key="item.id"
- :label="item.userName"
- :value="item.userName"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="发生日期" prop="reason">
- <el-date-picker
- v-model="ruleForm1.remark1.time"
- type="date"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- />
- </el-form-item>
- <el-form-item label="指定检验人" prop="reason">
- <el-select
- v-model="ruleForm1.remark2.user2"
- filterable
- placeholder="请选择人员"
- value-key="id"
- >
- <el-option
- v-for="item in dictStroe.allUsers"
- :key="item.id"
- :label="item.userName"
- :value="item.userName"
- />
- </el-select>
- </el-form-item>
- </el-form>
- </el-scrollbar>
- <div class="btns">
- <el-button type="primary" @click="submit1">提交</el-button>
- </div>
- </template>
- </el-scrollbar>
- </div>
- </template>
- <script setup>
- import {
- breakReportInfoById,
- operationListByIds,
- } from "@/api/process/reportBreak";
- import {
- addRework,
- addRework1,
- getList,
- getList1,
- delError,
- } from "@/api/rework";
- import { useProcessStore } from "@/store/modules/processView";
- import { useDictionaryStore } from "@/store/modules/dictionary";
- const dictStroe = useDictionaryStore();
- const processStore = useProcessStore();
- const ruleForm = ref({
- seqList: [],
- });
- const ruleForm1 = ref({
- seqs: [],
- remark1: {
- content: "",
- user1: "",
- },
- remark2: {
- user2: "",
- },
- });
- const tableData = ref([]);
- const toAdd = () => {
- formStatus.value = false;
- breakReportInfoById(processStore.scanInfo.id).then((res) => {
- infoData.value = res.data;
- });
- };
- const toList = () => {
- resetForm();
- formStatus.value = true;
- };
- const resetForm = () => {
- page.value = 1;
- limit.value = 10;
- ruleForm.value = { seqList: [] };
- ruleForm1.value = {
- seqs: [],
- remark1: {
- content: "",
- user1: "",
- },
- remark2: {
- user2: "",
- },
- };
- };
- const getPagination = async () => {
- const { data } = await getList({
- pageNo: page.value,
- pageSize: limit.value,
- seqNo: processStore.useSeqNo,
- });
- tableData.value = data;
- };
- const del = async (id) => {
- const { code } = await delError({
- id,
- });
- if (code == "200") {
- ElMessage.success("删除成功");
- getPagination1();
- }
- };
- const getPagination1 = async () => {
- const { data } = await getList1({
- pageNo: page.value,
- pageSize: limit.value,
- });
- tableData.value = data.records;
- };
- const formStatus = ref(true);
- const ruleFormRef1 = ref(null);
- const submit1 = async () => {
- ruleFormRef1.value.validate((valid) => {
- if (valid) {
- addTask1();
- } else {
- ElMessage.error("请检查是否有未填项");
- }
- });
- };
- const addTask1 = async () => {
- const { code } = await addRework1({
- ...ruleForm1.value,
- materialModel: processStore.processInfo.materialModel,
- materialCode: processStore.scanInfo.materialCode,
- materialName: processStore.scanInfo.materialName,
- operationId: processStore.scanInfo.operationId,
- operationName: processStore.scanInfo.operationName,
- pid: processStore.scanInfo.id,
- workOrderCode: processStore.odersData.workOrderCode,
- orderNo: processStore.scanInfo.orderCode,
- stage: processStore.scanInfo.operationName,
- type: "eliminate",
- seqs: ruleForm1.value.seqs.join(","),
- });
- if (code == "200") {
- resetForm();
- formStatus.value = true;
- getPagination1();
- ElMessage.success("操作成功!");
- }
- };
- const total = ref(0);
- const page = ref(1);
- const limit = ref(10);
- const operationList = ref([]);
- const infoData = ref({});
- const rules1 = reactive({
- location: [
- {
- required: true,
- message: "Please select a location",
- trigger: "change",
- },
- ],
- });
- onMounted(() => {
- getPagination1();
- });
- </script>
- <style lang="scss" scoped>
- .table {
- height: calc(100vh - 240px);
- border-radius: 16px;
- }
- .body {
- width: 100%;
- height: calc(100vh - 60px);
- .opera {
- height: 40px;
- display: flex;
- justify-content: center;
- align-items: center;
- background-color: white;
- padding-right: 8%;
- }
- }
- .containerBox {
- height: calc(100vh - 100px);
- padding: 20px;
- }
- :deep(.el-switch__label) {
- span {
- font-size: 20px !important;
- line-height: 25px !important;
- }
- }
- .form {
- width: 50%;
- max-width: 600px;
- height: calc(100vh - 240px);
- background-color: white;
- margin: 0 auto;
- padding: 0 20px;
- padding-top: 20px;
- border-radius: 16px;
- }
- .btns {
- height: 40px;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 50%;
- max-width: 600px;
- margin: 0 auto;
- }
- </style>
|