|
@@ -17,28 +17,28 @@
|
|
|
@current-change="dataList"
|
|
|
@selection-change="selectionChange"
|
|
|
>
|
|
|
- <template #menu-right="{}">
|
|
|
+<!-- <template #menu-right="{}">
|
|
|
<el-button
|
|
|
class="ml-3"
|
|
|
@click="handleExport"
|
|
|
>
|
|
|
<template #icon> <i-ep-download /> </template>导出
|
|
|
</el-button>
|
|
|
- </template>
|
|
|
+ </template>-->
|
|
|
<template #menu="{ size, row, index }">
|
|
|
- <el-button
|
|
|
+<!-- <el-button
|
|
|
icon="el-icon-edit"
|
|
|
text
|
|
|
@click="openDialog(1, row.id)"
|
|
|
type="primary"
|
|
|
:size="size"
|
|
|
>编辑</el-button
|
|
|
- >
|
|
|
+ >-->
|
|
|
|
|
|
<el-button
|
|
|
- icon="el-icon-edit"
|
|
|
+ icon="el-icon-view"
|
|
|
text
|
|
|
- @click="openDialog(0, row.id)"
|
|
|
+ @click="openDialog(0, row)"
|
|
|
type="primary"
|
|
|
:size="size"
|
|
|
>详情</el-button
|
|
@@ -48,7 +48,7 @@
|
|
|
<el-dialog
|
|
|
v-model="dialog.visible"
|
|
|
:title="dialog.title"
|
|
|
- width="1500px"
|
|
|
+ width="1600px"
|
|
|
@close="dialog.visible = false"
|
|
|
>
|
|
|
<el-table :data="itemList" border style="width: 100%">
|
|
@@ -90,7 +90,7 @@
|
|
|
<el-input v-model="scope.row.useDevice"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="craftCondition" label="工艺条件)" width="140">
|
|
|
+ <el-table-column prop="craftCondition" label="工艺条件" width="140">
|
|
|
<template v-if="dialog.type === 1" #default="scope">
|
|
|
<el-input v-model="scope.row.craftCondition"></el-input>
|
|
|
</template>
|
|
@@ -123,9 +123,10 @@
|
|
|
<div
|
|
|
class="dialog-footer"
|
|
|
align="center"
|
|
|
+ style="margin-top: 10px;"
|
|
|
>
|
|
|
<el-button @click="dialog.visible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="saveItemList" v-if="dialog.type === 1" >保 存</el-button>
|
|
|
+ <el-button type="primary" @click="handleExport" v-if="itemList.value !== 0">导 出</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -308,9 +309,10 @@
|
|
|
<div
|
|
|
class="dialog-footer"
|
|
|
align="center"
|
|
|
+ style="margin-top: 10px"
|
|
|
>
|
|
|
<el-button @click="dialog1.visible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="saveDetails" v-if="dialog.type === 1" >保 存</el-button>
|
|
|
+ <el-button type="primary" @click="handleExport1">导 出</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -318,8 +320,9 @@
|
|
|
<script setup>
|
|
|
import { ref, getCurrentInstance } from "vue";
|
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
|
-import { exportOperationRecord ,addProRecord,queryProductHandover,updateHandoverList,queryHInfo,saveOpDetails} from "@/api/process";
|
|
|
+import { exportOperationRecord,exportOperationRecord1 ,addProRecord,queryProductHandover,updateHandoverList,queryHInfo,saveOpDetails} from "@/api/process";
|
|
|
import { useCommonStoreHook } from "@/store";
|
|
|
+import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
|
const test = () => {
|
|
|
isShowTable.value = true;
|
|
@@ -329,7 +332,7 @@ const radio = ref(0);
|
|
|
// 传入一个url,后面不带/
|
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
|
- src: "/api/v1/proRecord",
|
|
|
+ dataListUrl: "/api/v1/proRecord/queryCompleteOpList",
|
|
|
});
|
|
|
const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
Methords; //增删改查
|
|
@@ -368,27 +371,29 @@ const hInfo = ref({
|
|
|
operator: '',
|
|
|
materialModel: ''
|
|
|
})
|
|
|
-const openDialog = (type, id) => {
|
|
|
- queryProductHandover(id).then((data) => {
|
|
|
+const clickOperationType = ref(null)
|
|
|
+const openDialog = (type, row) => {
|
|
|
+ clickOperationType.value = row.operationType
|
|
|
+ row.type = 1
|
|
|
+ queryProductHandover(row).then((data) => {
|
|
|
itemList.value = data.data;
|
|
|
dialog.visible = true;
|
|
|
dialog.type = type;
|
|
|
});
|
|
|
};
|
|
|
const clickH = (row) =>{
|
|
|
- queryHInfo(row.id).then((data)=>{
|
|
|
- if(data.data !== null){
|
|
|
+ if(null === row.detailId){
|
|
|
+ hInfo.value = JSON.parse(JSON.stringify(row))
|
|
|
+ hInfo.value.operator = row.reReceiveUser
|
|
|
+ hInfo.value.operatorTime = row.reDate
|
|
|
+ hInfo.value.handoverId = row.id
|
|
|
+ hInfo.value.num = row.reNum
|
|
|
+ }else{
|
|
|
+ queryHInfo(row.detailId).then((data)=>{
|
|
|
hInfo.value = data.data
|
|
|
- }else{
|
|
|
- hInfo.value = JSON.parse(JSON.stringify(row))
|
|
|
- hInfo.value.operator = row.reReceiveUser
|
|
|
- hInfo.value.operatorTime = row.reDate
|
|
|
- hInfo.value.handoverId = row.id
|
|
|
- hInfo.value.num = row.reNum
|
|
|
- }
|
|
|
- dialog1.visible = true
|
|
|
- });
|
|
|
-
|
|
|
+ });
|
|
|
+ }
|
|
|
+ dialog1.visible = true
|
|
|
}
|
|
|
|
|
|
const saveDetails = ()=>{
|
|
@@ -415,7 +420,9 @@ option.value = Object.assign(option.value, {
|
|
|
searchEnter: true,
|
|
|
editBtn: false,
|
|
|
viewBtn: false,
|
|
|
- selection: true,
|
|
|
+ delBtn: false,
|
|
|
+ addBtn: false,
|
|
|
+ selection: false,
|
|
|
column: [
|
|
|
{
|
|
|
label: "开始日期",
|
|
@@ -436,28 +443,45 @@ option.value = Object.assign(option.value, {
|
|
|
overHidden: true,
|
|
|
},
|
|
|
{
|
|
|
- label: "操作人",
|
|
|
+ label: "工序类型",
|
|
|
overHidden: true,
|
|
|
- prop: "creator",
|
|
|
+ prop: "operationType",
|
|
|
search: true,
|
|
|
+ type: 'select',
|
|
|
+ dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.process_type,
|
|
|
+ props: {
|
|
|
+ label: "dictLabel",
|
|
|
+ value: "dictValue",
|
|
|
+ },
|
|
|
addDisplay: false,
|
|
|
editDisplay: false,
|
|
|
},
|
|
|
{
|
|
|
- label: "操作时间",
|
|
|
+ label: "完工数量",
|
|
|
overHidden: true,
|
|
|
- prop: "created",
|
|
|
+ prop: "completeNum",
|
|
|
addDisplay: false,
|
|
|
editDisplay: false,
|
|
|
},
|
|
|
],
|
|
|
});
|
|
|
const handleExport = () => {
|
|
|
- if(toDeleteIds.value.length == 0){
|
|
|
- ElMessage.error("请选择数据导出");
|
|
|
- return;
|
|
|
- }
|
|
|
- exportOperationRecord({ids: toDeleteIds.value,type: 1}).then((response) => {
|
|
|
+ exportOperationRecord({...search.value,operationType: clickOperationType.value,type: 1}).then((response) => {
|
|
|
+ try {
|
|
|
+ const decoder = new TextDecoder("utf-8");
|
|
|
+ const jsonString = decoder.decode(response.data);
|
|
|
+ const jsonObject = JSON.parse(jsonString);
|
|
|
+ const { code, msg } = jsonObject;
|
|
|
+ if (code != "200") {
|
|
|
+ ElMessage.error(msg);
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ downFile(response);
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+const handleExport1 = () => {
|
|
|
+ exportOperationRecord1(hInfo.value).then((response) => {
|
|
|
try {
|
|
|
const decoder = new TextDecoder("utf-8");
|
|
|
const jsonString = decoder.decode(response.data);
|
|
@@ -491,6 +515,14 @@ const downFile = (response) => {
|
|
|
onMounted(() => {
|
|
|
form.value.type = "1"
|
|
|
search.value.type = "1"
|
|
|
+ const now = new Date();
|
|
|
+ const year = now.getFullYear();
|
|
|
+ let month = now.getMonth() + 1; // 从0开始的月份
|
|
|
+ // 当月结束日期
|
|
|
+ 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
|
|
|
dataList();
|
|
|
});
|
|
|
</script>
|