|
@@ -44,6 +44,7 @@
|
|
|
ref="commonTableRef"
|
|
|
:tableTitle="tableTitle"
|
|
|
:tableType="commonTableType"
|
|
|
+ :multipleRow="multipleRow"
|
|
|
@selected-sure="onSelectedFinish"
|
|
|
/>
|
|
|
<el-dialog v-model="dialogVisible">
|
|
@@ -51,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";
|
|
@@ -61,6 +62,9 @@ import {
|
|
|
saveCompoents,
|
|
|
getBomVersion,
|
|
|
getRouteMaxVersion,
|
|
|
+ addBatch,
|
|
|
+ addEsopBatch,
|
|
|
+ addCheckBatch
|
|
|
} from "@/api/craft/process/index";
|
|
|
import SingleUpload from "@/components/Upload/SingleUpload.vue";
|
|
|
|
|
@@ -91,6 +95,7 @@ const { selectionChange, multipleUpdate } = Methords; //选中和批量删除事
|
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
const bomVersion = ref(null);
|
|
|
const pdfPath = ref(null);
|
|
|
+const multipleRow = ref(true);
|
|
|
const startCreat = () => {
|
|
|
if (props.tableType === "wuliaocaiji") {
|
|
|
if (data.value && data.value.length > 0) {
|
|
@@ -131,6 +136,8 @@ const startCreat = () => {
|
|
|
);
|
|
|
commonTableRef.value?.mergeOption({
|
|
|
searchShow: bomVersion.value ? false : true,
|
|
|
+ selection: true,
|
|
|
+ reserveSelection : true,
|
|
|
});
|
|
|
});
|
|
|
});
|
|
@@ -138,6 +145,10 @@ const startCreat = () => {
|
|
|
commonTableType.value = "OP_CHECK";
|
|
|
nextTick(() => {
|
|
|
commonTableRef.value?.startSelect();
|
|
|
+ commonTableRef.value?.mergeOption({
|
|
|
+ selection: true,
|
|
|
+ reserveSelection : true,
|
|
|
+ });
|
|
|
});
|
|
|
} else if (props.tableType === "ESOP") {
|
|
|
commonTableType.value = "ESOP";
|
|
@@ -146,6 +157,10 @@ const startCreat = () => {
|
|
|
materialCode: route.query.prodtCode,
|
|
|
enable: 1,
|
|
|
});
|
|
|
+ commonTableRef.value?.mergeOption({
|
|
|
+ selection: true,
|
|
|
+ reserveSelection : true,
|
|
|
+ });
|
|
|
});
|
|
|
} else {
|
|
|
crudRef.value && crudRef.value.rowAdd();
|
|
@@ -163,34 +178,140 @@ const onSortChange = () => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+
|
|
|
// ============公共弹窗table选择相关,物料采集等使用===============
|
|
|
const commonTableRef = ref({});
|
|
|
const commonTableType = ref("MARTERIAL_BOM");
|
|
|
+//批量增加物料采集
|
|
|
+const itemRecord = ref({});
|
|
|
+const itemRecordList = ref([]);
|
|
|
+//批量增加ESOP
|
|
|
+const esopItem = ref({});
|
|
|
+const esopList = ref([]);
|
|
|
+//批量增加点检
|
|
|
+const checkItem = ref({});
|
|
|
+const checkList = ref([]);
|
|
|
const onSelectedFinish = (itemValue) => {
|
|
|
- crudRef.value && crudRef.value.rowAdd();
|
|
|
if (props.tableType === "wuliaocaiji") {
|
|
|
- form.value.itemName = itemValue.bomMaterialName;
|
|
|
- form.value.itemCode = itemValue.bomMaterialCode;
|
|
|
- form.value.itemModel = itemValue.bomMaterialAttribute;
|
|
|
- form.value.recordVersion = itemValue.bomVersion;
|
|
|
- form.value.num = itemValue.bomMaterialNumber;
|
|
|
- form.value.traceType = "S";
|
|
|
- form.value.unit = itemValue.unit;
|
|
|
+ itemValue?.forEach((item,index)=>{
|
|
|
+ const recordItem = ref({});
|
|
|
+ recordItem.value.itemName = item.bomMaterialName;
|
|
|
+ recordItem.value.itemCode = item.bomMaterialCode;
|
|
|
+ recordItem.value.itemModel = item.bomMaterialAttribute;
|
|
|
+ recordItem.value.recordVersion = item.bomVersion;
|
|
|
+ recordItem.value.num = item.bomMaterialNumber;
|
|
|
+ recordItem.value.traceType = "S";
|
|
|
+ recordItem.value.operationId = route.params.id;
|
|
|
+ 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)=>{
|
|
|
+ itemRecordList.value = [];
|
|
|
+ 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;
|
|
|
+ /*form.value.checkName = itemValue.checkName;
|
|
|
form.value.checkCode = itemValue.checkCode;
|
|
|
form.value.content = itemValue.content;
|
|
|
form.value.standard = itemValue.standard;
|
|
|
form.value.upper = itemValue.upper;
|
|
|
form.value.lower = itemValue.lower;
|
|
|
- form.value.unit = itemValue.unit;
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ );
|
|
|
+ checkItem.value.operationId = route.params.id;
|
|
|
+ checkItem.value.checkList = Array.from(checkList.value);
|
|
|
+ addCheckBatch(checkItem.value).then(
|
|
|
+ (data)=>{
|
|
|
+ checkList.value = [];
|
|
|
+ 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;
|
|
|
+ /*form.value.filePath = itemValue.pdfPath;
|
|
|
pdfPath.value = import.meta.env.VITE_APP_UPLOAD_URL + itemValue.pdfPath;
|
|
|
form.value.drawingCode = itemValue.drawingCode;
|
|
|
form.value.recordVersion = itemValue.drawingVersion;
|
|
|
form.value.sortNum = itemValue.sort;
|
|
|
- form.value.title = itemValue.drawingTitle;
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ );
|
|
|
+ esopItem.value.operationId = route.params.id;
|
|
|
+ esopItem.value.esopList = Array.from(esopList.value);
|
|
|
+ addEsopBatch(esopItem.value).then(
|
|
|
+ (data)=>{
|
|
|
+ esopList.value = [];
|
|
|
+ if(data.code=="200"){
|
|
|
+ dataList();
|
|
|
+ ElMessage({
|
|
|
+ message: data.msg,
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ ElMessage({
|
|
|
+ message: data.msg,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -230,6 +351,7 @@ watch(
|
|
|
url.value = tableConfig[props.tableType].url;
|
|
|
option.value = Object.assign(option.value, {
|
|
|
addBtn: false,
|
|
|
+ selection: true,
|
|
|
searchShow: false,
|
|
|
header: false,
|
|
|
sortable: true,
|