|
@@ -1,66 +1,68 @@
|
|
|
<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"
|
|
|
+ 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="{size,row,index}">
|
|
|
-
|
|
|
-
|
|
|
+ <template #menu="{ size, row, index }">
|
|
|
<el-button
|
|
|
- icon="el-icon-edit"
|
|
|
- text
|
|
|
- @click="openDialog(0,row.id)"
|
|
|
- type="primary"
|
|
|
- :size="size">详情</el-button>
|
|
|
+ icon="el-icon-edit"
|
|
|
+ text
|
|
|
+ @click="openDialog(0, row.id, row.outsourceId)"
|
|
|
+ type="primary"
|
|
|
+ :size="size"
|
|
|
+ >详情</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
<el-dialog
|
|
|
- v-model="dialog.visible"
|
|
|
- :title="dialog.title"
|
|
|
- width="1200px"
|
|
|
- @close="dialog.visible = false"
|
|
|
+ v-model="dialog.visible"
|
|
|
+ :title="dialog.title"
|
|
|
+ width="1200px"
|
|
|
+ @close="dialog.visible = false"
|
|
|
>
|
|
|
-
|
|
|
- <el-form ref="queryFormRef" label-width="100" :inline="true" style="width: 100%">
|
|
|
+ <el-form
|
|
|
+ ref="queryFormRef"
|
|
|
+ label-width="100"
|
|
|
+ :inline="true"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
<el-row :gutter="24">
|
|
|
<el-col :lg="12" :xs="12">
|
|
|
<el-form-item label="产品名称">
|
|
|
- <el-text>{{form.materialName}}</el-text>
|
|
|
+ <el-text>{{ form.materialName }}</el-text>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :lg="12" :xs="12">
|
|
|
<el-form-item label="产品编码">
|
|
|
- <el-text>{{form.materialCode}}</el-text>
|
|
|
+ <el-text>{{ form.materialCode }}</el-text>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
-
|
|
|
-
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="24">
|
|
|
<el-col :lg="12" :xs="12">
|
|
|
<el-form-item label="委外工序">
|
|
|
- <el-text>{{form.operationName}}</el-text>
|
|
|
+ <el-text>{{ form.operationName }}</el-text>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :lg="12" :xs="12">
|
|
|
<el-form-item label="产品数量">
|
|
|
- <el-text>{{form.outNum}}</el-text>
|
|
|
+ <el-text>{{ form.outNum }}</el-text>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -68,32 +70,32 @@
|
|
|
<el-row :gutter="24">
|
|
|
<el-col :lg="24" :xs="24">
|
|
|
<el-form-item label=" ">
|
|
|
- <el-table :border="true"
|
|
|
- class="gray-header-table"
|
|
|
- v-loading="loading"
|
|
|
- :data="form.details"
|
|
|
- highlight-current-row>
|
|
|
+ <el-table
|
|
|
+ :border="true"
|
|
|
+ class="gray-header-table"
|
|
|
+ v-loading="loading"
|
|
|
+ :data="form.details"
|
|
|
+ highlight-current-row
|
|
|
+ >
|
|
|
<el-table-column
|
|
|
- label="流转卡号"
|
|
|
- align="left"
|
|
|
- width=350
|
|
|
- prop="seqNo"
|
|
|
+ label="流转卡号"
|
|
|
+ align="left"
|
|
|
+ width="350"
|
|
|
+ prop="seqNo"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- label="状态"
|
|
|
- width=250
|
|
|
- align="left"
|
|
|
- prop="state"
|
|
|
+ label="状态"
|
|
|
+ width="250"
|
|
|
+ align="left"
|
|
|
+ prop="state"
|
|
|
>
|
|
|
<template #default="scope">
|
|
|
- <el-tag
|
|
|
- v-if="scope.row.state === 0"
|
|
|
- type="success"
|
|
|
- >合格</el-tag>
|
|
|
- <el-tag
|
|
|
- v-if="scope.row.state === 1"
|
|
|
- type="error"
|
|
|
- >不合格</el-tag>
|
|
|
+ <el-tag v-if="scope.row.state === 0" type="success"
|
|
|
+ >合格</el-tag
|
|
|
+ >
|
|
|
+ <el-tag v-if="scope.row.state === 1" type="error"
|
|
|
+ >不合格</el-tag
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -101,16 +103,18 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
-
|
|
|
<el-row :gutter="24" v-if="dialog.visible">
|
|
|
- <el-form-item label="Bom">
|
|
|
- <Boms :apply-id="bomId"></Boms>
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item label="Bom">
|
|
|
+ <Boms :apply-id="bomId" />
|
|
|
+ </el-form-item>
|
|
|
</el-row>
|
|
|
-
|
|
|
</el-form>
|
|
|
|
|
|
- <div class="dialog-footer" align="center" v-if="dialog.type === 1 && checkPerm('outsource:audit')">
|
|
|
+ <div
|
|
|
+ class="dialog-footer"
|
|
|
+ align="center"
|
|
|
+ v-if="dialog.type === 1 && checkPerm('outsource:audit')"
|
|
|
+ >
|
|
|
<el-button @click="dialog.visible = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="audit">审 核</el-button>
|
|
|
</div>
|
|
@@ -118,12 +122,12 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import Boms from './boms.vue'
|
|
|
+import Boms from "./boms.vue";
|
|
|
import { ref, getCurrentInstance } from "vue";
|
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
|
import { checkPerm } from "@/directive/permission";
|
|
|
import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
|
-import {queryOutSourceDetails,updateOutSourceApply} from "@/api/process";
|
|
|
+import { queryOutSourceDetails, updateOutSourceApply } from "@/api/process";
|
|
|
import { useCommonStoreHook } from "@/store";
|
|
|
import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
@@ -131,50 +135,51 @@ const test = () => {
|
|
|
isShowTable.value = true;
|
|
|
tableType.value = tableType.value == 1 ? 2 : 1;
|
|
|
};
|
|
|
-const radio = ref(0)
|
|
|
+const radio = ref(0);
|
|
|
// 传入一个url,后面不带/
|
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
|
src: "/api/v1/process/tdmOrder",
|
|
|
});
|
|
|
-const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
|
|
|
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
+ Methords; //增删改查
|
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
-const loading = ref(false)
|
|
|
+const loading = ref(false);
|
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
const dialog = reactive({
|
|
|
title: "委外详情",
|
|
|
visible: false,
|
|
|
- type: 0
|
|
|
+ type: 0,
|
|
|
});
|
|
|
-const bomId = ref("")//打开详情需要传入applyid
|
|
|
-const openDialog = (type,id) =>{
|
|
|
- bomId.value = id
|
|
|
- dialog.title = type === 0 ? '委外详情' : '委外审核' ;
|
|
|
- queryOutSourceDetails(id).then((data)=>{
|
|
|
- form.value = data.data
|
|
|
- radio.value = 0
|
|
|
- if(form.value){
|
|
|
- if(form.value.state === '2'){
|
|
|
- radio.value = 1
|
|
|
+const bomId = ref(""); //打开详情需要传入applyid
|
|
|
+const openDialog = (type, id, outId) => {
|
|
|
+ bomId.value = id;
|
|
|
+ dialog.title = type === 0 ? "委外详情" : "委外审核";
|
|
|
+ queryOutSourceDetails(outId).then((data) => {
|
|
|
+ form.value = data.data;
|
|
|
+ radio.value = 0;
|
|
|
+ if (form.value) {
|
|
|
+ if (form.value.state === "2") {
|
|
|
+ radio.value = 1;
|
|
|
}
|
|
|
}
|
|
|
- dialog.visible = true
|
|
|
- dialog.type = type
|
|
|
- })
|
|
|
-}
|
|
|
-const audit = () =>{
|
|
|
- form.value.state = radio.value === 0 ? 1: 2;
|
|
|
- updateOutSourceApply(form.value).then((data)=>{
|
|
|
- if(data.code === '200'){
|
|
|
- ElMessage.success("操作成功")
|
|
|
- dialog.visible = false
|
|
|
- dataList()
|
|
|
- }else{
|
|
|
- ElMessage.error(data.msg)
|
|
|
+ dialog.visible = true;
|
|
|
+ dialog.type = type;
|
|
|
+ });
|
|
|
+};
|
|
|
+const audit = () => {
|
|
|
+ form.value.state = radio.value === 0 ? 1 : 2;
|
|
|
+ updateOutSourceApply(form.value).then((data) => {
|
|
|
+ if (data.code === "200") {
|
|
|
+ ElMessage.success("操作成功");
|
|
|
+ dialog.visible = false;
|
|
|
+ dataList();
|
|
|
+ } else {
|
|
|
+ ElMessage.error(data.msg);
|
|
|
}
|
|
|
- })
|
|
|
-}
|
|
|
+ });
|
|
|
+};
|
|
|
// 设置表格列或者其他自定义的option
|
|
|
option.value = Object.assign(option.value, {
|
|
|
addBtn: false,
|
|
@@ -224,9 +229,7 @@ option.value = Object.assign(option.value, {
|
|
|
type: "select",
|
|
|
search: true,
|
|
|
width: 90,
|
|
|
- dicUrl:
|
|
|
- dictDataUtil.request_url +
|
|
|
- dictDataUtil.TYPE_CODE.outsource_state,
|
|
|
+ dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.outsource_state,
|
|
|
props: {
|
|
|
label: "dictLabel",
|
|
|
value: "dictValue",
|