|
@@ -33,9 +33,8 @@
|
|
|
@click="openDialog(0, row)"
|
|
|
type="primary"
|
|
|
:size="size"
|
|
|
- >详情
|
|
|
- </el-button
|
|
|
- >
|
|
|
+ >详情
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
<el-dialog
|
|
@@ -44,7 +43,6 @@
|
|
|
width="90%"
|
|
|
@close="dialog.visible = false"
|
|
|
>
|
|
|
-
|
|
|
<!-- <el-button
|
|
|
class="ml-3"
|
|
|
style="margin-bottom: 5px;"
|
|
@@ -107,21 +105,48 @@
|
|
|
></el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-button type="primary" icon="el-icon-search" @click="handleSearch">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-search"
|
|
|
+ @click="handleSearch"
|
|
|
+ >
|
|
|
搜索
|
|
|
</el-button>
|
|
|
- <el-button type="default" icon="el-icon-delete" @click="handleReset">
|
|
|
+ <el-button
|
|
|
+ type="default"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleReset"
|
|
|
+ >
|
|
|
清空
|
|
|
</el-button>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
-
|
|
|
</el-form>
|
|
|
|
|
|
- <el-table :data="itemList" border style="width: 100%" span-method="objectSpanMethod">
|
|
|
- <el-table-column show-overflow-tooltip prop="operationName" label="工序" width="100"/>
|
|
|
- <el-table-column show-overflow-tooltip prop="materialModel" label="物料型号" width="100"/>
|
|
|
- <el-table-column show-overflow-tooltip prop="workOrderCode" label="产品批号" width="120"/>
|
|
|
+ <el-table
|
|
|
+ :data="itemList"
|
|
|
+ border
|
|
|
+ style="width: 100%"
|
|
|
+ span-method="objectSpanMethod"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ show-overflow-tooltip
|
|
|
+ prop="operationName"
|
|
|
+ label="工序"
|
|
|
+ width="100"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ show-overflow-tooltip
|
|
|
+ prop="materialModel"
|
|
|
+ label="物料型号"
|
|
|
+ width="100"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ show-overflow-tooltip
|
|
|
+ prop="workOrderCode"
|
|
|
+ label="产品批号"
|
|
|
+ width="120"
|
|
|
+ />
|
|
|
<el-table-column prop="reNum" label="数量(接收)" width="70">
|
|
|
<template v-if="dialog.type === 1" #default="scope">
|
|
|
<el-input v-model="scope.row.reNum"></el-input>
|
|
@@ -139,7 +164,11 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="reDate" label="时间(接收)" width="120">
|
|
|
<template v-if="dialog.type === 1" #default="scope">
|
|
|
- <el-date-picker value-format="YYYY-MM-DD" type="date" v-model="scope.row.reDate"></el-date-picker>
|
|
|
+ <el-date-picker
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ type="date"
|
|
|
+ v-model="scope.row.reDate"
|
|
|
+ ></el-date-picker>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="next0Num" label="数量(下传合格)" width="80">
|
|
@@ -147,19 +176,31 @@
|
|
|
<el-input v-model="scope.row.next0Num"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="next0FrontUser" label="下传人(下传合格)" width="140">
|
|
|
+ <el-table-column
|
|
|
+ prop="next0FrontUser"
|
|
|
+ label="下传人(下传合格)"
|
|
|
+ width="140"
|
|
|
+ >
|
|
|
<template v-if="dialog.type === 1" #default="scope">
|
|
|
<el-input v-model="scope.row.next0FrontUser"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="next0ReceiveUser" label="接收人(下传合格)" width="140">
|
|
|
+ <el-table-column
|
|
|
+ prop="next0ReceiveUser"
|
|
|
+ label="接收人(下传合格)"
|
|
|
+ width="140"
|
|
|
+ >
|
|
|
<template v-if="dialog.type === 1" #default="scope">
|
|
|
<el-input v-model="scope.row.next0ReceiveUser"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="next0Date" label="时间(下传合格)" width="120">
|
|
|
<template v-if="dialog.type === 1" #default="scope">
|
|
|
- <el-date-picker value-format="YYYY-MM-DD" type="date" v-model="scope.row.next0Date"/>
|
|
|
+ <el-date-picker
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ type="date"
|
|
|
+ v-model="scope.row.next0Date"
|
|
|
+ />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="next1Num" label="数量(下传不合格)" width="80">
|
|
@@ -167,12 +208,24 @@
|
|
|
<el-input v-model="scope.row.next1Num"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="next1FrontUser" label="下传人(下传不合格)" width="140">
|
|
|
+ <el-table-column
|
|
|
+ prop="next1FrontUser"
|
|
|
+ label="下传人(下传不合格)"
|
|
|
+ width="140"
|
|
|
+ >
|
|
|
<template v-if="dialog.type === 1" #default="scope">
|
|
|
- <el-date-picker value-format="YYYY-MM-DD" type="date" v-model="scope.row.next1FrontUser"/>
|
|
|
+ <el-date-picker
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ type="date"
|
|
|
+ v-model="scope.row.next1FrontUser"
|
|
|
+ />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="next1ReceiveUser" label="接收人(下传不合格)" width="140">
|
|
|
+ <el-table-column
|
|
|
+ prop="next1ReceiveUser"
|
|
|
+ label="接收人(下传不合格)"
|
|
|
+ width="140"
|
|
|
+ >
|
|
|
<template v-if="dialog.type === 1" #default="scope">
|
|
|
<el-input v-model="scope.row.next1ReceiveUser"></el-input>
|
|
|
</template>
|
|
@@ -200,13 +253,20 @@
|
|
|
</el-table-column>-->
|
|
|
</el-table>
|
|
|
|
|
|
- <div
|
|
|
- class="dialog-footer"
|
|
|
- style="margin-top: 10px;"
|
|
|
- align="center"
|
|
|
- >
|
|
|
+ <div class="dialog-footer" style="margin-top: 10px" align="center">
|
|
|
<el-button @click="dialog.visible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="handleExport" v-if="itemList.value !== 0">导 出</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="handleExport"
|
|
|
+ v-if="itemList.value !== 0"
|
|
|
+ >导 出</el-button
|
|
|
+ >
|
|
|
+ <pagination
|
|
|
+ v-model:total="total"
|
|
|
+ v-model:page="searchForm.pageNo"
|
|
|
+ v-model:limit="searchForm.pageSize"
|
|
|
+ @pagination="handleQuery"
|
|
|
+ />
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -222,9 +282,8 @@
|
|
|
:key="index"
|
|
|
@click="toShowExcel(item)"
|
|
|
v-for="(item, index) in showProList"
|
|
|
- >{{ item.formName }}-{{ item.formCode }}({{ item.seqs }})
|
|
|
- </el-card
|
|
|
- >
|
|
|
+ >{{ item.formName }}-{{ item.formCode }}({{ item.seqs }})
|
|
|
+ </el-card>
|
|
|
</el-dialog>
|
|
|
<el-dialog
|
|
|
v-model="excelShow"
|
|
@@ -233,18 +292,23 @@
|
|
|
width="1600"
|
|
|
destroy-on-close
|
|
|
>
|
|
|
- <ExcelDataBbox :data="ExDataObj" @close="excelShow = false"/>
|
|
|
+ <ExcelDataBbox :data="ExDataObj" @close="excelShow = false" />
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import {ref, getCurrentInstance} from "vue";
|
|
|
-import {useCrud} from "@/hooks/userCrud";
|
|
|
-import {exportOperationRecord, queryFormList, queryProductHandover, updateHandoverList} from "@/api/process";
|
|
|
-import {useCommonStoreHook} from "@/store";
|
|
|
+import { ref, getCurrentInstance } from "vue";
|
|
|
+import { useCrud } from "@/hooks/userCrud";
|
|
|
+import {
|
|
|
+ exportOperationRecord,
|
|
|
+ queryFormList,
|
|
|
+ queryProductHandoverPage,
|
|
|
+ updateHandoverList,
|
|
|
+} from "@/api/process";
|
|
|
+import { useCommonStoreHook } from "@/store";
|
|
|
import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
|
|
|
-const {isShowTable, tableType} = toRefs(useCommonStoreHook());
|
|
|
+const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
|
import ExcelDataBbox from "@/views/base/apply/excelDataBbox.vue";
|
|
|
|
|
|
const test = () => {
|
|
@@ -253,16 +317,16 @@ const test = () => {
|
|
|
};
|
|
|
const radio = ref(0);
|
|
|
// 传入一个url,后面不带/
|
|
|
-const {form, data, option, search, page, toDeleteIds, Methords, Utils} =
|
|
|
+const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
|
dataListUrl: "/api/v1/proRecord/queryCompleteOpList",
|
|
|
});
|
|
|
-const {dataList, createRow, updateRow, deleteRow, searchChange, resetChange} =
|
|
|
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
Methords; //增删改查
|
|
|
-const {selectionChange, multipleDelete} = Methords; //选中和批量删除事件
|
|
|
-const {checkBtnPerm, downloadTemplate, exportData} = Utils; //按钮权限等工具
|
|
|
+const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
+const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
|
const loading = ref(false);
|
|
|
-const times = ref(null)
|
|
|
+const times = ref(null);
|
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
const dialog = reactive({
|
|
|
title: "产品交接",
|
|
@@ -276,11 +340,11 @@ const dialog0 = reactive({
|
|
|
const createRowSave = (row, done, loading) => {
|
|
|
if (!row.startDate || !row.endDate) {
|
|
|
ElMessage.error("请选择日期");
|
|
|
- loading()
|
|
|
+ loading();
|
|
|
} else {
|
|
|
done();
|
|
|
times.value = row;
|
|
|
- dialog0.visible = true
|
|
|
+ dialog0.visible = true;
|
|
|
}
|
|
|
|
|
|
/*form.value.type = "0"
|
|
@@ -296,13 +360,30 @@ const createRowSave = (row, done, loading) => {
|
|
|
}).catch(() => {
|
|
|
loading()
|
|
|
});*/
|
|
|
-}
|
|
|
+};
|
|
|
+
|
|
|
+const searchForm = ref({
|
|
|
+ materialModel: "",
|
|
|
+ workOrderCode: "",
|
|
|
+ startDate: "",
|
|
|
+ endDate: "",
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 10,
|
|
|
+});
|
|
|
+
|
|
|
+const total = ref(0);
|
|
|
|
|
|
-const searchForm = ref();
|
|
|
+const handleQuery = () => {
|
|
|
+ queryProductHandoverPage(searchForm.value).then((data) => {
|
|
|
+ itemList.value = data.data.records;
|
|
|
+ total.value = data.data.totalCount;
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
const handleSearch = () => {
|
|
|
- queryProductHandover(searchForm.value).then((data) => {
|
|
|
- itemList.value = data.data;
|
|
|
+ queryProductHandoverPage(searchForm.value).then((data) => {
|
|
|
+ itemList.value = data.data.records;
|
|
|
+ total.value = data.data.totalCount;
|
|
|
});
|
|
|
};
|
|
|
const handleReset = () => {
|
|
@@ -312,17 +393,22 @@ const handleReset = () => {
|
|
|
workOrderCode: "",
|
|
|
startDate: "",
|
|
|
endDate: "",
|
|
|
+ pageNo: 1,
|
|
|
+ pagesize: 10,
|
|
|
});
|
|
|
};
|
|
|
-const clickOperationType = ref(null)
|
|
|
-const itemList = ref([])
|
|
|
+const clickOperationType = ref(null);
|
|
|
+const itemList = ref([]);
|
|
|
const openDialog = (type, row) => {
|
|
|
- clickOperationType.value = row.operationType
|
|
|
+ clickOperationType.value = row.operationType;
|
|
|
searchForm.value = {
|
|
|
...row,
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 10,
|
|
|
};
|
|
|
- queryProductHandover(row).then((data) => {
|
|
|
- itemList.value = data.data;
|
|
|
+ queryProductHandoverPage(row).then((data) => {
|
|
|
+ itemList.value = data.data.records;
|
|
|
+ total.value = data.data.totalCount;
|
|
|
dialog.visible = true;
|
|
|
dialog.type = type;
|
|
|
});
|
|
@@ -333,15 +419,18 @@ const dialog8 = reactive({
|
|
|
});
|
|
|
const showProList = ref([]);
|
|
|
const formList = (row) => {
|
|
|
- queryFormList({...search.value, workOrderId: row.workOrderId, operationId: row.operationId}).then((data) => {
|
|
|
+ queryFormList({
|
|
|
+ ...search.value,
|
|
|
+ workOrderId: row.workOrderId,
|
|
|
+ operationId: row.operationId,
|
|
|
+ }).then((data) => {
|
|
|
if (data.data.length > 0) {
|
|
|
showProList.value = data.data;
|
|
|
dialog8.visible = true;
|
|
|
} else {
|
|
|
ElMessage.error("未关联到表单");
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
+ });
|
|
|
};
|
|
|
const saveItemList = () => {
|
|
|
updateHandoverList(itemList.value).then((data) => {
|
|
@@ -386,7 +475,7 @@ option.value = Object.assign(option.value, {
|
|
|
overHidden: true,
|
|
|
prop: "operationType",
|
|
|
search: true,
|
|
|
- type: 'select',
|
|
|
+ type: "select",
|
|
|
dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.process_type,
|
|
|
props: {
|
|
|
label: "dictLabel",
|
|
@@ -412,19 +501,23 @@ const toShowExcel = (item) => {
|
|
|
};
|
|
|
const handleExport = () => {
|
|
|
if (data.value.length !== 0) {
|
|
|
- exportOperationRecord({...searchForm.value, operationType: clickOperationType.value, type: 0}).then((response) => {
|
|
|
+ exportOperationRecord({
|
|
|
+ ...searchForm.value,
|
|
|
+ operationType: clickOperationType.value,
|
|
|
+ type: 0,
|
|
|
+ }).then((response) => {
|
|
|
try {
|
|
|
const decoder = new TextDecoder("utf-8");
|
|
|
const jsonString = decoder.decode(response.data);
|
|
|
const jsonObject = JSON.parse(jsonString);
|
|
|
- const {code, msg} = jsonObject;
|
|
|
+ const { code, msg } = jsonObject;
|
|
|
if (code != "200") {
|
|
|
ElMessage.error(msg);
|
|
|
}
|
|
|
} catch (e) {
|
|
|
downFile(response);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
} else {
|
|
|
ElMessage.error("请先搜索数据");
|
|
|
}
|
|
@@ -436,7 +529,7 @@ const downFile = (response) => {
|
|
|
);
|
|
|
const fileType =
|
|
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
|
|
|
- const blob = new Blob([fileData], {type: fileType});
|
|
|
+ const blob = new Blob([fileData], { type: fileType });
|
|
|
const downloadUrl = window.URL.createObjectURL(blob);
|
|
|
const downloadLink = document.createElement("a");
|
|
|
downloadLink.href = downloadUrl;
|
|
@@ -447,8 +540,8 @@ const downFile = (response) => {
|
|
|
window.URL.revokeObjectURL(downloadUrl);
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
- form.value.type = "0"
|
|
|
- search.value.type = "0"
|
|
|
+ form.value.type = "0";
|
|
|
+ search.value.type = "0";
|
|
|
|
|
|
const now = new Date();
|
|
|
const year = now.getFullYear();
|
|
@@ -456,8 +549,8 @@ onMounted(() => {
|
|
|
// 当月结束日期
|
|
|
const daysInMonth = new Date(year, now.getMonth() + 1, 0).getDate();
|
|
|
month = month.toLocaleString().length === 1 ? "0" + month : month;
|
|
|
- search.value.startDate = year + "-" + month + "-" + "01"
|
|
|
- search.value.endDate = year + "-" + month + "-" + daysInMonth
|
|
|
+ search.value.startDate = year + "-" + month + "-" + "01";
|
|
|
+ search.value.endDate = year + "-" + month + "-" + daysInMonth;
|
|
|
dataList();
|
|
|
});
|
|
|
</script>
|