|
@@ -17,28 +17,20 @@
|
|
@current-change="dataList"
|
|
@current-change="dataList"
|
|
@selection-change="selectionChange"
|
|
@selection-change="selectionChange"
|
|
>
|
|
>
|
|
- <template #menu-right="{}">
|
|
|
|
- <el-button
|
|
|
|
- class="ml-3"
|
|
|
|
- @click="handleExport"
|
|
|
|
- >
|
|
|
|
- <template #icon> <i-ep-download /> </template>导出
|
|
|
|
- </el-button>
|
|
|
|
- </template>
|
|
|
|
<template #menu="{ size, row, index }">
|
|
<template #menu="{ size, row, index }">
|
|
- <el-button
|
|
|
|
|
|
+<!-- <el-button
|
|
icon="el-icon-edit"
|
|
icon="el-icon-edit"
|
|
text
|
|
text
|
|
@click="openDialog(1, row.id)"
|
|
@click="openDialog(1, row.id)"
|
|
type="primary"
|
|
type="primary"
|
|
:size="size"
|
|
:size="size"
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
- >
|
|
|
|
|
|
+ >-->
|
|
|
|
|
|
<el-button
|
|
<el-button
|
|
- icon="el-icon-edit"
|
|
|
|
|
|
+ icon="el-icon-view"
|
|
text
|
|
text
|
|
- @click="openDialog(0, row.id)"
|
|
|
|
|
|
+ @click="openDialog(0, row)"
|
|
type="primary"
|
|
type="primary"
|
|
:size="size"
|
|
:size="size"
|
|
>详情</el-button
|
|
>详情</el-button
|
|
@@ -48,9 +40,17 @@
|
|
<el-dialog
|
|
<el-dialog
|
|
v-model="dialog.visible"
|
|
v-model="dialog.visible"
|
|
:title="dialog.title"
|
|
:title="dialog.title"
|
|
- width="1500px"
|
|
|
|
|
|
+ width="1650px"
|
|
@close="dialog.visible = false"
|
|
@close="dialog.visible = false"
|
|
>
|
|
>
|
|
|
|
+
|
|
|
|
+<!-- <el-button
|
|
|
|
+ class="ml-3"
|
|
|
|
+ style="margin-bottom: 5px;"
|
|
|
|
+ @click="handleExport"
|
|
|
|
+ >
|
|
|
|
+ <template #icon> <i-ep-download /> </template>导出
|
|
|
|
+ </el-button>-->
|
|
<el-table :data="itemList" border style="width: 100%" span-method="objectSpanMethod">
|
|
<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="operationName" label="工序" width="100"/>
|
|
<el-table-column show-overflow-tooltip prop="materialModel" label="物料型号" width="100"/>
|
|
<el-table-column show-overflow-tooltip prop="materialModel" label="物料型号" width="100"/>
|
|
@@ -124,10 +124,11 @@
|
|
|
|
|
|
<div
|
|
<div
|
|
class="dialog-footer"
|
|
class="dialog-footer"
|
|
|
|
+ style="margin-top: 10px;"
|
|
align="center"
|
|
align="center"
|
|
>
|
|
>
|
|
<el-button @click="dialog.visible = false">取 消</el-button>
|
|
<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>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
@@ -137,6 +138,7 @@ import { ref, getCurrentInstance } from "vue";
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
import { useCrud } from "@/hooks/userCrud";
|
|
import { exportOperationRecord ,addProRecord,queryProductHandover,updateHandoverList} from "@/api/process";
|
|
import { exportOperationRecord ,addProRecord,queryProductHandover,updateHandoverList} from "@/api/process";
|
|
import { useCommonStoreHook } from "@/store";
|
|
import { useCommonStoreHook } from "@/store";
|
|
|
|
+import dictDataUtil from "@/common/configs/dictDataUtil";
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
const { isShowTable, tableType } = toRefs(useCommonStoreHook());
|
|
const test = () => {
|
|
const test = () => {
|
|
isShowTable.value = true;
|
|
isShowTable.value = true;
|
|
@@ -146,21 +148,41 @@ const radio = ref(0);
|
|
// 传入一个url,后面不带/
|
|
// 传入一个url,后面不带/
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
useCrud({
|
|
useCrud({
|
|
- src: "/api/v1/proRecord",
|
|
|
|
|
|
+ dataListUrl: "/api/v1/proRecord/queryCompleteOpList",
|
|
});
|
|
});
|
|
const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
Methords; //增删改查
|
|
Methords; //增删改查
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
|
|
+const times = ref(null)
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
const dialog = reactive({
|
|
const dialog = reactive({
|
|
title: "产品交接",
|
|
title: "产品交接",
|
|
visible: false,
|
|
visible: false,
|
|
type: 0,
|
|
type: 0,
|
|
});
|
|
});
|
|
|
|
+const dialog0 = reactive({
|
|
|
|
+ title: "完工工序",
|
|
|
|
+ visible: false,
|
|
|
|
+});
|
|
const createRowSave = (row,done,loading) =>{
|
|
const createRowSave = (row,done,loading) =>{
|
|
- form.value.type = "0"
|
|
|
|
|
|
+ if(!row.startDate || !row.endDate){
|
|
|
|
+ ElMessage.error("请选择日期");
|
|
|
|
+ loading()
|
|
|
|
+ }else{
|
|
|
|
+ done();
|
|
|
|
+ times.value = row;
|
|
|
|
+ dialog0.visible = true
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /*form.value.type = "0"
|
|
addProRecord(form.value).then((data) =>{
|
|
addProRecord(form.value).then((data) =>{
|
|
ElMessage.success(data.msg);
|
|
ElMessage.success(data.msg);
|
|
form.value.startDate = "";
|
|
form.value.startDate = "";
|
|
@@ -172,11 +194,13 @@ const createRowSave = (row,done,loading) =>{
|
|
dataList()
|
|
dataList()
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
loading()
|
|
loading()
|
|
- });
|
|
|
|
|
|
+ });*/
|
|
}
|
|
}
|
|
|
|
+const clickOperationType = ref(null)
|
|
const itemList = ref([])
|
|
const itemList = ref([])
|
|
-const openDialog = (type, id) => {
|
|
|
|
- queryProductHandover(id).then((data) => {
|
|
|
|
|
|
+const openDialog = (type, row) => {
|
|
|
|
+ clickOperationType.value = row.operationType
|
|
|
|
+ queryProductHandover(row).then((data) => {
|
|
itemList.value = data.data;
|
|
itemList.value = data.data;
|
|
dialog.visible = true;
|
|
dialog.visible = true;
|
|
dialog.type = type;
|
|
dialog.type = type;
|
|
@@ -197,8 +221,10 @@ const saveItemList = () => {
|
|
option.value = Object.assign(option.value, {
|
|
option.value = Object.assign(option.value, {
|
|
searchEnter: true,
|
|
searchEnter: true,
|
|
editBtn: false,
|
|
editBtn: false,
|
|
|
|
+ delBtn: false,
|
|
viewBtn: false,
|
|
viewBtn: false,
|
|
- selection: true,
|
|
|
|
|
|
+ addBtn: false,
|
|
|
|
+ selection: false,
|
|
column: [
|
|
column: [
|
|
{
|
|
{
|
|
label: "开始日期",
|
|
label: "开始日期",
|
|
@@ -219,40 +245,46 @@ option.value = Object.assign(option.value, {
|
|
overHidden: true,
|
|
overHidden: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- label: "操作人",
|
|
|
|
|
|
+ label: "工序类型",
|
|
overHidden: true,
|
|
overHidden: true,
|
|
- prop: "creator",
|
|
|
|
|
|
+ prop: "operationType",
|
|
search: true,
|
|
search: true,
|
|
|
|
+ type: 'select',
|
|
|
|
+ dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.process_type,
|
|
|
|
+ props: {
|
|
|
|
+ label: "dictLabel",
|
|
|
|
+ value: "dictValue",
|
|
|
|
+ },
|
|
addDisplay: false,
|
|
addDisplay: false,
|
|
editDisplay: false,
|
|
editDisplay: false,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- label: "操作时间",
|
|
|
|
|
|
+ label: "完工数量",
|
|
overHidden: true,
|
|
overHidden: true,
|
|
- prop: "created",
|
|
|
|
|
|
+ prop: "completeNum",
|
|
addDisplay: false,
|
|
addDisplay: false,
|
|
editDisplay: false,
|
|
editDisplay: false,
|
|
},
|
|
},
|
|
],
|
|
],
|
|
});
|
|
});
|
|
const handleExport = () => {
|
|
const handleExport = () => {
|
|
- if(toDeleteIds.value.length == 0){
|
|
|
|
- ElMessage.error("请选择数据导出");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- exportOperationRecord({ids: toDeleteIds.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;
|
|
|
|
- if (code != "200") {
|
|
|
|
- ElMessage.error(msg);
|
|
|
|
|
|
+ if(data.value.length !== 0){
|
|
|
|
+ exportOperationRecord({...search.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;
|
|
|
|
+ if (code != "200") {
|
|
|
|
+ ElMessage.error(msg);
|
|
|
|
+ }
|
|
|
|
+ } catch (e) {
|
|
|
|
+ downFile(response);
|
|
}
|
|
}
|
|
- } catch (e) {
|
|
|
|
- downFile(response);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ ElMessage.error("请先搜索数据");
|
|
|
|
+ }
|
|
};
|
|
};
|
|
const downFile = (response) => {
|
|
const downFile = (response) => {
|
|
const fileData = response.data;
|
|
const fileData = response.data;
|
|
@@ -274,6 +306,15 @@ const downFile = (response) => {
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
form.value.type = "0"
|
|
form.value.type = "0"
|
|
search.value.type = "0"
|
|
search.value.type = "0"
|
|
|
|
+
|
|
|
|
+ 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();
|
|
dataList();
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|