|
@@ -52,7 +52,7 @@
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
-<script setup>
|
|
|
+<script setup>
|
|
|
import { ref, getCurrentInstance } from "vue";
|
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
|
import { getTableConfig } from "./configs";
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
getRouteMaxVersion,
|
|
|
addBatch,
|
|
|
addEsopBatch,
|
|
|
- addCheckBatch
|
|
|
+ addCheckBatch,
|
|
|
} from "@/api/craft/process/index";
|
|
|
import SingleUpload from "@/components/Upload/SingleUpload.vue";
|
|
|
|
|
@@ -137,7 +137,7 @@ const startCreat = () => {
|
|
|
commonTableRef.value?.mergeOption({
|
|
|
searchShow: bomVersion.value ? false : true,
|
|
|
selection: true,
|
|
|
- reserveSelection : true,
|
|
|
+ reserveSelection: true,
|
|
|
});
|
|
|
});
|
|
|
});
|
|
@@ -147,7 +147,7 @@ const startCreat = () => {
|
|
|
commonTableRef.value?.startSelect();
|
|
|
commonTableRef.value?.mergeOption({
|
|
|
selection: true,
|
|
|
- reserveSelection : true,
|
|
|
+ reserveSelection: true,
|
|
|
});
|
|
|
});
|
|
|
} else if (props.tableType === "ESOP") {
|
|
@@ -159,7 +159,7 @@ const startCreat = () => {
|
|
|
});
|
|
|
commonTableRef.value?.mergeOption({
|
|
|
selection: true,
|
|
|
- reserveSelection : true,
|
|
|
+ reserveSelection: true,
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
@@ -178,7 +178,6 @@ const onSortChange = () => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-
|
|
|
// ============公共弹窗table选择相关,物料采集等使用===============
|
|
|
const commonTableRef = ref({});
|
|
|
const commonTableType = ref("MARTERIAL_BOM");
|
|
@@ -192,17 +191,17 @@ const esopList = ref([]);
|
|
|
const checkItem = ref({});
|
|
|
const checkList = ref([]);
|
|
|
const onSelectedFinish = (itemValue) => {
|
|
|
- if(Object.keys(itemValue).length==0){
|
|
|
+ if (Object.keys(itemValue).length == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
itemRecordList.value = [];
|
|
|
- itemRecord.value.itemRecordList=[];
|
|
|
+ itemRecord.value.itemRecordList = [];
|
|
|
checkList.value = [];
|
|
|
checkItem.value.checkList = [];
|
|
|
esopItem.value.esopList = [];
|
|
|
esopList.value = [];
|
|
|
if (props.tableType === "wuliaocaiji") {
|
|
|
- itemValue?.forEach((item,index)=>{
|
|
|
+ itemValue?.forEach((item, index) => {
|
|
|
const recordItem = ref({});
|
|
|
recordItem.value.itemName = item.bomMaterialName;
|
|
|
recordItem.value.itemCode = item.bomMaterialCode;
|
|
@@ -214,27 +213,23 @@ const onSelectedFinish = (itemValue) => {
|
|
|
recordItem.value.unit = item.unit;
|
|
|
recordItem.value.isTrace = 1;
|
|
|
itemRecordList.value.push(recordItem.value);
|
|
|
- }
|
|
|
-
|
|
|
- );
|
|
|
+ });
|
|
|
itemRecord.value.operationId = route.params.id;
|
|
|
itemRecord.value.itemRecordList = Array.from(itemRecordList.value);
|
|
|
- addBatch(itemRecord.value).then(
|
|
|
- (data)=>{
|
|
|
- if(data.code=="200"){
|
|
|
- dataList();
|
|
|
- ElMessage({
|
|
|
- message: data.msg,
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- }else {
|
|
|
- ElMessage({
|
|
|
- message: data.msg,
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- }
|
|
|
+ addBatch(itemRecord.value).then((data) => {
|
|
|
+ if (data.code == "200") {
|
|
|
+ dataList();
|
|
|
+ ElMessage({
|
|
|
+ message: data.msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: data.msg,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
}
|
|
|
- )
|
|
|
+ });
|
|
|
//form.value.unit = itemValue.unit;
|
|
|
} else if (props.tableType === "dianjian") {
|
|
|
/*form.value.checkName = itemValue.checkName;
|
|
@@ -244,43 +239,37 @@ const onSelectedFinish = (itemValue) => {
|
|
|
form.value.upper = itemValue.upper;
|
|
|
form.value.lower = itemValue.lower;
|
|
|
form.value.unit = itemValue.unit;*/
|
|
|
- itemValue?.forEach((item,index)=>{
|
|
|
- const recordItem = ref({});
|
|
|
- recordItem.value.operationId = route.params.id;
|
|
|
- recordItem.value.checkName = item.checkName;
|
|
|
- recordItem.value.checkCode = item.checkCode;
|
|
|
- recordItem.value.content = item.content;
|
|
|
- recordItem.value.standard = item.standard;
|
|
|
- recordItem.value.upper = item.upper;
|
|
|
- recordItem.value.lower = item.lower;
|
|
|
- recordItem.value.unit = item.unit;
|
|
|
- checkList.value.push(recordItem.value);
|
|
|
- }
|
|
|
-
|
|
|
- );
|
|
|
+ itemValue?.forEach((item, index) => {
|
|
|
+ const recordItem = ref({});
|
|
|
+ recordItem.value.operationId = route.params.id;
|
|
|
+ recordItem.value.checkName = item.checkName;
|
|
|
+ recordItem.value.checkCode = item.checkCode;
|
|
|
+ recordItem.value.content = item.content;
|
|
|
+ recordItem.value.standard = item.standard;
|
|
|
+ recordItem.value.upper = item.upper;
|
|
|
+ recordItem.value.lower = item.lower;
|
|
|
+ recordItem.value.unit = item.unit;
|
|
|
+ checkList.value.push(recordItem.value);
|
|
|
+ });
|
|
|
checkItem.value.operationId = route.params.id;
|
|
|
checkItem.value.checkList = Array.from(checkList.value);
|
|
|
- addCheckBatch(checkItem.value).then(
|
|
|
- (data)=>{
|
|
|
-
|
|
|
- if(data.code=="200"){
|
|
|
- dataList();
|
|
|
- commonTableRef.value?.mergeOption({
|
|
|
- reserveSelection : false,
|
|
|
- });
|
|
|
- ElMessage({
|
|
|
- message: data.msg,
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- }else {
|
|
|
- ElMessage({
|
|
|
- message: data.msg,
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- }
|
|
|
+ addCheckBatch(checkItem.value).then((data) => {
|
|
|
+ if (data.code == "200") {
|
|
|
+ dataList();
|
|
|
+ commonTableRef.value?.mergeOption({
|
|
|
+ reserveSelection: false,
|
|
|
+ });
|
|
|
+ ElMessage({
|
|
|
+ message: data.msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: data.msg,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
}
|
|
|
- )
|
|
|
-
|
|
|
+ });
|
|
|
} else if (props.tableType === "ESOP") {
|
|
|
/*form.value.filePath = itemValue.pdfPath;
|
|
|
pdfPath.value = import.meta.env.VITE_APP_UPLOAD_URL + itemValue.pdfPath;
|
|
@@ -288,37 +277,33 @@ const onSelectedFinish = (itemValue) => {
|
|
|
form.value.recordVersion = itemValue.drawingVersion;
|
|
|
form.value.sortNum = itemValue.sort;
|
|
|
form.value.title = itemValue.drawingTitle;*/
|
|
|
- itemValue?.forEach((item,index)=>{
|
|
|
- const recordItem = ref({});
|
|
|
- recordItem.value.operationId = route.params.id;
|
|
|
- recordItem.value.filePath = item.pdfPath;
|
|
|
- recordItem.value.showAppointPageNum = 1;
|
|
|
- recordItem.value.drawingCode = item.drawingCode;
|
|
|
- recordItem.value.recordVersion = item.drawingVersion;
|
|
|
- recordItem.value.sortNum = item.sort;
|
|
|
- recordItem.value.title = item.drawingTitle;
|
|
|
- esopList.value.push(recordItem.value);
|
|
|
- }
|
|
|
-
|
|
|
- );
|
|
|
+ itemValue?.forEach((item, index) => {
|
|
|
+ const recordItem = ref({});
|
|
|
+ recordItem.value.operationId = route.params.id;
|
|
|
+ recordItem.value.filePath = item.pdfPath;
|
|
|
+ recordItem.value.showAppointPageNum = 1;
|
|
|
+ recordItem.value.drawingCode = item.drawingCode;
|
|
|
+ recordItem.value.recordVersion = item.drawingVersion;
|
|
|
+ recordItem.value.sortNum = item.sort;
|
|
|
+ recordItem.value.title = item.drawingTitle;
|
|
|
+ esopList.value.push(recordItem.value);
|
|
|
+ });
|
|
|
esopItem.value.operationId = route.params.id;
|
|
|
esopItem.value.esopList = Array.from(esopList.value);
|
|
|
- addEsopBatch(esopItem.value).then(
|
|
|
- (data)=>{
|
|
|
- if(data.code=="200"){
|
|
|
- dataList();
|
|
|
- ElMessage({
|
|
|
- message: data.msg,
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- }else {
|
|
|
- ElMessage({
|
|
|
- message: data.msg,
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- }
|
|
|
+ addEsopBatch(esopItem.value).then((data) => {
|
|
|
+ if (data.code == "200") {
|
|
|
+ dataList();
|
|
|
+ ElMessage({
|
|
|
+ message: data.msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: data.msg,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
}
|
|
|
- )
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|