From d021a732673b7667c8eb781559842255e1927c36 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期三, 10 十二月 2025 08:03:53 +0800
Subject: [PATCH] 调整直接调拨单编辑 添加 辅助属性 模块
---
src/views/gyMaterial/GyMaterial.vue | 659 +++++++++++++++++++++++++++--------------------------------
1 files changed, 305 insertions(+), 354 deletions(-)
diff --git a/src/views/gyMaterial/GyMaterial.vue b/src/views/gyMaterial/GyMaterial.vue
index 1f2fec3..5d8df4a 100644
--- a/src/views/gyMaterial/GyMaterial.vue
+++ b/src/views/gyMaterial/GyMaterial.vue
@@ -1,6 +1,6 @@
<template>
<div style="padding: 10px">
- <el-card style="margin-bottom: 10px;">
+ <el-card style="margin-bottom: 10px">
<el-form :inline="true" :model="queryParams" ref="queryForm" class="mb8">
<el-form-item label="鐗╂枡浠g爜" prop="HNumber">
<el-input
@@ -23,10 +23,10 @@
style="width: 160px"
>
<el-option
- v-for="item in organizationOptions"
- :key="item.ID"
+ v-for="(item, index) in organizationOptions"
+ :key="index"
:label="item.Name"
- :value="item.ID"
+ :value="item.ID.toString()"
/>
</el-select>
</el-form-item>
@@ -50,10 +50,18 @@
placeholder="璇疯緭鍏ョ墿鏂欎唬鐮�"
style="width: 160px"
/>
- <el-button type="primary" size="mini" @click="handleResCnz" style="margin-left: 10px">閲嶆柊鍚屾</el-button>
+ <el-button
+ type="primary"
+ size="mini"
+ @click="handleResCnz"
+ style="margin-left: 10px"
+ >閲嶆柊鍚屾</el-button
+ >
</el-form-item>
<el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
+ >鎼滅储</el-button
+ >
<el-button size="mini" @click="resetQuery">閲嶇疆</el-button>
</el-form-item>
</el-form>
@@ -67,7 +75,7 @@
style="width: 160px"
/>
</el-form-item>
- <el-card class="box-card" style="margin-top: 20px;">
+ <el-card class="box-card" style="margin-top: 20px">
<div slot="header" class="clearfix"><span>杩囨护</span></div>
<div>
<el-form-item label-width="0">
@@ -201,159 +209,85 @@
</el-collapse-item>
</el-collapse>
</el-form>
- <div style="text-align:center;font-size:15px;font-weight:bold;color:#fc9393;margin: 20px 0;">
+ <div
+ style="
+ text-align: center;
+ font-size: 15px;
+ font-weight: bold;
+ color: #fc9393;
+ margin: 20px 0;
+ "
+ >
{{ currentFilterScheme }}
</div>
</el-card>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
- <el-button
- type="primary"
- plain
- size="mini"
- @click="handleImport"
- >瀵煎叆</el-button
- >
+ <el-button type="primary" plain size="mini" @click="handleImport">瀵煎叆</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- type="primary"
- plain
- size="mini"
- @click="handleExport"
- >瀵煎嚭</el-button
- >
+ <el-button type="primary" plain size="mini" @click="handleExport">瀵煎嚭</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- type="primary"
- size="mini"
- @click="handleNumAdd"
- >娴佹按鍙锋柊澧�</el-button
- >
+ <el-button type="primary" size="mini" @click="handleNumAdd">娴佹按鍙锋柊澧�</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- type="primary"
- size="mini"
- @click="handleAdd"
- >鏂板</el-button
- >
+ <el-button type="primary" size="mini" @click="handleAdd">鏂板</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- size="mini"
- :disabled="single"
- @click="handleCopy"
- >澶嶅埗</el-button
- >
+ <el-button size="mini" :disabled="single" @click="handleCopy">澶嶅埗</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- size="mini"
- :disabled="single"
- @click="handleEdit"
- >缂栬緫</el-button
- >
+ <el-button size="mini" :disabled="single" @click="handleEdit">缂栬緫</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- type="danger"
- size="mini"
- :disabled="single"
- @click="handleDelete"
+ <el-button type="danger" size="mini" :disabled="single" @click="handleDelete"
>鍒犻櫎</el-button
>
</el-col>
<el-col :span="1.5">
- <el-button
- size="mini"
- :disabled="single"
- @click="handleAudit(0)"
- >瀹℃牳</el-button
- >
+ <el-button size="mini" :disabled="single" @click="handleAudit(0)">瀹℃牳</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- size="mini"
- :disabled="single"
- @click="handleAudit(1)"
+ <el-button size="mini" :disabled="single" @click="handleAudit(1)"
>鍙嶅鏍�</el-button
>
</el-col>
<el-col :span="1.5">
- <el-button
- size="mini"
- :disabled="single"
- @click="handleStop(0)"
- >绂佺敤</el-button
- >
+ <el-button size="mini" :disabled="single" @click="handleStop(0)">绂佺敤</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- size="mini"
- :disabled="single"
- @click="handleStop(1)"
+ <el-button size="mini" :disabled="single" @click="handleStop(1)"
>鍙嶇鐢�</el-button
>
</el-col>
<el-col :span="1.5">
- <el-button
- size="mini"
- @click="handleColumnSetting"
- >鍒楄缃�</el-button
- >
+ <el-button size="mini" @click="handleColumnSetting">鍒楄缃�</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- size="mini"
- @click="handleButtonSetting"
- >鎸夐挳璁剧疆</el-button
- >
+ <el-button size="mini" @click="handleButtonSetting">鎸夐挳璁剧疆</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- type="primary"
- size="mini"
- @click="handleSaveScheme"
+ <el-button type="primary" size="mini" @click="handleSaveScheme"
>淇濆瓨鏂规</el-button
>
</el-col>
<el-col :span="1.5">
- <el-button
- type="primary"
- size="mini"
- @click="handleReadScheme"
+ <el-button type="primary" size="mini" @click="handleReadScheme"
>璇诲彇鏂规</el-button
>
</el-col>
<el-col :span="1.5">
- <el-button
- size="mini"
- @click="handleRefresh"
- >鍒锋柊</el-button
- >
+ <el-button size="mini" @click="handleRefresh">鍒锋柊</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- size="mini"
- @click="handleExit"
- >閫�鍑�</el-button
- >
+ <el-button size="mini" @click="handleExit">閫�鍑�</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- type="primary"
- size="mini"
- @click="handleCorrect"
- >鎵规敼</el-button
- >
+ <el-button type="primary" size="mini" @click="handleCorrect">鎵规敼</el-button>
</el-col>
<el-col :span="1.5">
- <el-button
- type="primary"
- size="mini"
- @click="handleCorrect2"
+ <el-button type="primary" size="mini" @click="handleCorrect2"
>鎵规敼(鏂规2)</el-button
>
</el-col>
@@ -361,11 +295,13 @@
<el-row :gutter="10" style="margin-top: 10px">
<el-col :span="6">
- <el-card style="height: 600px; overflow: hidden; display: flex; flex-direction: column;">
+ <el-card
+ style="height: 600px; overflow: hidden; display: flex; flex-direction: column"
+ >
<div slot="header">
<span>鐗╂枡鍒嗙被</span>
</div>
- <div style="flex: 1; overflow: auto; margin-bottom: 10px;">
+ <div style="flex: 1; overflow: auto; margin-bottom: 10px">
<el-tree
:data="treeData"
:props="treeProps"
@@ -381,31 +317,38 @@
</span>
</el-tree>
</div>
- <div style="height: 200px; border: 1px solid #ebeef5; border-radius: 4px;">
- <el-carousel
- :autoplay="false"
- indicator-position="none"
+ <div style="height: 200px; border: 1px solid #ebeef5; border-radius: 4px">
+ <el-carousel
+ :autoplay="false"
+ indicator-position="none"
height="200px"
ref="carousel"
>
<el-carousel-item v-for="(item, index) in fileList" :key="index">
<div v-if="item.type === 'image'" class="carousel-item">
- <img
- :src="item.url"
- :alt="item.name"
- style="width: 100%; height: 100%; object-fit: contain;"
+ <img
+ :src="item.url"
+ :alt="item.name"
+ style="width: 100%; height: 100%; object-fit: contain"
@click="previewImg(item.url)"
/>
</div>
<div v-else-if="item.type === 'pdf'" class="carousel-item">
- <embed
- :src="item.url"
- type="application/pdf"
- style="width: 100%; height: 100%;"
+ <embed
+ :src="item.url"
+ type="application/pdf"
+ style="width: 100%; height: 100%"
/>
</div>
<div v-else class="carousel-item">
- <h1 style="text-align:center;line-height:180px;color:red;font-weight:bolder;">
+ <h1
+ style="
+ text-align: center;
+ line-height: 180px;
+ color: red;
+ font-weight: bolder;
+ "
+ >
鏆傛湭涓婁紶鏂囦欢
</h1>
</div>
@@ -450,7 +393,12 @@
v-if="column.property === '鐗╂枡浠g爜'"
>{{ row[column.property] }}</el-button
>
- <span v-else-if="(column.property || '').includes('鏃堕棿') || (column.property || '').includes('鏃ユ湡')">
+ <span
+ v-else-if="
+ (column.property || '').includes('鏃堕棿') ||
+ (column.property || '').includes('鏃ユ湡')
+ "
+ >
{{ formatDate(row[column.property]) }}
</span>
<span v-else>{{ row[column.property] }}</span>
@@ -464,7 +412,7 @@
:page.sync="page"
:limit.sync="pageSize"
:pageSizes="pageSizes"
- @pagination="getList"
+ @pagination="handleQuery"
/>
</div>
</el-col>
@@ -476,7 +424,7 @@
top="5vh"
:before-close="handlePreviewClose"
>
- <img :src="previewImage" style="width: 100%;" />
+ <img :src="previewImage" style="width: 100%" />
</el-dialog>
<el-dialog
@@ -511,10 +459,7 @@
/>
</el-dialog>
- <MaterialCorrection
- :visible.sync="openCorrect"
- @close="closeCorrect"
- />
+ <MaterialCorrection :visible.sync="openCorrect" @close="closeCorrect" />
<el-dialog
title="鎵规敼(鏂规2)"
@@ -523,7 +468,7 @@
append-to-body
:before-close="closeCorrect2"
>
- <div style="text-align: center; padding: 50px;">
+ <div style="text-align: center; padding: 50px">
<h2>鐗╂枡鎵规敼鍔熻兘(鏂规2)</h2>
<p>鐗╂枡鎵规敼鍔熻兘(鏂规2)寰呭悗缁紑鍙�</p>
<el-button type="primary" @click="closeCorrect2">鍏抽棴</el-button>
@@ -537,8 +482,12 @@
append-to-body
>
<div style="margin-top: -20px">
- <el-button type="primary" size="mini" @click="handleImportSubmit">瀵煎叆鏁版嵁</el-button>
- <el-button type="primary" size="mini" @click="upload.open = false">閫� 鍑�</el-button>
+ <el-button type="primary" size="mini" @click="handleImportSubmit"
+ >瀵煎叆鏁版嵁</el-button
+ >
+ <el-button type="primary" size="mini" @click="upload.open = false"
+ >閫� 鍑�</el-button
+ >
<el-upload
ref="upload"
:limit="1"
@@ -552,12 +501,7 @@
<el-button type="primary" size="mini">鏂囦欢涓婁紶</el-button>
</el-upload>
</div>
- <el-table
- :data="uploadData"
- v-loading="uploadTableLoading"
- border
- height="550"
- >
+ <el-table :data="uploadData" v-loading="uploadTableLoading" border height="550">
<el-table-column type="index" label="搴忓彿" width="55" align="center" />
<el-table-column label="鐗╂枡浠g爜" prop="鐗╂枡浠g爜" align="center" width="120" />
<el-table-column label="鐗╂枡鍚嶇О" prop="鐗╂枡鍚嶇О" align="center" width="120" />
@@ -586,55 +530,55 @@
export default {
name: "GyMaterial",
- components: { RowSettings,MaterialEdit,MaterialCorrection },
+ components: { RowSettings, MaterialEdit, MaterialCorrection },
props: {
openPage: { type: String },
},
data() {
return {
- activeCollapse: [],
-
+ activeCollapse: [],
+
HModName: "Gy_Material",
HModuleName: "鐗╂枡鍒楄〃缁存姢",
HClassTag: "ForFilteringSchemes",
treeData: [],
treeProps: {
- children: 'children',
- label: 'title'
+ children: "children",
+ label: "title",
},
currentMaterTypeID: 0,
-
+
fileList: [
{
- type: 'empty',
- url: '',
- name: '鏆傛棤鏂囦欢'
- }
+ type: "empty",
+ url: "",
+ name: "鏆傛棤鏂囦欢",
+ },
],
-
+
// 缂栬緫鐩稿叧
editShow: false,
openEdit: false,
OperationType: null,
editTitle: "缂栬緫鐗╂枡",
currentEditId: 0,
-
+
// 鎵规敼鐩稿叧
openCorrect: false,
openCorrect2: false,
-
+
// 鍒楄缃�
columnSettingShow: false,
openColumnSetting: false,
-
+
// 鍥剧墖棰勮
previewVisible: false,
- previewImage: '',
-
+ previewImage: "",
+
// 琛ㄦ牸鏄剧ず
tableShow: true,
loading: true,
-
+
queryParams: {
HNumber: null,
HName: null,
@@ -652,7 +596,7 @@
ColContent1: "",
ColContent2: "",
},
- organizationOptions: [],
+ organizationOptions: JSON.parse(sessionStorage["organizationList"]),
projectOptions: [],
currentFilterScheme: "",
HInterID_Choose: 0,
@@ -668,7 +612,7 @@
{ label: "鍙冲寘鍚�", value: "9" },
{ label: "涓嶅寘鍚�", value: "10" },
],
-
+
sWhere: "",
selectedRow: null,
ids: [],
@@ -691,41 +635,32 @@
},
uploadData: [],
uploadTableLoading: false,
-
+
baseURL: process.env.VUE_APP_BASE_API,
user: "admin",
};
},
computed: {
visibleColumns() {
- return this.btList.filter(item => !item.hide && item.field);
- }
+ return this.btList.filter((item) => !item.hide && item.field);
+ },
},
created() {
+ this.user = sessionStorage["HUserName"];
+ this.queryParams.HOrgID = sessionStorage["OrganizationID"];
+ },
+ mounted() {
this.fetchData();
},
methods: {
fetchData() {
- axios
- .get(
- "http://47.96.97.237/API/Web/GetUser?UserName=001&PassWord=123456&HOrgName=100038"
- )
- .then((response) => {
- let data = response.data.data[0];
- this.user = data.Czymc;
-
- this.getOrganizations();
- this.queryParams.HOrgID = data.HUSEORGID;
- this.getTreeData();
- this.getProjectOptions();
- this.getList();
- //this.getDefaultFilterScheme();
- })
- .catch((error) => {
- this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
- });
+ this.getOrganizations();
+ this.getTreeData();
+ this.getProjectOptions();
+ this.handleQuery();
+ //this.getDefaultFilterScheme();
},
-
+
getOrganizations() {
axios
.get(this.baseURL + "/Web/GetOrganizations")
@@ -741,13 +676,13 @@
this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
});
},
-
+
getTreeData() {
axios
- .get(this.baseURL + "/Gy_MaterType/Gy_MaterTypeTreeListByLevel",{
- params: {
- HOrgID: '100038'
- }
+ .get(this.baseURL + "/Gy_MaterType/Gy_MaterTypeTreeListByLevel", {
+ params: {
+ HOrgID: this.queryParams.HOrgID,
+ },
})
.then((response) => {
if (response.data.count == 1) {
@@ -758,14 +693,13 @@
this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
});
},
-
getProjectOptions() {
axios
.get(this.baseURL + "/Gy_Material/Get_HProject", {
params: {
- HOrgID: this.queryParams.HOrgID
- }
+ HOrgID: this.queryParams.HOrgID,
+ },
})
.then((response) => {
if (response.data.count == 1) {
@@ -776,12 +710,13 @@
this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
});
},
-
-
+
getList() {
this.tableShow = false;
this.loading = true;
-
+
+ let orgName = this.organizationOptions.find((e) => e.ID == this.queryParams.HOrgID)
+ ?.Name;
axios
.get(this.baseURL + "/Gy_Material/page", {
params: {
@@ -789,7 +724,7 @@
user: this.user,
page: this.page,
size: this.pageSize,
- Organization: ''
+ Organization: orgName || "",
},
})
.then((response) => {
@@ -809,29 +744,27 @@
this.loading = false;
});
},
-
setDefaultColumns() {
this.btList = [
- { type: 'checkbox', fixed: 'left' },
- { field: 'hmainid', title: '鍗曟嵁ID', hide: true },
- { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', align: 'center', width: 120 },
- { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', align: 'center', width: 120 },
- { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', align: 'center', width: 120 },
- { field: '鐗╂枡灞炴��', title: '鐗╂枡灞炴��', align: 'center', width: 100 },
- { field: '缁勭粐鍚嶇О', title: '缁勭粐鍚嶇О', align: 'center', width: 120 },
- { field: '椤圭洰鍙�', title: '椤圭洰鍙�', align: 'center', width: 100 },
- { field: '绂佺敤鏍囪', title: '绂佺敤鏍囪', align: 'center', width: 100 },
- { field: '瀹℃牳浜�', title: '瀹℃牳浜�', align: 'center', width: 100 },
- { field: '鍒涘缓浜�', title: '鍒涘缓浜�', align: 'center', width: 100 },
- { field: '鍒涘缓鏃堕棿', title: '鍒涘缓鏃堕棿', align: 'center', width: 150 }
+ { type: "checkbox", fixed: "left" },
+ { field: "hmainid", title: "鍗曟嵁ID", hide: true },
+ { field: "鐗╂枡浠g爜", title: "鐗╂枡浠g爜", align: "center", width: 120 },
+ { field: "鐗╂枡鍚嶇О", title: "鐗╂枡鍚嶇О", align: "center", width: 120 },
+ { field: "瑙勬牸鍨嬪彿", title: "瑙勬牸鍨嬪彿", align: "center", width: 120 },
+ { field: "鐗╂枡灞炴��", title: "鐗╂枡灞炴��", align: "center", width: 100 },
+ { field: "缁勭粐鍚嶇О", title: "缁勭粐鍚嶇О", align: "center", width: 120 },
+ { field: "椤圭洰鍙�", title: "椤圭洰鍙�", align: "center", width: 100 },
+ { field: "绂佺敤鏍囪", title: "绂佺敤鏍囪", align: "center", width: 100 },
+ { field: "瀹℃牳浜�", title: "瀹℃牳浜�", align: "center", width: 100 },
+ { field: "鍒涘缓浜�", title: "鍒涘缓浜�", align: "center", width: 100 },
+ { field: "鍒涘缓鏃堕棿", title: "鍒涘缓鏃堕棿", align: "center", width: 150 },
];
},
-
-
+
handleTreeNodeClick(data) {
this.currentMaterTypeID = data.id;
-
+
if (data.id == "100") {
this.sWhere = " and HMaterTypeID= 0";
} else if (data.id == "0") {
@@ -839,16 +772,13 @@
} else {
this.sWhere = " and HMaterTypeID='" + data.id + "' ";
}
- this.getList();
+ this.handleQuery();
},
-
async handleQuery() {
this.sWhere = "";
-
this.processFilterConditions();
-
if (this.queryParams.HNumber) {
this.sWhere += " and 鐗╂枡浠g爜 like '%" + this.queryParams.HNumber + "%'";
@@ -865,16 +795,33 @@
this.getList();
},
-
+
processFilterConditions() {
const conditions = [
- { colName: this.queryParams.ColName, comparator: this.queryParams.Comparator, content: this.queryParams.ColContent },
- { colName: this.queryParams.ColName1, comparator: this.queryParams.Comparator1, content: this.queryParams.ColContent1 },
- { colName: this.queryParams.ColName2, comparator: this.queryParams.Comparator2, content: this.queryParams.ColContent2 }
+ {
+ colName: this.queryParams.ColName,
+ comparator: this.queryParams.Comparator,
+ content: this.queryParams.ColContent,
+ },
+ {
+ colName: this.queryParams.ColName1,
+ comparator: this.queryParams.Comparator1,
+ content: this.queryParams.ColContent1,
+ },
+ {
+ colName: this.queryParams.ColName2,
+ comparator: this.queryParams.Comparator2,
+ content: this.queryParams.ColContent2,
+ },
];
- conditions.forEach(condition => {
- if (condition.colName && condition.colName !== "0" && condition.comparator && condition.comparator !== "0") {
+ conditions.forEach((condition) => {
+ if (
+ condition.colName &&
+ condition.colName !== "0" &&
+ condition.comparator &&
+ condition.comparator !== "0"
+ ) {
let com = "";
switch (condition.comparator) {
case "7":
@@ -897,7 +844,6 @@
}
});
},
-
resetQuery() {
this.sWhere = "";
@@ -906,7 +852,7 @@
HName: null,
HNumber2: null,
HModel: null,
- HOrgID: this.organizationOptions.length > 0 ? this.organizationOptions[0].ID : null,
+ HOrgID: sessionStorage["OrganizationID"],
HProject: null,
ColName: "0",
ColName1: "0",
@@ -918,27 +864,26 @@
ColContent1: "",
ColContent2: "",
};
- this.getList();
+ this.handleQuery();
},
-
handleResCnz() {
if (!this.queryParams.HNumber2) {
this.$modal.msgWarning("璇疯緭鍏ョ墿鏂欎唬鐮�");
return;
}
-
+
axios
.get(this.baseURL + "/Gy_Material/Gy_MaterialViewApi", {
params: {
Number: this.queryParams.HNumber2,
- Type: 'WL'
- }
+ Type: "WL",
+ },
})
.then((response) => {
if (response.data.count == 1) {
this.$modal.msgSuccess(response.data.Message);
- this.getList();
+ this.handleQuery();
} else {
this.$modal.msgError(response.data.Message);
}
@@ -947,22 +892,21 @@
this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
});
},
-
-
+
handleImport() {
this.uploadData = [];
this.upload.isUploading = false;
this.upload.title = "瀵煎叆";
this.upload.open = true;
},
-
+
handleExport() {
axios
.get(this.baseURL + "/LMES/getReportByModRightNameCheck", {
params: {
ModRightNameCheck: "Gy_Material_ExportExcel",
- user: this.user
- }
+ user: this.user,
+ },
})
.then((response) => {
if (response.data.count == 1) {
@@ -978,58 +922,61 @@
this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
});
},
-
+
handleNumAdd() {
- if ((this.currentMaterTypeID == 0 || this.currentMaterTypeID == null) && !this.judgeSkipTouchMaterType()) {
- this.$modal.msgWarning("璇烽�夋嫨鍏蜂綋鐗╂枡鍒嗙被锛�");
- return;
- }
- this.OperationType = 4;
- this.currentEditId = 0;
- this.editTitle = "娴佹按鍙锋柊澧炵墿鏂�";
- this.openEdit = true;
- this.editShow = true;
- },
-
- handleAdd() {
- this.OperationType = 1;
- this.currentEditId = 0;
- this.editTitle = "鏂板鐗╂枡";
- this.openEdit = true;
- this.editShow = true;
+ if (
+ (this.currentMaterTypeID == 0 || this.currentMaterTypeID == null) &&
+ !this.judgeSkipTouchMaterType()
+ ) {
+ this.$modal.msgWarning("璇烽�夋嫨鍏蜂綋鐗╂枡鍒嗙被锛�");
+ return;
+ }
+ this.OperationType = 4;
+ this.currentEditId = 0;
+ this.editTitle = "娴佹按鍙锋柊澧炵墿鏂�";
+ this.openEdit = true;
+ this.editShow = true;
},
-
+
+ handleAdd() {
+ this.OperationType = 1;
+ this.currentEditId = 0;
+ this.editTitle = "鏂板鐗╂枡";
+ this.openEdit = true;
+ this.editShow = true;
+ },
+
handleCopy() {
- if (this.single) {
- this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
- return;
- }
- this.OperationType = 2;
- this.currentEditId = this.selectedRow.HItemID;
- this.editTitle = "澶嶅埗鐗╂枡";
- this.openEdit = true;
- this.editShow = true;
- },
-
+ if (this.single) {
+ this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
+ return;
+ }
+ this.OperationType = 2;
+ this.currentEditId = this.selectedRow.HItemID;
+ this.editTitle = "澶嶅埗鐗╂枡";
+ this.openEdit = true;
+ this.editShow = true;
+ },
+
handleEdit() {
- if (this.single) {
- this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
- return;
- }
- this.OperationType = 3;
- this.currentEditId = this.selectedRow.HItemID;
- this.editTitle = "缂栬緫鐗╂枡";
- this.openEdit = true;
- this.editShow = true;
- },
-
+ if (this.single) {
+ this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
+ return;
+ }
+ this.OperationType = 3;
+ this.currentEditId = this.selectedRow.HItemID;
+ this.editTitle = "缂栬緫鐗╂枡";
+ this.openEdit = true;
+ this.editShow = true;
+ },
+
handleDelete() {
if (this.single) {
this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
return;
}
- if (this.selectedRow.瀹℃牳浜� !== null && this.selectedRow.瀹℃牳浜� !== '') {
+ if (this.selectedRow.瀹℃牳浜� !== null && this.selectedRow.瀹℃牳浜� !== "") {
this.$modal.msgError("宸茶瀹℃牳鐨勭墿鏂欎笉鑳借鍒犻櫎!");
return;
}
@@ -1041,15 +988,17 @@
.get(this.baseURL + "/Gy_Material/Delete", {
params: {
HItemID: this.selectedRow.HItemID,
- user: this.user
- }
+ user: this.user,
+ },
})
.then((response) => {
if (response.data.count == 1) {
- this.getList();
+ this.handleQuery();
this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
} else {
- this.$modal.msgError("閿欒:" + response.data.code + response.data.Message);
+ this.$modal.msgError(
+ "閿欒:" + response.data.code + response.data.Message
+ );
}
})
.catch((error) => {
@@ -1058,7 +1007,7 @@
})
.catch(() => {});
},
-
+
handleAudit(isAudit) {
if (this.single) {
this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
@@ -1070,12 +1019,12 @@
params: {
HInterID: this.selectedRow.HItemID,
IsAudit: isAudit,
- CurUserName: this.user
- }
+ CurUserName: this.user,
+ },
})
.then((response) => {
if (response.data.count == 1) {
- this.getList();
+ this.handleQuery();
this.$modal.msgSuccess(response.data.Message);
} else {
this.$modal.msgError(response.data.Message);
@@ -1085,7 +1034,7 @@
this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
});
},
-
+
handleStop(isStop) {
if (this.single) {
this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
@@ -1096,12 +1045,12 @@
params: {
HInterID: this.selectedRow.HItemID,
IsStop: isStop,
- CurUserName: this.user
- }
+ CurUserName: this.user,
+ },
})
.then((response) => {
if (response.data.count == 1) {
- this.getList();
+ this.handleQuery();
this.$modal.msgSuccess(response.data.Message);
} else {
this.$modal.msgError(response.data.Message);
@@ -1111,24 +1060,24 @@
this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
});
},
-
+
handleColumnSetting() {
this.columnSettingShow = true;
this.openColumnSetting = true;
},
-
+
handleButtonSetting() {
this.$modal.msgInfo("鎸夐挳璁剧疆鍔熻兘");
},
-
+
handleSaveScheme() {
this.$modal.msgInfo("淇濆瓨鏂规鍔熻兘");
},
-
+
handleReadScheme() {
this.$modal.msgInfo("璇诲彇鏂规鍔熻兘");
},
-
+
handleRefresh() {
// 鍒锋柊鏃舵竻闄よ〃鏍奸�夋嫨骞堕噸缃浉鍏崇姸鎬侊紝淇濊瘉澶嶅埗/缂栬緫/鍒犻櫎/瀹℃牳绛夋寜閽绂佺敤
if (this.$refs.tableData && this.$refs.tableData.clearSelection) {
@@ -1138,35 +1087,34 @@
this.ids = [];
this.single = true;
this.multiple = true;
- this.getList();
+ this.handleQuery();
},
-
+
handleExit() {
this.$router.go(-1);
},
-
+
handleCorrect() {
this.openCorrect = true;
},
-
+
handleCorrect2() {
this.openCorrect2 = true;
},
-
+
// 鐗╂枡浠g爜鐐瑰嚮
handleMaterialCodeClick(row) {
- this.selectedRow = row;
- this.OperationType = 3;
- this.currentEditId = row.HItemID;
- this.editTitle = "缂栬緫鐗╂枡";
- this.openEdit = true;
- this.editShow = true;
- },
-
+ this.selectedRow = row;
+ this.OperationType = 3;
+ this.currentEditId = row.HItemID;
+ this.editTitle = "缂栬緫鐗╂枡";
+ this.openEdit = true;
+ this.editShow = true;
+ },
handleRowClick(row, column, event) {
- if(this.openPage){
- this.$emit('deptEmit', row, 3)
+ if (this.openPage) {
+ this.$emit("deptEmit", row, 3);
}
if (this.checkIsIframe()) {
// 灏嗗綋鍓嶉�変腑鐨勬暟鎹毚闇插埌window涓�
@@ -1176,39 +1124,38 @@
this.selectedRow = row;
this.getFileList(row.鐗╂枡浠g爜);
},
-
getFileList(HMaterNumber) {
if (!HMaterNumber) return;
-
+
axios
.get(this.baseURL + "/Cj_StationOutBill/Filelist", {
- params: { HBillNo: HMaterNumber }
+ params: { HBillNo: HMaterNumber },
})
.then((response) => {
if (response.data.count == 1) {
this.fileList = [];
const data = response.data.data;
-
+
if (data.length === 0) {
this.fileList.push({
- type: 'empty',
- url: '',
- name: '鏆傛棤鏂囦欢'
+ type: "empty",
+ url: "",
+ name: "鏆傛棤鏂囦欢",
});
} else {
- data.forEach(item => {
- if (item.HFileType === '.jpeg' || item.HFileType === '.jpg') {
+ data.forEach((item) => {
+ if (item.HFileType === ".jpeg" || item.HFileType === ".jpg") {
this.fileList.push({
- type: 'image',
+ type: "image",
url: `../../..${item.HFilePath}`,
- name: item.HFileName
+ name: item.HFileName,
});
- } else if (item.HFileType === '.pdf') {
+ } else if (item.HFileType === ".pdf") {
this.fileList.push({
- type: 'pdf',
+ type: "pdf",
url: `../../..${item.HFilePath}`,
- name: item.HFileName
+ name: item.HFileName,
});
}
});
@@ -1219,30 +1166,30 @@
this.$modal.msgError("鑾峰彇鏂囦欢鍒楄〃澶辫触!");
});
},
-
+
// 鍥剧墖棰勮
previewImg(url) {
this.previewImage = url;
this.previewVisible = true;
},
-
+
handlePreviewClose() {
this.previewVisible = false;
- this.previewImage = '';
+ this.previewImage = "";
},
-
+
// 琛屾牱寮�
rowStyle({ row, rowIndex }) {
if (this.ids.includes(row.hmainid)) {
- return { };
+ return {};
// background: "#ecf5ff"
}
},
-
+
// 鍙屽嚮琛�
handleDblclick(row, column, cell, event) {
- if(this.openPage){
- this.$emit('deptEmitDb', row, 3)
+ if (this.openPage) {
+ this.$emit("deptEmitDb", row, 3);
}
if (this.checkIsIframe()) {
// IFrame 鍙屽嚮 杩斿洖褰撳墠鍙屽嚮鐨勬暟鎹�
@@ -1263,41 +1210,41 @@
// this.$emit('deptEmit', this.selectedRow, 3)
// }
},
- // 缂栬緫鍏抽棴鍥炶皟
- handleEditClose() {
- this.openEdit = false;
- this.editShow = false;
- this.getList();
- },
+ // 缂栬緫鍏抽棴鍥炶皟
+ handleEditClose() {
+ this.openEdit = false;
+ this.editShow = false;
+ this.handleQuery();
+ },
// 鍏抽棴缂栬緫
closeEdit() {
this.openEdit = false;
this.editShow = false;
},
-
+
// 鍏抽棴鎵规敼
closeCorrect() {
this.openCorrect = false;
},
-
+
// 鍏抽棴鎵规敼鏂规2
closeCorrect2() {
this.openCorrect2 = false;
},
-
+
// 鍒楄缃叧闂�
columnSettingClose(val) {
this.columnSettingShow = false;
this.openColumnSetting = val;
- this.getList();
+ this.handleQuery();
},
-
+
// 瀵煎叆鐩稿叧鏂规硶
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
this.uploadTableLoading = true;
},
-
+
handleFileSuccess(response, file, fileList) {
this.upload.isUploading = true;
this.$refs.upload.clearFiles();
@@ -1314,13 +1261,13 @@
);
}
},
-
+
handleImportSubmit() {
if (this.uploadData.length === 0) {
this.$modal.msgWarning("璇峰厛涓婁紶鏂囦欢");
return;
}
-
+
var sMainSub = JSON.stringify(this.uploadData) + "&鍜�" + this.user;
axios({
method: "post",
@@ -1338,33 +1285,36 @@
{ dangerouslyUseHTMLString: true }
);
this.upload.open = false;
- this.getList();
+ this.handleQuery();
})
.catch((error) => {
this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
});
},
-
+
uploadDataDelete(index) {
this.uploadData.splice(index, 1);
},
-
+
formatDate(dateString) {
- if (!dateString) return '';
+ if (!dateString) return "";
const date = new Date(dateString);
- return date.toLocaleString('zh-CN');
+ return date.toLocaleString("zh-CN");
},
-
+
judgeSkipTouchMaterType() {
- if (this.treeData.length > 0 && this.treeData[0].children &&
- this.treeData[0].children.length == 1 &&
- this.treeData[0].children[0].children.length == 0) {
+ if (
+ this.treeData.length > 0 &&
+ this.treeData[0].children &&
+ this.treeData[0].children.length == 1 &&
+ this.treeData[0].children[0].children.length == 0
+ ) {
return true;
} else {
return false;
}
},
-
+
getDefaultFilterScheme() {
this.currentFilterScheme = "褰撳墠杩囨护鏂规锛氶粯璁ゆ柟妗�";
},
@@ -1386,7 +1336,8 @@
.searchImg {
height: 60px;
- background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 24 24"><path fill="%23a0a0a0" d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>') no-repeat center;
+ background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 24 24"><path fill="%23a0a0a0" d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>')
+ no-repeat center;
margin-top: 10px;
}
@@ -1427,4 +1378,4 @@
.filter-collapse {
margin-top: 10px;
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.1