|
@@ -1,260 +1,134 @@
|
|
<template>
|
|
<template>
|
|
<div class="mainContentBox">
|
|
<div class="mainContentBox">
|
|
- <!--{{dataDetail}}-->
|
|
|
|
- <!--{{dicts}}-->
|
|
|
|
- <div class="detail">
|
|
|
|
- <div class="title-detail">物料名称:{{dataDetail.materialCode}}</div>
|
|
|
|
- <div class="title-detail">物料编码:{{dataDetail.materialName}}</div>
|
|
|
|
- <div class="title-detail">物料属性:{{dataDetail.attributeDictLabel}}</div>
|
|
|
|
- </div>
|
|
|
|
|
|
+
|
|
|
|
+
|
|
<avue-crud
|
|
<avue-crud
|
|
ref="crudRef"
|
|
ref="crudRef"
|
|
v-model:search="search"
|
|
v-model:search="search"
|
|
v-model="form"
|
|
v-model="form"
|
|
:data="data"
|
|
:data="data"
|
|
:option="option"
|
|
:option="option"
|
|
|
|
+ v-model:page="page"
|
|
|
|
+ @row-save="createRow"
|
|
@row-update="updateRow"
|
|
@row-update="updateRow"
|
|
@row-del="deleteRow"
|
|
@row-del="deleteRow"
|
|
@search-change="searchChange"
|
|
@search-change="searchChange"
|
|
@search-reset="resetChange"
|
|
@search-reset="resetChange"
|
|
|
|
+ @size-change="dataList"
|
|
|
|
+ @current-change="dataList"
|
|
@selection-change="selectionChange"
|
|
@selection-change="selectionChange"
|
|
>
|
|
>
|
|
- <template #menu-left="{ size }">
|
|
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- icon="el-icon-plus"
|
|
|
|
- @click="openMaterial"
|
|
|
|
- >新增</el-button
|
|
|
|
- ></template>
|
|
|
|
|
|
|
|
- <CommonTable
|
|
|
|
- ref="ctableRef"
|
|
|
|
- tableTitle="物料选择"
|
|
|
|
- tableType="BOM"
|
|
|
|
- @selected-sure="onSelectedFinish"
|
|
|
|
- />
|
|
|
|
- <template #footer>
|
|
|
|
- <div class="detail-footer">
|
|
|
|
- <el-button type="primary" @click="onSelected"> 保存 </el-button>
|
|
|
|
- <el-button @click="routeBack">取消</el-button>
|
|
|
|
-
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- <template #menu-right="{}">
|
|
|
|
- <el-dropdown split-button
|
|
|
|
- >导入
|
|
|
|
- <template #dropdown>
|
|
|
|
- <el-dropdown-menu>
|
|
|
|
- <el-dropdown-item
|
|
|
|
- @click="downloadTemplate('/api/v1/plan/order/template')"
|
|
|
|
- >
|
|
|
|
- <i-ep-download />下载模板
|
|
|
|
- </el-dropdown-item>
|
|
|
|
- <el-dropdown-item @click="importExcelData">
|
|
|
|
- <i-ep-top />导入数据
|
|
|
|
- </el-dropdown-item>
|
|
|
|
- </el-dropdown-menu>
|
|
|
|
- </template>
|
|
|
|
- </el-dropdown>
|
|
|
|
|
|
+ <template #menu="{row,index,type}">
|
|
|
|
+ <el-button @click="viewFault(row)"
|
|
|
|
+ icon="el-icon-view"
|
|
|
|
+ text
|
|
|
|
+ type="primary"
|
|
|
|
+ >查看</el-button>
|
|
</template>
|
|
</template>
|
|
|
|
+
|
|
|
|
+
|
|
</avue-crud>
|
|
</avue-crud>
|
|
- <CommonTable
|
|
|
|
- ref="ctableRef"
|
|
|
|
- tableTitle="BOM添加"
|
|
|
|
- tableType="MARTERIAL"
|
|
|
|
- @selected-sure="onSelectedFinish"
|
|
|
|
- />
|
|
|
|
|
|
+
|
|
|
|
+ <el-dialog
|
|
|
|
+ v-model="dialog.visible"
|
|
|
|
+ :title="dialog.title"
|
|
|
|
+ width="900px"
|
|
|
|
+ @close="dialog.visible = false"
|
|
|
|
+ :destroy-on-close="true"
|
|
|
|
+ >
|
|
|
|
+ <FaultDetail :escalationFaultId="fault.id" :dialog="dialog" />
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
-<script setup lang="ts">
|
|
|
|
-import { ref, getCurrentInstance } from "vue";
|
|
|
|
-import { useCrud } from "../../../hooks/userCrud";
|
|
|
|
-import ButtonPermKeys from "../../../common/configs/buttonPermission";
|
|
|
|
-import { columns } from "./columns";
|
|
|
|
-import { useCommonStoreHook, useDictionaryStoreHook } from "../../../store/index";
|
|
|
|
-import {
|
|
|
|
- getList,
|
|
|
|
-} from "@/api/bom";
|
|
|
|
-import {
|
|
|
|
- getMaterialDetails,
|
|
|
|
-} from "@/api/material";
|
|
|
|
|
|
+<script setup>
|
|
|
|
+ import { ref, getCurrentInstance } from "vue";
|
|
|
|
+ import { useCrud } from "@/hooks/userCrud";
|
|
|
|
+ import ButtonPermKeys from "@/common/configs/buttonPermission";
|
|
|
|
+ import { columns } from "./columns";
|
|
|
|
+ import { useCommonStoreHook, useDictionaryStoreHook } from "@/store";
|
|
|
|
+ import FaultDetail from "@/views/quality/faultHandle/components/fault-detail.vue"
|
|
|
|
+ const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
|
|
+ // 数据字典相关
|
|
|
|
+ const { dicts } = useDictionaryStoreHook();
|
|
|
|
+
|
|
|
|
+ const test = () => {
|
|
|
|
+ isShowTable.value = true;
|
|
|
|
+ tableType.value = tableType.value == 1 ? 2 : 1;
|
|
|
|
+ };
|
|
|
|
+ const dialog = ref({
|
|
|
|
+ title: "报故详情",
|
|
|
|
+ visible: false,
|
|
|
|
+ });
|
|
|
|
+ const fault=ref({});
|
|
|
|
+ const faultInfo=ref({});
|
|
|
|
+ const faultEs=ref({});
|
|
|
|
+ const faultExa=ref({});
|
|
|
|
+ const faultEdit=(row)=>{
|
|
|
|
|
|
-import {
|
|
|
|
- batchAddBom,
|
|
|
|
-} from "@/api/bom";
|
|
|
|
-const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
|
|
-// 数据字典相关
|
|
|
|
-const { dicts } = useDictionaryStoreHook();
|
|
|
|
-const router = useRouter();
|
|
|
|
-const route = useRoute();
|
|
|
|
|
|
+ faultInfo.value.id=row.id;
|
|
|
|
|
|
-const dataDetail=ref({});
|
|
|
|
-const test = () => {
|
|
|
|
- isShowTable.value = true;
|
|
|
|
- tableType.value = tableType.value == 1 ? 2 : 1;
|
|
|
|
-};
|
|
|
|
-const openMaterial=()=>{
|
|
|
|
- if (ctableRef.value) {
|
|
|
|
- ctableRef.value.startSelect();
|
|
|
|
|
|
+ dialog1.value.visible=true;
|
|
|
|
+ }
|
|
|
|
+ const faultThaw=(row)=>{
|
|
|
|
+ faultEs.value.id=row.id;
|
|
|
|
+ dialog2.value.visible=true;
|
|
}
|
|
}
|
|
-}
|
|
|
|
-const formData=ref({});
|
|
|
|
-const dataBomLists=()=>{
|
|
|
|
- search.value.materialCode=route.value.materialCode;
|
|
|
|
- dataNoPageList();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-const ctableRef = ref(null);
|
|
|
|
|
|
|
|
-const binding = (row) => {
|
|
|
|
- if (ctableRef.value) {
|
|
|
|
- ctableRef.value.startSelect();
|
|
|
|
|
|
+ const faultExamine =(row)=>{
|
|
|
|
+ faultExa.value.id=row.id;
|
|
|
|
+ dialog3.value.visible=true;
|
|
}
|
|
}
|
|
-};
|
|
|
|
-const onSelected=()=>{
|
|
|
|
- for(var i=0;i<data.value.length;i++){
|
|
|
|
- if(data.value[i].bomMaterialNumber<=0){
|
|
|
|
- ElMessage({
|
|
|
|
- message: data.value[i].bomMaterialName+"数量不能为0",
|
|
|
|
- type: "error",
|
|
|
|
- });
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ const closeFault=()=>{
|
|
|
|
+ dialog3.value.visible=false;
|
|
|
|
+ dataList();
|
|
}
|
|
}
|
|
- if(data.value.length===0){
|
|
|
|
- ElMessage({
|
|
|
|
- message: "物料记录不能为空!",
|
|
|
|
- type: "error",
|
|
|
|
|
|
+ // 传入一个url,后面不带/
|
|
|
|
+ const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
|
+ useCrud({
|
|
|
|
+ src: "/api/v1/process/escalationFault",
|
|
});
|
|
});
|
|
- return;
|
|
|
|
- }
|
|
|
|
- batchAddBom(data.value).then(
|
|
|
|
- (data: any)=>{
|
|
|
|
- if(data.code==="200") {
|
|
|
|
- ElMessage({
|
|
|
|
- message: data.msg,
|
|
|
|
- type: "success",
|
|
|
|
- });
|
|
|
|
- router.back();
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- ElMessage({
|
|
|
|
- message: data.msg,
|
|
|
|
- type: "error",
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
-}
|
|
|
|
-// 传入一个url,后面不带/
|
|
|
|
-const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
|
- useCrud({
|
|
|
|
- src: "/api/v1/base/materialBom",
|
|
|
|
- });
|
|
|
|
-const { dataNoPageList,createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
|
- Methords; //增删改查
|
|
|
|
-const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
|
-const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
|
-// checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
|
|
|
|
-// const permission = reactive({
|
|
|
|
-// delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
|
|
|
|
-// addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
|
|
|
|
-// editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
|
|
|
|
-// menu: true,
|
|
|
|
-// });
|
|
|
|
-
|
|
|
|
-const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
|
|
|
+ const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
|
+ Methords; //增删改查
|
|
|
|
+ const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
|
+ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
|
+ // checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
|
|
|
|
+ // const permission = reactive({
|
|
|
|
+ // delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
|
|
|
|
+ // addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
|
|
|
|
+ // editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
|
|
|
|
+ // menu: true,
|
|
|
|
+ // });
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
- // console.log("crudRef", crudRef)
|
|
|
|
- search.value.materialCode=route.params.materialCode;
|
|
|
|
- queryMaterialDetail();
|
|
|
|
- dataNoPageList();
|
|
|
|
|
|
+ const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
|
+ const router = useRouter();
|
|
|
|
+ const viewFault = (row) => {
|
|
|
|
|
|
-});
|
|
|
|
|
|
+ fault.value.id=row.id;
|
|
|
|
+ console.info(fault)
|
|
|
|
+ dialog.value.visible=true;
|
|
|
|
+ };
|
|
|
|
+ onMounted(() => {
|
|
|
|
+ // console.log("crudRef", crudRef)
|
|
|
|
+ dataList();
|
|
|
|
+ });
|
|
|
|
|
|
-/**
|
|
|
|
- * 上传excel相关
|
|
|
|
- */
|
|
|
|
-const uploadRef = ref(null);
|
|
|
|
-const uploadFinished = () => {
|
|
|
|
- // 上传完成后的刷新操作
|
|
|
|
- dataNoPageList();
|
|
|
|
-};
|
|
|
|
-const importExcelData = () => {
|
|
|
|
- if (uploadRef.value) {
|
|
|
|
- uploadRef.value.show("/api/v1/plan/order/import");
|
|
|
|
|
|
+ const searchChangeState=()=>{
|
|
|
|
+ dataList();
|
|
}
|
|
}
|
|
-};
|
|
|
|
|
|
|
|
-// 设置表格列或者其他自定义的option
|
|
|
|
-option.value = Object.assign(option.value, {
|
|
|
|
- selection: true,
|
|
|
|
- addBtn: false,
|
|
|
|
- viewBtn: false,
|
|
|
|
- editBtn:false,
|
|
|
|
- saveBtn:false,
|
|
|
|
- cellBtn: true,
|
|
|
|
- column: columns,
|
|
|
|
-});
|
|
|
|
-const routeBack =()=>{
|
|
|
|
- router.back();
|
|
|
|
-}
|
|
|
|
-const onSelectedFinish = (selectedValue) => {
|
|
|
|
- for(var i=0;i<data.value.length;i++){
|
|
|
|
- if(data.value[i].bomMaterialCode===selectedValue.materialCode){
|
|
|
|
- ElMessage({
|
|
|
|
- message: data.value[i].bomMaterialName+"已经添加过了",
|
|
|
|
- type: "error",
|
|
|
|
- });
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- const bom=ref({
|
|
|
|
- materialCode:route.params.materialCode,
|
|
|
|
- bomMaterialCode:selectedValue.materialCode,
|
|
|
|
- bomMaterialName:selectedValue.materialName,
|
|
|
|
- bomMaterialAttribute:selectedValue.attributeDictValue,
|
|
|
|
- bomMaterialNumber:0,
|
|
|
|
- $cellEdit:true,
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 设置表格列或者其他自定义的option
|
|
|
|
+ option.value = Object.assign(option.value, {
|
|
|
|
+ addBtn: false,
|
|
|
|
+ editBtn:false,
|
|
|
|
+ delBtn:false,
|
|
|
|
+ viewBtn:false,
|
|
|
|
+ column: columns,
|
|
});
|
|
});
|
|
- data.value.push(bom.value);
|
|
|
|
-};
|
|
|
|
-const queryMaterialDetail = () => {
|
|
|
|
- getMaterialDetails(route.params.materialCode).then(
|
|
|
|
|
|
|
|
- ({ data }) => {
|
|
|
|
- dataDetail.value=data;
|
|
|
|
- dicts.material_properties;
|
|
|
|
- for(var i=0;i<dicts.material_properties.length;i++){
|
|
|
|
- if(data.attributeDictValue===dicts.material_properties[i].dictValue){
|
|
|
|
- dataDetail.value.attributeDictLabel=dicts.material_properties[i].dictLabel;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
-};
|
|
|
|
</script>
|
|
</script>
|
|
-<style type="text/css">
|
|
|
|
- .title-detail{
|
|
|
|
- width: 30%;
|
|
|
|
- height: 50px;
|
|
|
|
- line-height: 50px;
|
|
|
|
- margin: 25px 20px 25px 0;
|
|
|
|
- float: left;
|
|
|
|
- }
|
|
|
|
- .detail{
|
|
|
|
- margin: 0 auto;
|
|
|
|
- width: 100%;
|
|
|
|
- }
|
|
|
|
- .avue-crud{
|
|
|
|
- float: left;
|
|
|
|
- }
|
|
|
|
- .detail-footer{
|
|
|
|
- float: right;
|
|
|
|
- margin-top:15px;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-</style>
|
|
|