From 9215950c3ce4e8b13f7218f12bf0c295bc3b215f Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期二, 11 十一月 2025 15:00:18 +0800
Subject: [PATCH] 客户列表,物料列表
---
src/permission.js | 2
src/views/component/CurrencyDialog/index.vue | 568 ++++
src/store/modules/permission.js | 28
src/views/gyMaterial/GyMaterialCorrection.vue | 913 ++++++
src/views/component/AreaDialog/index.vue | 492 +++
src/router/index.js | 49
src/views/component/SettleStyleDialog/index.vue | 609 ++++
.env.development | 2
src/views/GyCustomer/index.vue | 1261 +++++++++
src/views/gyMaterial/GyMaterial.vue | 1506 ++++++++++
src/views/component/CustomerTypeDialog/index.vue | 794 +++++
src/views/GyCustomer/CustomerEdit/index.vue | 909 ++++++
src/views/gyMaterial/edit/index.vue | 1179 ++++++++
13 files changed, 8,309 insertions(+), 3 deletions(-)
diff --git a/.env.development b/.env.development
index e3a8c4e..57290de 100644
--- a/.env.development
+++ b/.env.development
@@ -5,7 +5,7 @@
ENV = 'development'
# 鏅轰簯杩堟�滾-MOM绠$悊绯荤粺/寮�鍙戠幆澧�
-VUE_APP_BASE_API = 'http://47.96.97.237/API/'
+VUE_APP_BASE_API = 'http://localhost:8082/LuBaoAPI/'
# 璺敱鎳掑姞杞�
VUE_CLI_BABEL_TRANSPILE_MODULES = true
diff --git a/src/permission.js b/src/permission.js
index e5d5ec6..b3ae6fd 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -10,7 +10,7 @@
NProgress.configure({ showSpinner: false })
const whiteList = [ '/login', '/register', '/printList',
- '/hBarPlanPrint', '/gySource', '/gyWarehouse', '/gyStockPlace', '/gyEmployee']
+ '/hBarPlanPrint', '/gySource', '/gyWarehouse', '/gyStockPlace', '/gyEmployee','/GyCustomer','gyMaterial' ] // no redirect whitelist
const isWhiteList = (path) => {
return whiteList.some(pattern => isPathMatch(pattern, path))
diff --git a/src/router/index.js b/src/router/index.js
index 201d4f4..b4e727f 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -197,6 +197,55 @@
component: () => import("@/views/gyEmployee/index"),
hidden: true,
},
+ // 瀹㈡埛
+ {
+ path: "/GyCustomer",
+ component: () => import("@/views/GyCustomer/index"),
+ hidden: false,
+ },
+ {
+ path: "/basic/gy/gyCustomer",
+ component: Layout,
+ hidden: true,
+ redirect: "noredirect",
+ meta: {
+ breadcrumb: false, // 濡傛灉璁剧疆涓篺alse锛屽垯涓嶄細鍦╞readcrumb闈㈠寘灞戜腑鏄剧ず
+ activeMenu: "/basic/gy/gyCustomer", // 褰撹矾鐢辫缃簡璇ュ睘鎬э紝鍒欎細楂樹寒鐩稿搴旂殑渚ц竟鏍忋��
+ },
+ children: [
+ {
+ path: "/basic/gy/gyCustomer",
+ component: () => import("@/views/GyCustomer/index"),
+ name: "GyCustomer",
+ meta: { title: "瀹㈡埛鍒楄〃", activeMenu: "basic/gy" },
+ },
+ ],
+ },
+// 鐗╂枡
+ {
+ path: "/gyMaterial",
+ component: () => import("@/views/gyMaterial/GyMaterial"),
+ hidden: false,
+ },
+ {
+ path: "/basic/gy/gyMaterial",
+ component: Layout,
+ hidden: true,
+ redirect: "noredirect",
+ meta: {
+ breadcrumb: false, // 濡傛灉璁剧疆涓篺alse锛屽垯涓嶄細鍦╞readcrumb闈㈠寘灞戜腑鏄剧ず
+ activeMenu: "/basic/gy/gyMaterial", // 褰撹矾鐢辫缃簡璇ュ睘鎬э紝鍒欎細楂樹寒鐩稿搴旂殑渚ц竟鏍忋��
+ },
+ children: [
+ {
+ path: "/basic/gy/gyMaterial",
+ component: () => import("@/views/gyMaterial/GyMaterial"),
+ name: "gyMaterial",
+ meta: { title: "鐗╂枡鍒楄〃", activeMenu: "basic/gy" },
+ },
+ ],
+ },
+
];
// 鍔ㄦ�佽矾鐢憋紝鍩轰簬鐢ㄦ埛鏉冮檺鍔ㄦ�佸幓鍔犺浇
diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js
index e72b66a..75c24d9 100644
--- a/src/store/modules/permission.js
+++ b/src/store/modules/permission.js
@@ -89,7 +89,8 @@
],
},
],
- },{
+ },
+ {
alwaysShow: true,
component: "Layout",
meta: {
@@ -141,10 +142,35 @@
name: "GyWarehouse",
path: "gyWarehouse",
},
+ {
+ meta: {
+ icon: "build",
+ link: null,
+ noCache: false,
+ title: "瀹㈡埛鍒楄〃",
+ },
+ component: () => import('@/views/GyCustomer/index.vue'),
+ hidden: false,
+ name: "GyCustomer",
+ path: "gyCustomer",
+ },
+ {
+ meta: {
+ icon: "build",
+ link: null,
+ noCache: false,
+ title: "鐗╂枡鍒楄〃",
+ },
+ component: () => import('@/views/gyMaterial/GyMaterial.vue'),
+ hidden: false,
+ name: "gyMaterial",
+ path: "gyMaterial",
+ },
],
},
],
},
+
];
const sdata = JSON.parse(JSON.stringify(data));
const rdata = JSON.parse(JSON.stringify(data));
diff --git a/src/views/GyCustomer/CustomerEdit/index.vue b/src/views/GyCustomer/CustomerEdit/index.vue
new file mode 100644
index 0000000..85de386
--- /dev/null
+++ b/src/views/GyCustomer/CustomerEdit/index.vue
@@ -0,0 +1,909 @@
+<template>
+ <div class="customer-edit">
+ <el-dialog
+ :title="dialogTitle"
+ :visible.sync="openEdit"
+ width="1480px"
+ append-to-body
+ class="customerBox"
+ :before-close="handleClose"
+ :close-on-click-modal="false"
+ >
+ <div class="dialog-content">
+ <el-card style="margin-bottom: 10px;">
+ <div class="card-header">
+ <el-button-group>
+ <el-button type="primary" @click="handleSave" :disabled="saveDisabled">淇濆瓨</el-button>
+ <el-button type="primary" @click="handleAudit" :disabled="auditDisabled">瀹℃牳</el-button>
+ <el-button type="primary" @click="handleExit">閫�鍑�</el-button>
+ </el-button-group>
+ </div>
+ </el-card>
+
+ <el-card>
+ <div class="card-body">
+ <h1 style="text-align:center;margin-bottom:20px;"><b>瀹㈡埛璧勬枡</b></h1>
+
+ <el-tabs v-model="activeTab" type="card">
+ <!-- 鍩烘湰淇℃伅閫夐」鍗� -->
+ <el-tab-pane label="鍩烘湰淇℃伅" name="basic">
+ <el-form ref="form" :model="formData" label-width="100px" :rules="rules">
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="瀹㈡埛浠g爜" prop="HNumber">
+ <el-input
+ v-model="formData.HNumber"
+ placeholder="璇疯緭鍏ュ鎴蜂唬鐮�"
+ :readonly="operationType === 3"
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="瀹㈡埛鍚嶇О" prop="HName">
+ <el-input v-model="formData.HName" placeholder="璇疯緭鍏ュ鎴峰悕绉�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="鍔╄鐮�">
+ <el-input v-model="formData.HHelpCode" placeholder="璇疯緭鍏ュ姪璁扮爜"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="绠�绉�">
+ <el-input v-model="formData.HShortName" placeholder="璇疯緭鍏ョ畝绉�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="绂佺敤鏍囧織">
+ <el-checkbox v-model="formData.HStopflag"></el-checkbox>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="澶囨敞">
+ <el-input v-model="formData.HRemark" placeholder="璇疯緭鍏ュ娉�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="棰嗙敤浜�">
+ <el-input v-model="formData.HMateOutEmp" placeholder="璇疯緭鍏ラ鐢ㄤ汉"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍒涘缓缁勭粐" prop="HCreateOrgID">
+ <el-select
+ v-model="formData.HCreateOrgID"
+ placeholder="璇烽�夋嫨鍒涘缓缁勭粐"
+ :disabled="operationType !== 1"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="org in organizationList"
+ :key="org.ID"
+ :label="org.Name"
+ :value="org.ID"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="浣跨敤缁勭粐" prop="HUSEORGID">
+ <el-select
+ v-model="formData.HUSEORGID"
+ placeholder="璇烽�夋嫨浣跨敤缁勭粐"
+ :disabled="operationType !== 1"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="org in organizationList"
+ :key="org.ID"
+ :label="org.Name"
+ :value="org.ID"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ </el-tab-pane>
+
+ <!-- 鍏朵粬淇℃伅閫夐」鍗� -->
+ <el-tab-pane label="鍏朵粬淇℃伅" name="other">
+ <el-form ref="formOther" :model="formData" label-width="100px">
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="鑱旂郴浜�">
+ <el-input v-model="formData.HLinkMan" placeholder="璇疯緭鍏ヨ仈绯讳汉"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鑱旂郴鐢佃瘽">
+ <el-input v-model="formData.HLinkPhone" placeholder="璇疯緭鍏ヨ仈绯荤數璇�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="鎵嬫満">
+ <el-input v-model="formData.HMobilePhone" placeholder="璇疯緭鍏ユ墜鏈�"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="浼犵湡">
+ <el-input v-model="formData.HFax" placeholder="璇疯緭鍏ヤ紶鐪�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="鍦板潃">
+ <el-input v-model="formData.HAddress" placeholder="璇疯緭鍏ュ湴鍧�"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="閭紪">
+ <el-input v-model="formData.HPostalCode" placeholder="璇疯緭鍏ラ偖缂�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="鐢靛瓙閭">
+ <el-input v-model="formData.HEmail" placeholder="璇疯緭鍏ョ數瀛愰偖绠�"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="娉曚汉浠h〃">
+ <el-input v-model="formData.HCorMan" placeholder="璇疯緭鍏ユ硶浜轰唬琛�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="寮�鎴烽摱琛�">
+ <el-input v-model="formData.HBank" placeholder="璇疯緭鍏ュ紑鎴烽摱琛�"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="閾惰璐﹀彿">
+ <el-input v-model="formData.HBankAccount" placeholder="璇疯緭鍏ラ摱琛岃处鍙�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="绋庡姟鐧昏鍙�">
+ <el-input v-model="formData.HTaxNum" placeholder="璇疯緭鍏ョ◣鍔$櫥璁板彿"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="澧炲�肩◣鐜�">
+ <el-input v-model="formData.HTaxRate" placeholder="璇疯緭鍏ュ鍊肩◣鐜�" value="0">
+ <template slot="append">%</template>
+ </el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="鑻辨枃鍚嶇О">
+ <el-input v-model="formData.HEnglishName" placeholder="璇疯緭鍏ヨ嫳鏂囧悕绉�"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鑻辨枃鍦板潃">
+ <el-input v-model="formData.HEnglishAddress" placeholder="璇疯緭鍏ヨ嫳鏂囧湴鍧�"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="鍥藉">
+ <el-input v-model="formData.HCountry" placeholder="璇疯緭鍏ュ浗瀹�"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍦板尯">
+ <el-input
+ v-model="formData.HAreaName"
+ placeholder="璇烽�夋嫨鍦板尯"
+ readonly
+ style="width: calc(100% - 50px)"
+ >
+ </el-input>
+ <el-button
+ type="primary"
+ icon="el-icon-search"
+ style="margin-left: 10px;"
+ @click="openAreaDialog"
+ ></el-button>
+ <el-input type="hidden" v-model="formData.HAreaID"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="榛樿璐у竵">
+ <el-input
+ v-model="formData.HCurName"
+ placeholder="璇烽�夋嫨榛樿璐у竵"
+ readonly
+ style="width: calc(100% - 50px)"
+ >
+ </el-input>
+ <el-button
+ type="primary"
+ icon="el-icon-search"
+ style="margin-left: 10px;"
+ @click="openCurrencyDialog"
+ ></el-button>
+ <el-input type="hidden" v-model="formData.HCurID"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="缁撶畻鏂瑰紡">
+ <el-input
+ v-model="formData.HSSName"
+ placeholder="璇烽�夋嫨缁撶畻鏂瑰紡"
+ readonly
+ style="width: calc(100% - 50px)"
+ >
+ </el-input>
+ <el-button
+ type="primary"
+ icon="el-icon-search"
+ style="margin-left: 10px;"
+ @click="openSettleStyleDialog"
+ ></el-button>
+ <el-input type="hidden" v-model="formData.HSSID"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="瀹㈡埛鐘舵��">
+ <el-select v-model="formData.HCusStatus" placeholder="璇烽�夋嫨瀹㈡埛鐘舵��" style="width: 100%">
+ <el-option label="娼滃湪" value="101"></el-option>
+ <el-option label="鍚堟牸" value="102"></el-option>
+ <el-option label="鏆傛椂" value="103"></el-option>
+ <el-option label="棰勮" value="104"></el-option>
+ <el-option label="榛戝悕鍗�" value="105"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="瀹㈡埛鍒嗙被">
+ <el-input
+ v-model="formData.HCusTypeName"
+ placeholder="璇烽�夋嫨瀹㈡埛鍒嗙被"
+ readonly
+ style="width: calc(100% - 50px)"
+ >
+ </el-input>
+ <el-button
+ type="primary"
+ icon="el-icon-search"
+ style="margin-left: 10px;"
+ @click="openCustomerTypeDialog"
+ ></el-button>
+ <el-input type="hidden" v-model="formData.HCusTypeID"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ </el-tab-pane>
+
+ <!-- 绯荤粺淇℃伅閫夐」鍗� -->
+ <el-tab-pane label="绯荤粺淇℃伅" name="system">
+ <el-form :model="formData" label-width="100px">
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="鍒涘缓浜�">
+ <el-input v-model="formData.HCreator" readonly></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鍒涘缓鏃ユ湡">
+ <el-input v-model="formData.HCreateDate" readonly></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="淇敼浜�">
+ <el-input v-model="formData.HUpDater" readonly></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="淇敼鏃ユ湡">
+ <el-input v-model="formData.HUpDateDate" readonly></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="瀹℃牳浜�">
+ <el-input v-model="formData.HChecker" readonly></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="瀹℃牳鏃ユ湡">
+ <el-input v-model="formData.HCheckDate" readonly></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="浣滃簾浜�">
+ <el-input v-model="formData.HDeleteMan" readonly></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="浣滃簾鏃ユ湡">
+ <el-input v-model="formData.HDeleteDate" readonly></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </el-form>
+ </el-tab-pane>
+ </el-tabs>
+ </div>
+ </el-card>
+ </div>
+
+
+ <!-- 鍦板尯瀵硅瘽妗� -->
+ <AreaDialog
+ :visible.sync="areaDialogVisible"
+ @selected="handleAreaSelected"
+ />
+
+
+ <!-- 璐у竵瀵硅瘽妗� -->
+ <CurrencyDialog
+ :visible.sync="currencyDialogVisible"
+ @selected="handleCurrencySelected"
+ />
+
+ <!-- 缁撶畻鏂瑰紡瀵硅瘽妗� -->
+ <SettleStyleDialog
+ :visible.sync="settleStyleDialogVisible"
+ @selected="handleSettleStyleSelected"
+ />
+
+ <!-- 瀹㈡埛鍒嗙被瀵硅瘽妗� -->
+ <CustomerTypeDialog
+ :visible.sync="customerTypeDialogVisible"
+ @selected="handleCustomerTypeSelected"
+ />
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import axios from 'axios'
+import AreaDialog from "@/views/component/AreaDialog"
+import CurrencyDialog from "@/views/component/CurrencyDialog"
+import SettleStyleDialog from '@/views/component/SettleStyleDialog'
+import CustomerTypeDialog from '@/views/component/CustomerTypeDialog'
+
+export default {
+ name: 'CustomerEdit',
+ components: {
+ AreaDialog,
+ CurrencyDialog,
+ SettleStyleDialog,
+ CustomerTypeDialog
+ },
+ props: {
+ OperationType: { // 1:鏂板 2:娴佹按鍙锋柊澧� 3:缂栬緫 6:澶嶅埗
+ type: Number,
+ default: 1
+ },
+ linterid: {
+ type: [String, Number],
+ default: ''
+ },
+ HSouceBillType: {
+ type: String,
+ default: ''
+ },
+ HCusTypeID: {
+ type: [String, Number],
+ default: '0'
+ },
+ HCusClsName: {
+ type: String,
+ default: ''
+ }
+ },
+ data() {
+ return {
+ openEdit: true,
+ activeTab: 'basic',
+
+ // 琛ㄥ崟鏁版嵁
+ formData: {
+ HNumber: '',
+ HName: '',
+ HHelpCode: '',
+ HShortName: '',
+ HStopflag: false,
+ HRemark: '',
+ HMateOutEmp: '',
+ HCreateOrgID: '',
+ HUSEORGID: '',
+
+ // 鍏朵粬淇℃伅
+ HLinkMan: '',
+ HLinkPhone: '',
+ HMobilePhone: '',
+ HFax: '',
+ HAddress: '',
+ HPostalCode: '',
+ HEmail: '',
+ HCorMan: '',
+ HBank: '',
+ HBankAccount: '',
+ HTaxNum: '',
+ HTaxRate: '0',
+ HEnglishName: '',
+ HEnglishAddress: '',
+ HCountry: '',
+ HAreaName: '',
+ HAreaID: '0',
+ HCurName: '',
+ HCurID: '0',
+ HSSName: '',
+ HSSID: '0',
+ HCusStatus: '',
+ HCusTypeName: '',
+ HCusTypeID: '0',
+
+ // 绯荤粺淇℃伅
+ HCreator: '',
+ HCreateDate: '',
+ HUpDater: '',
+ HUpDateDate: '',
+ HChecker: '',
+ HCheckDate: '',
+ HDeleteMan: '',
+ HDeleteDate: ''
+ },
+
+ // 楠岃瘉瑙勫垯
+ rules: {
+ HNumber: [
+ { required: true, message: '璇疯緭鍏ュ鎴蜂唬鐮�', trigger: 'blur' }
+ ],
+ HName: [
+ { required: true, message: '璇疯緭鍏ュ鎴峰悕绉�', trigger: 'blur' }
+ ],
+ HCreateOrgID: [
+ { required: true, message: '璇烽�夋嫨鍒涘缓缁勭粐', trigger: 'change' }
+ ],
+ HUSEORGID: [
+ { required: true, message: '璇烽�夋嫨浣跨敤缁勭粐', trigger: 'change' }
+ ]
+ },
+
+ // 缁勭粐鍒楄〃
+ organizationList: [],
+
+ // 瀵硅瘽妗嗘帶鍒�
+ areaDialogVisible: false,
+ currencyDialogVisible: false,
+ settleStyleDialogVisible: false,
+ customerTypeDialogVisible: false,
+
+ // 鎸夐挳鐘舵��
+ saveDisabled: false,
+ auditDisabled: false,
+
+ baseURL: process.env.VUE_APP_BASE_URL || 'http://47.96.97.237/API/',
+ user: 'admin'
+ }
+ },
+ computed: {
+ dialogTitle() {
+ const titles = {
+ 1: '鏂板瀹㈡埛',
+ 2: '娴佹按鍙锋柊澧炲鎴�',
+ 3: '缂栬緫瀹㈡埛',
+ 6: '澶嶅埗瀹㈡埛'
+ }
+ return titles[this.OperationType] || '瀹㈡埛璧勬枡'
+ },
+ operationType() {
+ return this.OperationType
+ }
+ },
+ watch: {
+ openEdit(val) {
+ if (!val) {
+ this.$emit('editClose', false)
+ }
+ }
+ },
+ mounted() {
+ this.initData()
+ this.loadOrganizations()
+ this.handleOperationType()
+ },
+ methods: {
+ // 鍒濆鍖栨暟鎹�
+ initData() {
+ this.formData.HCreator = this.user
+ this.formData.HCreateDate = new Date().toLocaleString()
+ },
+
+ // 鍔犺浇缁勭粐鏁版嵁
+ loadOrganizations() {
+ axios.get(`${this.baseURL}/Web/GetOrganizations`)
+ .then(response => {
+ if (response.data.count === 1) {
+ this.organizationList = response.data.data
+ // 璁剧疆榛樿缁勭粐
+ const defaultOrg = this.organizationList[0]
+ if (defaultOrg) {
+ this.formData.HCreateOrgID = defaultOrg.ID
+ this.formData.HUSEORGID = defaultOrg.ID
+ }
+ }
+ })
+ .catch(error => {
+ this.$modal.msgError('鍔犺浇缁勭粐鏁版嵁澶辫触!')
+ })
+ },
+
+ // 鏍规嵁鎿嶄綔绫诲瀷澶勭悊涓嶅悓閫昏緫
+ handleOperationType() {
+ switch (this.operationType) {
+ case 1: // 鏂板
+ this.handleAddNew()
+ break
+ case 2: // 娴佹按鍙锋柊澧�
+ this.handleSerialAdd()
+ break
+ case 3: // 缂栬緫
+ this.handleEdit()
+ break
+ case 6: // 澶嶅埗
+ this.handleCopy()
+ break
+ }
+ },
+
+ // 鏂板澶勭悊
+ handleAddNew() {
+ this.auditDisabled = true
+ this.getMaxBillID()
+ },
+
+ // 娴佹按鍙锋柊澧炲鐞�
+ handleSerialAdd() {
+ this.formData.HCusTypeName = this.HCusClsName
+ this.formData.HCusTypeID = this.HCusTypeID
+ this.setHNumber(this.HCusTypeID)
+ this.auditDisabled = true
+ },
+
+ // 缂栬緫澶勭悊
+ handleEdit() {
+ this.loadEditData(this.linterid)
+ },
+
+ // 澶嶅埗澶勭悊
+ handleCopy() {
+ this.loadEditData(this.linterid)
+ this.auditDisabled = true
+ },
+
+ // 鑾峰彇鏈�澶у崟鎹甀D锛堟柊澧炴椂锛�
+ getMaxBillID() {
+ axios.get(`${this.baseURL}/Gy_Customer/GetMAXBillID`)
+ .then(response => {
+ // 鍙互鍦ㄨ繖閲屽鐞嗚繑鍥炵殑鍗曟嵁ID
+ console.log('Max Bill ID:', response.data)
+ })
+ .catch(error => {
+ console.error('鑾峰彇鏈�澶у崟鎹甀D澶辫触:', error)
+ })
+ },
+
+ // 璁剧疆娴佹按鍙�
+ setHNumber(typeID) {
+ axios.get(`${this.baseURL}/Gy_Customer/getMaxNum`, {
+ params: {
+ HCusTypeID: typeID,
+ user: this.user,
+ Organization: '100038'
+ }
+ })
+ .then(response => {
+ if (response.data.data) {
+ this.formData.HNumber = response.data.data
+ }
+ })
+ .catch(error => {
+ this.$modal.msgError('鑾峰彇娴佹按鍙峰け璐�!')
+ })
+ },
+
+ // 鍔犺浇缂栬緫鏁版嵁
+ loadEditData(interId) {
+ axios.get(`${this.baseURL}/Gy_Customer/xg_extendCheckEmp`, {
+ params: { HInterID: interId }
+ })
+ .then(response => {
+ if (response.data.data && response.data.data.length > 0) {
+ const data = response.data.data[0]
+ this.populateFormData(data)
+
+ // 濡傛灉宸插鏍革紝绂佺敤淇濆瓨鍜屽鏍告寜閽�
+ if (data.瀹℃牳浜� && data.瀹℃牳浜� !== '') {
+ this.saveDisabled = true
+ this.auditDisabled = true
+ }
+ }
+ })
+ .catch(error => {
+ this.$modal.msgError('鍔犺浇瀹㈡埛鏁版嵁澶辫触!')
+ })
+ },
+
+ // 濉厖琛ㄥ崟鏁版嵁
+ populateFormData(data) {
+ this.formData = {
+ ...this.formData,
+ HNumber: data.瀹㈡埛浠g爜 || '',
+ HName: data.瀹㈡埛鍚嶇О || '',
+ HHelpCode: data.鍔╄鐮� || '',
+ HShortName: data.绠�绉� || '',
+ HStopflag: data.绂佺敤鏍囧織 || false,
+ HRemark: data.澶囨敞 || '',
+ HMateOutEmp: data.棰嗙敤浜� || '',
+ HLinkMan: data.鑱旂郴浜� || '',
+ HLinkPhone: data.鑱旂郴鐢佃瘽 || '',
+ HMobilePhone: data.鎵嬫満 || '',
+ HFax: data.浼犵湡 || '',
+ HAddress: data.鍦板潃 || '',
+ HPostalCode: data.閭紪 || '',
+ HEmail: data.鐢靛瓙閭欢 || '',
+ HCorMan: data.娉曚汉浠h〃 || '',
+ HBank: data.寮�鎴烽摱琛� || '',
+ HBankAccount: data.閾惰璐﹀彿 || '',
+ HTaxNum: data.绋庡姟鐧昏鍙� || '',
+ HTaxRate: data.澧炲�肩◣鐜� || '0',
+ HEnglishName: data.鑻辨枃鍚嶇О || '',
+ HEnglishAddress: data.鑻辨枃鍦板潃 || '',
+ HCountry: data.鍥藉 || '',
+ HAreaName: data.鍦板尯鍚嶇О || '',
+ HAreaID: data.鍦板尯ID || '0',
+ HCurName: data.榛樿璐у竵 || '',
+ HCurID: data.榛樿璐у竵ID || '0',
+ HSSName: data.缁撶畻鏂瑰紡 || '',
+ HSSID: data.缁撶畻鏂瑰紡ID || '0',
+ HCusStatus: data.瀹㈡埛鐘舵�� || '',
+ HCusTypeName: data.瀹㈡埛鍒嗙被 || '',
+ HCusTypeID: data.瀹㈡埛鍒嗙被ID || '0',
+ HChecker: data.瀹℃牳浜� || '',
+ HCheckDate: data.瀹℃牳鏃ユ湡 || ''
+ }
+
+ this.formData.HUpDater = this.user
+ this.formData.HUpDateDate = new Date().toLocaleString()
+ },
+
+ // 淇濆瓨
+ handleSave() {
+ this.$refs.form.validate(valid => {
+ if (valid) {
+ if (!this.validateForm()) {
+ return
+ }
+
+ const formData = { ...this.formData }
+ formData.HStopflag = formData.HStopflag ? 'true' : 'false'
+
+ let url = `${this.baseURL}/Gy_Customer/AddBill`
+ let params = { oMain: JSON.stringify(formData) + ';' + this.user }
+
+ if (this.operationType === 3) {
+ // 缂栬緫淇濆瓨
+ url = `${this.baseURL}/Gy_Customer/AddBill1`
+ params = {
+ oMain: JSON.stringify(formData) + ';' + this.linterid + ';' + this.user + ';Gy_Customer_Edit'
+ }
+ }
+
+ axios.post(url, params)
+ .then(response => {
+ if (response.data.count === 1) {
+ this.$modal.msgSuccess(response.data.Message)
+ this.saveDisabled = true
+ this.saveConfig()
+ this.openEdit = false
+ this.$emit('editClose', true)
+ } else {
+ this.$modal.msgError(response.data.Message)
+ }
+ })
+ .catch(error => {
+ this.$modal.msgError('淇濆瓨澶辫触!')
+ })
+ }
+ })
+ },
+
+ // 琛ㄥ崟楠岃瘉
+ validateForm() {
+ if (!this.formData.HNumber) {
+ this.$modal.msgWarning('璇疯緭鍏ュ鎴蜂唬鐮�!')
+ return false
+ }
+
+ if (!this.formData.HName) {
+ this.$modal.msgWarning('璇疯緭鍏ュ鎴峰悕绉�!')
+ return false
+ }
+
+ // 澧炲�肩◣鐜囬獙璇�
+ const taxRate = this.formData.HTaxRate
+ // if (taxRate && taxRate.substring(taxRate.length - 1) === '.') {
+ // this.$modal.msgWarning('澧炲�肩◣鐜囩殑缁撳熬涓嶈兘鏄�.!')
+ // return false
+ // }
+
+ if (taxRate && !/^[0-9]+\.?[0-9]*$/.test(taxRate)) {
+ this.$modal.msgWarning('澧炲�肩◣鐜囪杈撳叆姝g‘鏁板瓧!')
+ return false
+ }
+
+ return true
+ },
+
+ // 瀹℃牳
+ handleAudit() {
+ axios.get(`${this.baseURL}/Gy_Customer/AuditGy_Customer`, {
+ params: {
+ HInterID: this.linterid,
+ IsAudit: 0,
+ CurUserName: this.user
+ }
+ })
+ .then(response => {
+ if (response.data.count === 1) {
+ this.$modal.msgSuccess(response.data.Message)
+ this.openEdit = false
+ this.$emit('editClose', true)
+ } else {
+ this.$modal.msgError(response.data.Message)
+ }
+ })
+ .catch(error => {
+ this.$modal.msgError('瀹℃牳澶辫触!')
+ })
+ },
+
+ // 閫�鍑�
+ handleExit() {
+ this.openEdit = false
+ this.$emit('editClose', false)
+ },
+
+ // 鍏抽棴瀵硅瘽妗�
+ handleClose(done) {
+ this.$confirm('纭鍏抽棴锛�')
+ .then(_ => {
+ done()
+ this.$emit('editClose', false)
+ })
+ .catch(_ => {})
+ },
+
+ // 淇濆瓨閰嶇疆
+ saveConfig() {
+ const config = {
+ HSSID: this.formData.HSSID,
+ HSSName: this.formData.HSSName,
+ HCurID: this.formData.HCurID,
+ HCurName: this.formData.HCurName
+ }
+ localStorage.setItem('Gy_Customer_Edit', JSON.stringify(config))
+ },
+
+ // 鎵撳紑瀵硅瘽妗嗘柟娉�
+ openAreaDialog() {
+ this.areaDialogVisible = true
+ },
+
+ openCurrencyDialog() {
+ this.currencyDialogVisible = true
+ },
+
+ openSettleStyleDialog() {
+ this.settleStyleDialogVisible = true
+ },
+
+ openCustomerTypeDialog() {
+ this.customerTypeDialogVisible = true
+ },
+
+ // 瀵硅瘽妗嗛�夋嫨鍥炶皟
+ handleAreaSelected(data) {
+ this.formData.HAreaName = data.鍦板尯鍚嶇О
+ this.formData.HAreaID = data.HItemID
+ },
+
+ handleCurrencySelected(data) {
+ this.formData.HCurName = data.璐у竵鍚嶇О
+ this.formData.HCurID = data.HItemID
+ },
+
+ handleSettleStyleSelected(data) {
+ this.formData.HSSName = data.缁撶畻鏂瑰紡鍚嶇О
+ this.formData.HSSID = data.HItemID
+ },
+
+ handleCustomerTypeSelected(data) {
+ this.formData.HCusTypeName = data.瀹㈡埛鍒嗙被鍚嶇О
+ this.formData.HCusTypeID = data.HItemID
+ }
+ }
+}
+</script>
+
+<style scoped>
+.customerBox .el-date-editor.el-input {
+ width: 100%;
+}
+
+.dialog-content {
+ padding: 0;
+}
+
+.card-header {
+ padding: 10px 0;
+ border-bottom: 1px solid #ebeef5;
+}
+
+.card-body {
+ padding: 20px;
+}
+
+.el-form-item {
+ margin-bottom: 15px;
+}
+
+.el-tabs {
+ margin-top: 10px;
+}
+
+.el-button-group {
+ margin-bottom: 10px;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/GyCustomer/index.vue b/src/views/GyCustomer/index.vue
new file mode 100644
index 0000000..e6953cb
--- /dev/null
+++ b/src/views/GyCustomer/index.vue
@@ -0,0 +1,1261 @@
+<template>
+ <div style="padding: 10px">
+ <el-drawer title="鏌ヨ" :visible.sync="searchOpen" :with-header="false" size="650px">
+ <div style="padding: 50px; width: 630px">
+ <div class="searchText">
+ <div style="font-size: 18px">QUICK SEARCH</div>
+ <div>蹇�熸悳绱�</div>
+ <div class="searchImg"></div>
+ </div>
+ <el-form :model="queryParams" ref="queryForm" label-width="98px">
+ <el-row>
+ <el-form-item label="瀹㈡埛浠g爜" prop="HNumber">
+ <el-input
+ v-model="queryParams.HNumber"
+ placeholder="璇疯緭鍏ュ鎴蜂唬鐮�"
+ @keyup.enter.native="handleQuery"
+ class="ForFilteringSchemes"
+ />
+ </el-form-item>
+ <el-form-item label="瀹㈡埛鍚嶇О" prop="HName">
+ <el-input
+ v-model="queryParams.HName"
+ placeholder="璇疯緭鍏ュ鎴峰悕绉�"
+ @keyup.enter.native="handleQuery"
+ class="ForFilteringSchemes"
+ />
+ </el-form-item>
+ <el-form-item label="閲嶆柊鍚屾">
+ <el-input
+ v-model="queryParams.HNumber2"
+ placeholder="璇疯緭鍏ュ鎴蜂唬鐮�"
+ class="ForFilteringSchemes"
+ style="width: 190px"
+ />
+ <el-button type="primary" @click="handleResCnz" style="margin-left: 10px">閲嶆柊鍚屾</el-button>
+ </el-form-item>
+ </el-row>
+ <el-card class="box-card">
+ <div slot="header" class="clearfix"><span>杩囨护</span></div>
+ <div>
+ <el-form-item label-width="0">
+ <el-row>
+ <el-col :span="7">
+ <el-select
+ v-model="queryParams.ColName"
+ placeholder="璇烽�夋嫨"
+ class="ForFilteringSchemes"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="(item, index) in visibleColumns"
+ :key="index"
+ :label="item.title"
+ :value="item.field"
+ ></el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="6" style="padding: 0 10px">
+ <el-select
+ v-model="queryParams.Comparator"
+ placeholder="璇烽�夋嫨"
+ class="ForFilteringSchemes"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="(item, index) in comparatorList"
+ :key="index"
+ :label="item.label"
+ :value="item.value"
+ ></el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="11">
+ <el-input
+ v-model="queryParams.ColContent"
+ placeholder="璇疯緭鍏�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ class="ForFilteringSchemes"
+ />
+ </el-col>
+ </el-row>
+ </el-form-item>
+ <el-form-item label-width="0">
+ <el-row>
+ <el-col :span="7">
+ <el-select
+ v-model="queryParams.ColName1"
+ placeholder="璇烽�夋嫨"
+ class="ForFilteringSchemes"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="(item, index) in visibleColumns"
+ :key="index"
+ :label="item.title"
+ :value="item.field"
+ ></el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="6" style="padding: 0 10px">
+ <el-select
+ v-model="queryParams.Comparator1"
+ placeholder="璇烽�夋嫨"
+ class="ForFilteringSchemes"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="(item, index) in comparatorList"
+ :key="index"
+ :label="item.label"
+ :value="item.value"
+ ></el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="11">
+ <el-input
+ v-model="queryParams.ColContent1"
+ placeholder="璇疯緭鍏�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ class="ForFilteringSchemes"
+ />
+ </el-col>
+ </el-row>
+ </el-form-item>
+ <el-form-item label-width="0">
+ <el-row>
+ <el-col :span="7">
+ <el-select
+ v-model="queryParams.ColName2"
+ placeholder="璇烽�夋嫨"
+ class="ForFilteringSchemes"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="(item, index) in visibleColumns"
+ :key="index"
+ :label="item.title"
+ :value="item.field"
+ ></el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="6" style="padding: 0 10px">
+ <el-select
+ v-model="queryParams.Comparator2"
+ placeholder="璇烽�夋嫨"
+ class="ForFilteringSchemes"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="(item, index) in comparatorList"
+ :key="index"
+ :label="item.label"
+ :value="item.value"
+ ></el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="11">
+ <el-input
+ v-model="queryParams.ColContent2"
+ placeholder="璇疯緭鍏�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ class="ForFilteringSchemes"
+ />
+ </el-col>
+ </el-row>
+ </el-form-item>
+ </div>
+ </el-card>
+ <div style="text-align:center;font-size:15px;font-weight:bold;color:#fc9393;margin: 20px 0;">
+ {{ currentFilterScheme }}
+ </div>
+ <el-form-item label-width="78px" style="margin-top: 20px">
+ <el-button type="primary" icon="el-icon-search" @click="handleQuery">
+ 鎼� 绱�</el-button
+ >
+ <el-button icon="el-icon-circle-close" @click="searchOpen = false"
+ >鍙� 娑�</el-button
+ >
+ </el-form-item>
+ </el-form>
+ </div>
+ </el-drawer>
+
+ <!-- 涓诲唴瀹瑰尯鍩� -->
+ <el-row :gutter="10" class="mb8">
+ <el-col :span="1.5">
+ <el-button
+ type="warning"
+ plain
+ icon="el-icon-upload2"
+ size="mini"
+ @click="handleImport"
+ >瀵煎叆</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="warning"
+ plain
+ icon="el-icon-download"
+ size="mini"
+ @click="handleExport"
+ >瀵煎嚭</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="primary"
+ plain
+ icon="el-icon-document"
+ size="mini"
+ @click="handleNumAdd"
+ >娴佹按鍙锋柊澧�</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="primary"
+ plain
+ icon="el-icon-plus"
+ size="mini"
+ @click="handleAdd"
+ >鏂板</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="success"
+ plain
+ icon="el-icon-document-copy"
+ size="mini"
+ :disabled="single"
+ @click="handleCopy"
+ >澶嶅埗</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="success"
+ plain
+ icon="el-icon-edit"
+ size="mini"
+ :disabled="single"
+ @click="handleEdit"
+ >缂栬緫</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="danger"
+ plain
+ icon="el-icon-delete"
+ size="mini"
+ :disabled="single"
+ @click="handleDelete"
+ >鍒犻櫎</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="success"
+ plain
+ icon="el-icon-check"
+ size="mini"
+ :disabled="single"
+ @click="handleAudit(0)"
+ >瀹℃牳</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="success"
+ plain
+ icon="el-icon-close"
+ size="mini"
+ :disabled="single"
+ @click="handleAudit(1)"
+ >鍙嶅鏍�</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="warning"
+ plain
+ icon="el-icon-turn-off"
+ size="mini"
+ :disabled="single"
+ @click="handleStop(0)"
+ >绂佺敤</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="warning"
+ plain
+ icon="el-icon-open"
+ size="mini"
+ :disabled="single"
+ @click="handleStop(1)"
+ >鍙嶇鐢�</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="info"
+ plain
+ icon="el-icon-setting"
+ size="mini"
+ @click="handleColumnSetting"
+ >鍒楄缃�</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="info"
+ plain
+ icon="el-icon-s-operation"
+ size="mini"
+ @click="handleButtonSetting"
+ >鎸夐挳璁剧疆</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="primary"
+ plain
+ icon="el-icon-folder-checked"
+ size="mini"
+ @click="handleSaveScheme"
+ >淇濆瓨鏂规</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="primary"
+ plain
+ icon="el-icon-folder-opened"
+ size="mini"
+ @click="handleReadScheme"
+ >璇诲彇鏂规</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="info"
+ plain
+ icon="el-icon-refresh"
+ size="mini"
+ @click="handleRefresh"
+ >鍒锋柊</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="info"
+ plain
+ icon="el-icon-close"
+ size="mini"
+ @click="handleExit"
+ >閫�鍑�</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearch"
+ >鎼� 绱�</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+ >閲� 缃�</el-button
+ >
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="10" style="margin-top: 10px">
+ <!-- 宸︿晶鏍戝舰缁撴瀯 -->
+ <el-col :span="4">
+ <el-card style="height: 600px; overflow: auto">
+ <div slot="header">
+ <span>瀹㈡埛鍒嗙被</span>
+ </div>
+ <el-tree
+ :data="treeData"
+ :props="treeProps"
+ node-key="id"
+ default-expand-all
+ :expand-on-click-node="false"
+ @node-click="handleTreeNodeClick"
+ :highlight-current="true"
+ >
+ <span class="custom-tree-node" slot-scope="{ node, data }">
+ <span>{{ node.label }}</span>
+ </span>
+ </el-tree>
+ </el-card>
+ </el-col>
+
+ <!-- 鍙充晶琛ㄦ牸 -->
+ <el-col :span="20">
+ <div class="tableBox" v-loading="loading">
+ <el-table
+ :data="tableData"
+ ref="tableData"
+ height="600"
+ @selection-change="handleSelectionChange"
+ border
+ @row-click="handleRowClick"
+ :row-style="rowStyle"
+ @cell-dblclick="handleDblclick"
+ v-if="tableShow"
+ >
+ <el-table-column type="selection" width="55" align="center" fixed="left" />
+ <el-table-column prop="hmainid" label="鍗曟嵁ID" v-if="false" />
+ <el-table-column
+ v-for="(item, index) in btList"
+ :key="index"
+ :align="item.align"
+ :prop="item.field"
+ :label="item.title"
+ :width="item.width"
+ v-if="!item.hide"
+ :sortable="item.sort"
+ show-overflow-tooltip
+ :fixed="item.fixed"
+ >
+ <template slot-scope="{ row, column }">
+ <div :style="item.style">
+ <el-button
+ type="text"
+ @click="handleCustomerCodeClick(row)"
+ v-if="column.property === '瀹㈡埛浠g爜'"
+ >{{ row[column.property] }}</el-button
+ >
+ <span v-else-if="(column.property || '').includes('鏃堕棿') || (column.property || '').includes('鏃ユ湡')">
+ {{ formatDate(row[column.property]) }}
+ </span>
+ <span v-else>{{ row[column.property] }}</span>
+ </div>
+ </template>
+ </el-table-column>
+ </el-table>
+ <pagination
+ v-show="total > 0"
+ :total="total"
+ :page.sync="page"
+ :limit.sync="pageSize"
+ :pageSizes="pageSizes"
+ @pagination="getList"
+ />
+ </div>
+ </el-col>
+ </el-row>
+
+ <!-- 鍏宠仈鐢ㄦ埛瀛愯〃 -->
+ <el-card v-if="selectedRow" style="margin-top: 20px">
+ <div slot="header">
+ <span>鍏宠仈鐢ㄦ埛</span>
+ </div>
+ <el-table
+ :data="relationUserData"
+ height="300"
+ border
+ v-loading="relationLoading"
+ >
+ <el-table-column
+ v-for="(item, index) in relationUserColumns"
+ :key="index"
+ :prop="item.field"
+ :label="item.title"
+ :width="item.width"
+ :align="item.align"
+ >
+ <template slot-scope="{ row, column }">
+ <span v-if="column.property.includes('鏃堕棿') || column.property.includes('鏃ユ湡')">
+ {{ formatDate(row[column.property]) }}
+ </span>
+ <span v-else>{{ row[column.property] }}</span>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-card>
+
+ <!-- 鍚勭寮圭獥 -->
+ <el-dialog
+ title="闅愯棌鍒楄缃�"
+ :visible.sync="openColumnSetting"
+ width="816px"
+ append-to-body
+ >
+ <RowSettings
+ :colName="btResList"
+ :HModName="HModName"
+ @rowEditClose="columnSettingClose"
+ v-if="columnSettingShow"
+ />
+ </el-dialog>
+
+ <el-dialog
+ title="缂栬緫瀹㈡埛"
+ :visible.sync="openEdit"
+ width="1480px"
+ append-to-body
+ class="customerBox"
+ :before-close="closeEdit"
+ >
+ <CustomerEdit
+ :OperationType="OperationType"
+ :linterid="selectedRow ? selectedRow.HItemID : ''"
+ :HSouceBillType="''"
+ :HCusTypeID="currentCusTypeID"
+ :HCusClsName="currentCusClsName"
+ @editClose="editClose"
+ v-if="editShow"
+ />
+ </el-dialog>
+
+ <el-dialog
+ :title="upload.title"
+ :visible.sync="upload.open"
+ width="1500px"
+ append-to-body
+ >
+ <div style="margin-top: -20px">
+ <el-button type="primary" @click="handleImportSubmit">瀵煎叆鏁版嵁</el-button>
+ <el-button type="primary" @click="upload.open = false">閫� 鍑�</el-button>
+ <el-upload
+ ref="upload"
+ :limit="1"
+ accept=".xlsx, .xls"
+ style="display: inline-block; margin-left: 10px"
+ :action="upload.url + '?updateSupport=' + upload.updateSupport"
+ :disabled="upload.isUploading"
+ :on-progress="handleFileUploadProgress"
+ :on-success="handleFileSuccess"
+ >
+ <el-button type="primary">鏂囦欢涓婁紶</el-button>
+ </el-upload>
+ </div>
+ <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" />
+ <el-table-column label="瀹㈡埛鍒嗙被" prop="瀹㈡埛鍒嗙被" align="center" width="120" />
+ <el-table-column label="鎿嶄綔" align="center">
+ <template slot-scope="scope">
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-delete"
+ @click="uploadDataDelete(scope.$index)"
+ >鍒犻櫎</el-button
+ >
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import axios from "axios";
+import RowSettings from "@/views/component/rowSettings";
+import CustomerEdit from "@/views/GyCustomer/CustomerEdit";
+
+export default {
+ name: "GyCustomer",
+ components: { RowSettings ,CustomerEdit},
+ props: {
+ openPage: { type: String },
+ },
+ data() {
+ return {
+ HModName: "Gy_Customer",
+ HModuleName: "瀹㈡埛鍒楄〃缁存姢",
+ HClassTag: "ForFilteringSchemes",
+
+ // 鏍戝舰鏁版嵁
+ treeData: [],
+ treeProps: {
+ children: 'children',
+ label: 'title'
+ },
+ currentCusTypeID: 0,
+ currentCusClsName: '',
+
+ // 缂栬緫鐩稿叧
+ editShow: false,
+ openEdit: false,
+ OperationType: null,
+
+ // 鍒楄缃�
+ columnSettingShow: false,
+ openColumnSetting: false,
+
+ // 琛ㄦ牸鏄剧ず
+ tableShow: true,
+ loading: true,
+
+ // 鎼滅储鐩稿叧
+ searchOpen: false,
+ queryParams: {
+ HNumber: null,
+ HName: null,
+ HNumber2: null,
+ ColName: "0",
+ ColName1: "0",
+ ColName2: "0",
+ Comparator: "0",
+ Comparator1: "0",
+ Comparator2: "0",
+ ColContent: "",
+ ColContent1: "",
+ ColContent2: "",
+ },
+
+ // 杩囨护鏂规
+ currentFilterScheme: "",
+ HInterID_Choose: 0,
+
+ // 姣旇緝鍣ㄥ垪琛�
+ comparatorList: [
+ { label: "=", value: "=" },
+ { label: ">=", value: ">=" },
+ { label: ">", value: ">" },
+ { label: "<=", value: "<=" },
+ { label: "<", value: "<" },
+ { label: "<>", value: "<>" },
+ { label: "鍖呭惈", value: "7" },
+ { label: "宸﹀寘鍚�", value: "8" },
+ { label: "鍙冲寘鍚�", value: "9" },
+ { label: "涓嶅寘鍚�", value: "10" },
+ ],
+
+ // 琛ㄦ牸鏁版嵁
+ sWhere: "",
+ selectedRow: null,
+ ids: [],
+ single: true,
+ multiple: true,
+ tyResList: [],
+ btList: [],
+ btResList: [],
+ tableData: [],
+ pageSizes: [50, 100, 500, 5000, 50000],
+ page: 1,
+ pageSize: 50,
+ total: 0,
+
+ // 鍏宠仈鐢ㄦ埛鏁版嵁
+ relationUserData: [],
+ relationUserColumns: [],
+ relationLoading: false,
+
+ // 瀵煎叆鐩稿叧
+ upload: {
+ open: false,
+ title: "瀵煎叆",
+ isUploading: false,
+ updateSupport: 0,
+ url: "http://47.96.97.237/API/Gy_Customer/Gy_Customer_Excel",
+ },
+ uploadData: [],
+ uploadTableLoading: false,
+
+ baseURL: process.env.VUE_APP_BASE_URL || "http://47.96.97.237/API/",
+ user: "admin",
+ };
+ },
+ computed: {
+ visibleColumns() {
+ return this.btList.filter(item => !item.hide && item.field);
+ }
+ },
+ created() {
+ 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.getTreeData();
+ this.getList();
+ this.getDefaultFilterScheme();
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ // 鑾峰彇鏍戝舰鏁版嵁
+ getTreeData() {
+ axios
+ .get(this.baseURL + "/Gy_BadReason/Gy_CusTypeTreeListByLevel")
+ .then((response) => {
+ if (response.data.count == 1) {
+ this.treeData = JSON.parse(response.data.data);
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ // 鑾峰彇鍒楄〃鏁版嵁
+ getList() {
+ this.tableShow = false;
+ this.loading = true;
+ console.log(this.sWhere);
+ console.log(this.user);
+ console.log(this.page);
+ console.log(this.pageSize);
+ axios
+ .get(this.baseURL + "/Gy_Customer/page", {
+ params: {
+ sWhere: this.sWhere,
+ user: this.user,
+ page: 1,
+ size: this.pageSize,
+ Organization: ''
+ },
+ })
+ .then((response) => {
+ let data1 = response.data;
+ console.log(response);
+ console.log(response.count);
+ if (data1.code == 1) {
+ this.tyResList = data1.data;
+ console.log(this.tyResList);
+ this.btResList = data1.data;
+ console.log(this.btResList);
+ this.total = data1.count;
+ this.setDefaultColumns();
+ this.tableData = data1.data;
+ this.tableShow = true;
+ this.loading = false;
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ 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: 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.currentCusTypeID = data.id;
+ this.currentCusClsName = data.title;
+
+ if (data.id == "100") {
+ this.sWhere = " and HCusTypeID= "+"0";
+ } else if (data.id == "0") {
+ this.sWhere = "";
+ } else {
+ this.sWhere = " and HCusTypeID='" + data.id + "' ";
+ }
+ this.getList();
+ },
+
+
+ async handleQuery() {
+ this.sWhere = "";
+
+ // 澶勭悊杩囨护鏉′欢
+ this.processFilterConditions();
+
+
+ if (this.queryParams.HNumber) {
+ this.sWhere += " and 瀹㈡埛浠g爜 like '%" + this.queryParams.HNumber + "%'";
+ }
+ if (this.queryParams.HName) {
+ this.sWhere += " and 瀹㈡埛鍚嶇О like '%" + this.queryParams.HName + "%'";
+ }
+
+ this.searchOpen = false;
+ 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 }
+ ];
+
+ conditions.forEach(condition => {
+ if (condition.colName && condition.colName !== "0" && condition.comparator && condition.comparator !== "0") {
+ let com = "";
+ switch (condition.comparator) {
+ case "7":
+ com = "like'%" + condition.content + "%'";
+ break;
+ case "8":
+ com = "like'%" + condition.content + "'";
+ break;
+ case "9":
+ com = "like'" + condition.content + "%'";
+ break;
+ case "10":
+ com = "not like'%" + condition.content + "%'";
+ break;
+ default:
+ com = "" + condition.comparator + "'" + condition.content + "'";
+ break;
+ }
+ this.sWhere += " and " + condition.colName + " " + com;
+ }
+ });
+ },
+
+ // 閲嶇疆鏌ヨ
+ resetQuery() {
+ this.sWhere = "";
+ this.queryParams = {
+ HNumber: null,
+ HName: null,
+ HNumber2: null,
+ ColName: "0",
+ ColName1: "0",
+ ColName2: "0",
+ Comparator: "0",
+ Comparator1: "0",
+ Comparator2: "0",
+ ColContent: "",
+ ColContent1: "",
+ ColContent2: "",
+ };
+ this.getList();
+ },
+
+ // 閲嶆柊鍚屾
+ handleResCnz() {
+ if (!this.queryParams.HNumber2) {
+ this.$modal.msgWarning("璇疯緭鍏ュ鎴蜂唬鐮�");
+ return;
+ }
+
+ axios
+ .get(this.baseURL + "/Gy_Customer/Gy_CustomerViewApi", {
+ params: {
+ Number: this.queryParams.HNumber2,
+ Type: 'KH'
+ }
+ })
+ .then((response) => {
+ if (response.data.count == 1) {
+ this.$modal.msgSuccess(response.data.Message);
+ this.getList();
+ } else {
+ this.$modal.msgError(response.data.Message);
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ // 鍚勭鎿嶄綔鎸夐挳鏂规硶
+ handleSearch() {
+ this.searchOpen = true;
+ },
+
+ handleImport() {
+ this.uploadData = [];
+ this.upload.isUploading = false;
+ this.upload.title = "瀵煎叆";
+ this.upload.open = true;
+ },
+
+ handleExport() {
+ axios
+ .get(this.baseURL + "/LMES/getReportByModRightNameCheck", {
+ params: {
+ ModRightNameCheck: "Gy_Customer_ExportExcel",
+ user: this.user
+ }
+ })
+ .then((response) => {
+ if (response.data.count == 1) {
+ const ws = this.$XLSX.utils.json_to_sheet(this.tyResList);
+ const wb = this.$XLSX.utils.book_new();
+ this.$XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
+ this.$XLSX.writeFile(wb, `Gy_Customer_${new Date().getTime()}.xlsx`);
+ } else {
+ this.$modal.msgError("褰撳墠妯″潡娌℃湁瀵煎嚭鏉冮檺!");
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ handleNumAdd() {
+ if ((this.currentCusTypeID == 0 || this.currentCusTypeID == null) && !this.judgeSkipTouchCusType()) {
+ this.$modal.msgWarning("璇烽�夋嫨鍏蜂綋瀹㈡埛鍒嗙被锛�");
+ return;
+ }
+ this.OperationType = 2;
+ this.openEdit = true;
+ this.editShow = true;
+ },
+
+ handleAdd() {
+ this.OperationType = 1;
+ this.openEdit = true;
+ this.editShow = true;
+ },
+
+ handleCopy() {
+ if (this.single) {
+ this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
+ return;
+ }
+ this.OperationType = 6;
+ this.openEdit = true;
+ this.editShow = true;
+ },
+
+ handleEdit() {
+ if (this.single) {
+ this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
+ return;
+ }
+ this.OperationType = 3;
+ this.openEdit = true;
+ this.editShow = true;
+ },
+
+ handleDelete() {
+ if (this.single) {
+ this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
+ return;
+ }
+
+ if (this.selectedRow.瀹℃牳浜� !== null && this.selectedRow.瀹℃牳浜� !== '') {
+ this.$modal.msgError("宸茶瀹℃牳鐨勭敤鎴蜂笉鑳借鍒犻櫎!");
+ return;
+ }
+
+ this.$modal
+ .confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠")
+ .then(() => {
+ axios
+ .get(this.baseURL + "/Gy_Customer/Delete_Json", {
+ params: {
+ HItemID: this.selectedRow.HItemID,
+ User: this.user,
+ ModRightNameDelete: 'Crm_CustomerFile_Delete'
+ }
+ })
+ .then((response) => {
+ if (response.data.count == 1) {
+ this.getList();
+ this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ } else {
+ this.$modal.msgError("閿欒:" + response.data.code + response.data.Message);
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ })
+ .catch(() => {});
+ },
+
+ handleAudit(isAudit) {
+ if (this.single) {
+ this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
+ return;
+ }
+
+ axios
+ .get(this.baseURL + "/Gy_Customer/AuditGy_Customer", {
+ params: {
+ HInterID: this.selectedRow.HItemID,
+ IsAudit: isAudit,
+ CurUserName: this.user
+ }
+ })
+ .then((response) => {
+ if (response.data.count == 1) {
+ this.getList();
+ this.$modal.msgSuccess(response.data.Message);
+ } else {
+ this.$modal.msgError(response.data.Message);
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ handleStop(isStop) {
+ if (this.single) {
+ this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
+ return;
+ }
+ axios
+ .get(this.baseURL + "/Gy_Customer/StopGy_Customer", {
+ params: {
+ HInterID: this.selectedRow.HItemID,
+ IsStop: isStop,
+ CurUserName: this.user
+ }
+ })
+ .then((response) => {
+ if (response.data.count == 1) {
+ this.getList();
+ this.$modal.msgSuccess(response.data.Message);
+ } else {
+ this.$modal.msgError(response.data.Message);
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ handleColumnSetting() {
+ this.columnSettingShow = true;
+ this.openColumnSetting = true;
+ },
+
+ handleButtonSetting() {
+ this.$modal.msgInfo("鎸夐挳璁剧疆鍔熻兘");
+ },
+
+ handleSaveScheme() {
+ this.$modal.msgInfo("淇濆瓨鏂规鍔熻兘");
+ },
+
+ handleReadScheme() {
+ this.$modal.msgInfo("璇诲彇鏂规鍔熻兘");
+ },
+
+ handleRefresh() {
+ this.getList();
+ },
+
+ handleExit() {
+ this.$router.go(-1);
+ },
+
+ // 瀹㈡埛浠g爜鐐瑰嚮
+ handleCustomerCodeClick(row) {
+ this.selectedRow = row;
+ this.OperationType = 3;
+ this.openEdit = true;
+ this.editShow = true;
+ },
+
+ // 琛岀偣鍑�
+ handleRowClick(row, column, event) {
+ this.$refs.tableData.toggleRowSelection(row);
+ this.selectedRow = row;
+ this.getRelationUserData(row.HItemID);
+ },
+
+ // 鑾峰彇鍏宠仈鐢ㄦ埛鏁版嵁
+ getRelationUserData(HCusID) {
+ this.relationLoading = true;
+ axios
+ .get(this.baseURL + "/Gy_Customer/RelationUserlist", {
+ params: { HCusID: HCusID }
+ })
+ .then((response) => {
+ if (response.data.count == 1) {
+ this.relationUserData = response.data.data;
+ this.setRelationUserColumns(response.data.list);
+ }
+ this.relationLoading = false;
+ })
+ .catch((error) => {
+ this.relationLoading = false;
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ // 璁剧疆鍏宠仈鐢ㄦ埛鍒�
+ setRelationUserColumns(list) {
+ this.relationUserColumns = [];
+ for (let key in list) {
+ if (list[key].ColmCols !== 'HCusID') {
+ this.relationUserColumns.push({
+ field: list[key].ColmCols,
+ title: list[key].ColmCols,
+ align: 'center',
+ width: 120
+ });
+ }
+ }
+ },
+
+ // 琛屾牱寮�
+ rowStyle({ row, rowIndex }) {
+ if (this.ids.includes(row.hmainid)) {
+ return { background: "#ecf5ff" };
+ }
+ },
+
+ // 鍙屽嚮琛�
+ handleDblclick(row, column, cell, event) {
+ this.handleCustomerCodeClick(row);
+ },
+
+ // 閫夋嫨鍙樺寲
+ handleSelectionChange(selection) {
+ this.ids = selection.map((item) => item.hmainid);
+ this.single = selection.length != 1;
+ this.multiple = !selection.length;
+ if (!this.single) {
+ this.selectedRow = selection[0];
+ this.getRelationUserData(this.selectedRow.HItemID);
+ }
+ },
+
+ // 鍏抽棴缂栬緫
+ closeEdit() {
+ this.openEdit = false;
+ this.editShow = false;
+ },
+
+ editClose(val) {
+ this.openEdit = false;
+ this.editShow = false;
+ this.getList();
+ },
+
+ // 鍒楄缃叧闂�
+ columnSettingClose(val) {
+ this.columnSettingShow = false;
+ this.openColumnSetting = val;
+ this.getList();
+ },
+
+ // 瀵煎叆鐩稿叧鏂规硶
+ handleFileUploadProgress(event, file, fileList) {
+ this.upload.isUploading = true;
+ this.uploadTableLoading = true;
+ },
+
+ handleFileSuccess(response, file, fileList) {
+ this.upload.isUploading = true;
+ this.$refs.upload.clearFiles();
+ if (response.code == 1) {
+ this.uploadData = response.data;
+ this.uploadTableLoading = false;
+ } else {
+ this.$alert(
+ "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+ response.Message +
+ "</div>",
+ "瀵煎叆缁撴灉",
+ { dangerouslyUseHTMLString: true }
+ );
+ }
+ },
+
+ handleImportSubmit() {
+ if (this.uploadData.length === 0) {
+ this.$modal.msgWarning("璇峰厛涓婁紶鏂囦欢");
+ return;
+ }
+
+ var sMainSub = JSON.stringify(this.uploadData) + "&鍜�" + this.user;
+ axios({
+ method: "post",
+ url: this.baseURL + "/Gy_Customer/Gy_Customer_btnSave",
+ data: {
+ sMainSub: sMainSub,
+ },
+ })
+ .then((res) => {
+ this.$alert(
+ "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+ res.data.Message +
+ "</div>",
+ "瀵煎叆缁撴灉",
+ { dangerouslyUseHTMLString: true }
+ );
+ this.upload.open = false;
+ this.getList();
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ uploadDataDelete(index) {
+ this.uploadData.splice(index, 1);
+ },
+
+ // 宸ュ叿鏂规硶
+ formatDate(dateString) {
+ if (!dateString) return '';
+ const date = new Date(dateString);
+ return date.toLocaleString('zh-CN');
+ },
+
+ judgeSkipTouchCusType() {
+ 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 = "褰撳墠杩囨护鏂规锛氶粯璁ゆ柟妗�";
+ }
+ },
+};
+</script>
+
+<style>
+.customerBox .el-date-editor.el-input {
+ width: 100%;
+}
+
+.custom-tree-node {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 14px;
+ padding-right: 8px;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/component/AreaDialog/index.vue b/src/views/component/AreaDialog/index.vue
new file mode 100644
index 0000000..b1d526c
--- /dev/null
+++ b/src/views/component/AreaDialog/index.vue
@@ -0,0 +1,492 @@
+<template>
+ <el-dialog
+ title="閫夋嫨鍦板尯"
+ :visible.sync="dialogVisible"
+ width="80%"
+ :before-close="handleClose"
+ append-to-body
+ >
+ <div class="area-dialog">
+ <el-card class="search-card">
+ <div slot="header" class="clearfix">
+ <span>鏌ヨ鏉′欢</span>
+ <el-button
+ style="float: right; padding: 3px 0"
+ type="text"
+ @click="toggleCollapse"
+ >
+ {{ collapse ? '灞曞紑' : '鏀惰捣' }}
+ </el-button>
+ </div>
+
+ <el-form :model="queryParams" ref="queryForm" :inline="true">
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鍦板尯浠g爜">
+ <el-input
+ v-model="queryParams.HNumber"
+ placeholder="璇疯緭鍏ュ湴鍖轰唬鐮�"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍦板尯鍚嶇О">
+ <el-input
+ v-model="queryParams.HName"
+ placeholder="璇疯緭鍏ュ湴鍖哄悕绉�"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item>
+ <el-button type="primary" icon="el-icon-search" @click="handleQuery">鏌ヨ</el-button>
+ <el-button icon="el-icon-refresh" @click="handleReset">閲嶇疆</el-button>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-collapse-transition>
+ <div v-show="!collapse">
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="杩囨护瀛楁">
+ <el-select v-model="queryParams.ColName" placeholder="璇烽�夋嫨瀛楁" style="width: 100%">
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="column in visibleColumns"
+ :key="column.field"
+ :label="column.label"
+ :value="column.field"
+ />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="姣旇緝绗�">
+ <el-select v-model="queryParams.Comparator" placeholder="璇烽�夋嫨姣旇緝绗�" style="width: 100%">
+ <el-option value="0" label=""></el-option>
+ <el-option label="=" value="=" />
+ <el-option label=">=" value=">=" />
+ <el-option label=">" value=">" />
+ <el-option label="<=" value="<=" />
+ <el-option label="<" value="<" />
+ <el-option label="<>" value="<>" />
+ <el-option label="鍖呭惈" value="7" />
+ <el-option label="宸﹀寘鍚�" value="8" />
+ <el-option label="鍙冲寘鍚�" value="9" />
+ <el-option label="涓嶅寘鍚�" value="10" />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍐呭">
+ <el-input
+ v-model="queryParams.ColContent"
+ placeholder="璇疯緭鍏ュ唴瀹�"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </div>
+ </el-collapse-transition>
+ </el-form>
+ </el-card>
+
+
+ <el-card class="table-card">
+ <div slot="header" class="clearfix">
+ <span>鍦板尯鍒楄〃</span>
+ <el-button-group style="float: right">
+ <el-button type="primary" icon="el-icon-refresh" @click="handleRefresh">鍒锋柊</el-button>
+ <el-button type="primary" icon="el-icon-close" @click="handleExit">閫�鍑�</el-button>
+ </el-button-group>
+ </div>
+
+ <el-table
+ ref="table"
+ :data="tableData"
+ v-loading="loading"
+ height="400"
+ border
+ highlight-current-row
+ @row-dblclick="handleRowDblClick"
+ @row-click="handleRowClick"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column type="selection" width="55" align="center" />
+ <el-table-column
+ v-for="column in tableColumns"
+ :key="column.field"
+ :prop="column.field"
+ :label="column.label"
+ :width="column.width"
+ :align="column.align"
+ :sortable="column.sortable"
+ show-overflow-tooltip
+ >
+ <template slot-scope="{ row, column }">
+ <span v-if="column.property.includes('鏃堕棿') || column.property.includes('鏃ユ湡')">
+ {{ formatDate(row[column.property]) }}
+ </span>
+ <span v-else>{{ row[column.property] }}</span>
+ </template>
+ </el-table-column>
+ </el-table>
+
+
+ <el-pagination
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ :current-page="pagination.page"
+ :page-sizes="[50, 100, 500, 5000]"
+ :page-size="pagination.size"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="pagination.total"
+ style="margin-top: 15px; text-align: right;"
+ />
+ </el-card>
+ </div>
+ </el-dialog>
+</template>
+
+<script>
+import axios from 'axios'
+
+export default {
+ name: 'AreaDialog',
+ props: {
+ visible: {
+ type: Boolean,
+ default: false
+ }
+ },
+ data() {
+ return {
+ dialogVisible: false,
+ collapse: false,
+ loading: false,
+
+ // 鏌ヨ鍙傛暟
+ queryParams: {
+ HNumber: '',
+ HName: '',
+ ColName: '0',
+ Comparator: '0',
+ ColContent: ''
+ },
+
+ // 琛ㄦ牸鏁版嵁
+ tableData: [],
+ tableColumns: [],
+ selectedRow: null,
+ multipleSelection: [],
+
+ // 鍒嗛〉
+ pagination: {
+ page: 1,
+ size: 50,
+ total: 0
+ },
+
+ // 闅愯棌瀛楁
+ hiddenFields: ["HItemID", "鐭唬鐮�", "鐖剁骇ID", "绛夌骇", "鏈骇鏍囧織", "鍔╄鐮�", "鍒涘缓缁勭粐", "鑻辨枃鍚嶇О"],
+
+ baseURL: process.env.VUE_APP_BASE_URL || 'http://47.96.97.237/API/',
+ user: 'admin',
+ HModName: 'Gy_AreaSet'
+ }
+ },
+ computed: {
+ visibleColumns() {
+ return this.tableColumns
+ .filter(col => !this.hiddenFields.includes(col.field))
+ .map(col => ({
+ field: col.field,
+ label: col.label
+ }))
+ }
+ },
+ watch: {
+ visible: {
+ immediate: true,
+ handler(val) {
+ this.dialogVisible = val
+ if (val) {
+ this.initData()
+ }
+ }
+ },
+ dialogVisible(val) {
+ this.$emit('update:visible', val)
+ }
+ },
+ methods: {
+ initData() {
+ this.loadTableData()
+ },
+
+ async loadTableData() {
+ this.loading = true
+ try {
+ const sWhere = this.buildQueryCondition()
+
+ const response = await axios.get(`${this.baseURL}/Gy_BadReason/Gy_AreaSetList`, {
+ params: {
+ sWhere: sWhere,
+ user: this.user,
+ page: this.pagination.page,
+ size: this.pagination.size
+ }
+ })
+
+ if (response.data.count === 1) {
+ this.tableData = response.data.data
+ this.pagination.total = response.data.total || response.data.data.length
+ this.generateTableColumns(response.data.list)
+ } else {
+ this.$message.error(response.data.Message || '鍔犺浇鏁版嵁澶辫触')
+ }
+ } catch (error) {
+ console.error('鍔犺浇鍦板尯鏁版嵁澶辫触:', error)
+ this.$message.error('鍔犺浇鍦板尯鏁版嵁澶辫触')
+ } finally {
+ this.loading = false
+ }
+ },
+
+
+ buildQueryCondition() {
+ let sWhere = ""
+
+
+ if (this.queryParams.HNumber) {
+ sWhere += ` and 鍦板尯浠g爜 like '%${this.queryParams.HNumber}%'`
+ }
+ if (this.queryParams.HName) {
+ sWhere += ` and 鍦板尯鍚嶇О like '%${this.queryParams.HName}%'`
+ }
+
+ if (this.queryParams.ColName && this.queryParams.ColName !== "0" &&
+ this.queryParams.Comparator && this.queryParams.Comparator !== "0") {
+ let com = ""
+ switch (this.queryParams.Comparator) {
+ case "7":
+ com = `like '%${this.queryParams.ColContent}%'`
+ break
+ case "8":
+ com = `like '%${this.queryParams.ColContent}'`
+ break
+ case "9":
+ com = `like '${this.queryParams.ColContent}%'`
+ break
+ case "10":
+ com = `not like '%${this.queryParams.ColContent}%'`
+ break
+ default:
+ com = `${this.queryParams.Comparator} '${this.queryParams.ColContent}'`
+ break
+ }
+ sWhere += ` and ${this.queryParams.ColName} ${com}`
+ }
+
+
+ sWhere += this.addSWhereByOpenType()
+
+ return sWhere
+ },
+
+
+ addSWhereByOpenType() {
+
+ return " and 绂佺敤鏍囧織 = '鍚�' and 瀹℃牳浜� != ''"
+ },
+
+
+ generateTableColumns(columnList) {
+ this.tableColumns = []
+
+
+ this.tableColumns.push({ type: 'selection', fixed: 'left' })
+
+
+ if (columnList && columnList.length > 0) {
+ columnList.forEach(item => {
+ if (!this.hiddenFields.includes(item.ColmCols)) {
+ const column = {
+ field: item.ColmCols,
+ label: item.ColmCols,
+ align: 'center',
+ sortable: true,
+ width: 200
+ }
+
+
+ if (item.ColmType === 'DateTime') {
+ column.formatter = this.formatDate
+ }
+
+ this.tableColumns.push(column)
+ }
+ })
+ } else {
+
+ const defaultColumns = [
+ { field: '鍦板尯浠g爜', label: '鍦板尯浠g爜', align: 'center', width: 120 },
+ { field: '鍦板尯鍚嶇О', label: '鍦板尯鍚嶇О', align: 'center', width: 120 },
+ { field: '鏉$爜缂栧彿', label: '鏉$爜缂栧彿', align: 'center', width: 120 },
+ { field: '绂佺敤鏍囪', label: '绂佺敤鏍囪', align: 'center', width: 100 },
+ { field: '澶囨敞', label: '澶囨敞', align: 'center', width: 150 },
+ { field: '瀹℃牳浜�', label: '瀹℃牳浜�', align: 'center', width: 100 },
+ { field: '鍒涘缓浜�', label: '鍒涘缓浜�', align: 'center', width: 100 },
+ { field: '鍒涘缓鏃堕棿', label: '鍒涘缓鏃堕棿', align: 'center', width: 150 }
+ ]
+ this.tableColumns = [...this.tableColumns, ...defaultColumns]
+ }
+ },
+
+ // 鏌ヨ
+ handleQuery() {
+ this.pagination.page = 1
+ this.loadTableData()
+ },
+
+ // 閲嶇疆鏌ヨ
+ handleReset() {
+ this.queryParams = {
+ HNumber: '',
+ HName: '',
+ ColName: '0',
+ Comparator: '0',
+ ColContent: ''
+ }
+ this.pagination.page = 1
+ this.loadTableData()
+ },
+
+ // 鍒锋柊
+ handleRefresh() {
+ this.loadTableData()
+ },
+
+ // 鍒囨崲鎶樺彔鐘舵��
+ toggleCollapse() {
+ this.collapse = !this.collapse
+ },
+
+ // 琛屽弻鍑讳簨浠�
+ handleRowDblClick(row) {
+ this.selectedRow = row
+ this.confirmSelection()
+ },
+
+ // 琛岀偣鍑讳簨浠�
+ handleRowClick(row) {
+ this.$refs.table.toggleRowSelection(row)
+ this.selectedRow = row
+ },
+
+ // 閫夋嫨鍙樺寲
+ handleSelectionChange(selection) {
+ this.multipleSelection = selection
+ if (selection.length === 1) {
+ this.selectedRow = selection[0]
+ }
+ },
+
+ // 纭閫夋嫨
+ confirmSelection() {
+ if (this.selectedRow) {
+ this.$emit('selected', {
+ HItemID: this.selectedRow.HItemID,
+ 鍦板尯鍚嶇О: this.selectedRow.鍦板尯鍚嶇О
+ })
+ this.dialogVisible = false
+ } else {
+ this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�')
+ }
+ },
+
+ // 閫�鍑�
+ handleExit() {
+ this.dialogVisible = false
+ },
+
+ // 鍏抽棴瀵硅瘽妗�
+ handleClose(done) {
+ this.$confirm('纭鍏抽棴锛�')
+ .then(_ => {
+ done()
+ })
+ .catch(_ => {})
+ },
+
+ // 鍒嗛〉澶у皬鏀瑰彉
+ handleSizeChange(size) {
+ this.pagination.size = size
+ this.pagination.page = 1
+ this.loadTableData()
+ },
+
+ // 褰撳墠椤垫敼鍙�
+ handleCurrentChange(page) {
+ this.pagination.page = page
+ this.loadTableData()
+ },
+
+ // 鏍煎紡鍖栨棩鏈�
+ formatDate(dateString) {
+ if (!dateString) return ''
+ try {
+ const date = new Date(dateString)
+ return date.toLocaleDateString('zh-CN')
+ } catch (error) {
+ return dateString
+ }
+ }
+ }
+}
+</script>
+
+<style scoped>
+.area-dialog {
+ height: 70vh;
+ display: flex;
+ flex-direction: column;
+}
+
+.search-card {
+ margin-bottom: 15px;
+}
+
+.table-card {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+}
+
+.table-card >>> .el-card__body {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+}
+
+.clearfix:before,
+.clearfix:after {
+ display: table;
+ content: "";
+}
+.clearfix:after {
+ clear: both;
+}
+
+.el-form-item {
+ margin-bottom: 15px;
+}
+
+.el-table {
+ flex: 1;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/component/CurrencyDialog/index.vue b/src/views/component/CurrencyDialog/index.vue
new file mode 100644
index 0000000..943ce98
--- /dev/null
+++ b/src/views/component/CurrencyDialog/index.vue
@@ -0,0 +1,568 @@
+<template>
+ <el-dialog
+ title="閫夋嫨璐у竵"
+ :visible.sync="dialogVisible"
+ width="80%"
+ :before-close="handleClose"
+ append-to-body
+ >
+ <div class="currency-dialog">
+ <el-card class="search-card">
+ <div slot="header" class="clearfix">
+ <span>鏌ヨ鏉′欢</span>
+ <el-button
+ style="float: right; padding: 3px 0"
+ type="text"
+ @click="toggleCollapse"
+ >
+ {{ collapse ? '灞曞紑' : '鏀惰捣' }}
+ </el-button>
+ </div>
+
+ <el-form :model="queryParams" ref="queryForm" :inline="true">
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="璐у竵浠g爜">
+ <el-input
+ v-model="queryParams.HNumber"
+ placeholder="璇疯緭鍏ヨ揣甯佷唬鐮�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="璐у竵鍚嶇О">
+ <el-input
+ v-model="queryParams.HName"
+ placeholder="璇疯緭鍏ヨ揣甯佸悕绉�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item>
+ <el-button type="primary" icon="el-icon-search" @click="handleQuery">鏌ヨ</el-button>
+ <el-button icon="el-icon-refresh" @click="handleReset">閲嶇疆</el-button>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-collapse-transition>
+ <div v-show="!collapse">
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="杩囨护瀛楁">
+ <el-select v-model="queryParams.ColName" placeholder="璇烽�夋嫨瀛楁" style="width: 100%">
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="column in visibleColumns"
+ :key="column.field"
+ :label="column.label"
+ :value="column.field"
+ />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="姣旇緝绗�">
+ <el-select v-model="queryParams.Comparator" placeholder="璇烽�夋嫨姣旇緝绗�" style="width: 100%">
+ <el-option value="0" label=""></el-option>
+ <el-option label="=" value="=" />
+ <el-option label=">=" value=">=" />
+ <el-option label=">" value=">" />
+ <el-option label="<=" value="<=" />
+ <el-option label="<" value="<" />
+ <el-option label="<>" value="<>" />
+ <el-option label="鍖呭惈" value="7" />
+ <el-option label="宸﹀寘鍚�" value="8" />
+ <el-option label="鍙冲寘鍚�" value="9" />
+ <el-option label="涓嶅寘鍚�" value="10" />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍐呭">
+ <el-input
+ v-model="queryParams.ColContent"
+ placeholder="璇疯緭鍏ュ唴瀹�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </div>
+ </el-collapse-transition>
+
+ <!-- 褰撳墠杩囨护鏂规鏄剧ず -->
+ <div v-if="currentFilterScheme" class="filter-scheme">
+ {{ currentFilterScheme }}
+ </div>
+ </el-form>
+ </el-card>
+
+ <el-card class="table-card">
+ <div slot="header" class="clearfix">
+ <span>璐у竵鍒楄〃</span>
+ <el-button-group style="float: right">
+ <el-button type="primary" icon="el-icon-refresh" @click="handleRefresh">鍒锋柊</el-button>
+ <el-button type="primary" icon="el-icon-close" @click="handleExit">閫�鍑�</el-button>
+ </el-button-group>
+ </div>
+
+ <el-table
+ ref="table"
+ :data="tableData"
+ v-loading="loading"
+ height="400"
+ border
+ highlight-current-row
+ @row-dblclick="handleRowDblClick"
+ @row-click="handleRowClick"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column type="selection" width="55" align="center" />
+ <el-table-column
+ v-for="column in tableColumns"
+ :key="column.field"
+ :prop="column.field"
+ :label="column.label"
+ :width="column.width"
+ :align="column.align"
+ :sortable="column.sortable"
+ show-overflow-tooltip
+ >
+ <template slot-scope="{ row, column }">
+
+ <el-button
+ v-if="column.property === '璐у竵浠g爜'"
+ type="text"
+ @click="handleCurrencyCodeClick(row)"
+ style="color: #409EFF;"
+ >
+ {{ row[column.property] }}
+ </el-button>
+ <span v-else-if="column.property.includes('鏃堕棿') || column.property.includes('鏃ユ湡')">
+ {{ formatDate(row[column.property]) }}
+ </span>
+ <span v-else>{{ row[column.property] }}</span>
+ </template>
+ </el-table-column>
+ </el-table>
+
+
+ <el-pagination
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ :current-page="pagination.page"
+ :page-sizes="[50, 100, 500, 5000]"
+ :page-size="pagination.size"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="pagination.total"
+ style="margin-top: 15px; text-align: right;"
+ />
+ </el-card>
+ </div>
+ </el-dialog>
+</template>
+
+<script>
+import axios from 'axios'
+
+export default {
+ name: 'CurrencyDialog',
+ props: {
+ visible: {
+ type: Boolean,
+ default: false
+ }
+ },
+ data() {
+ return {
+ dialogVisible: false,
+ collapse: false,
+ loading: false,
+
+ queryParams: {
+ HNumber: '',
+ HName: '',
+ ColName: '0',
+ Comparator: '0',
+ ColContent: ''
+ },
+
+ tableData: [],
+ tableColumns: [],
+ selectedRow: null,
+ multipleSelection: [],
+
+ pagination: {
+ page: 1,
+ size: 50,
+ total: 0
+ },
+
+ currentFilterScheme: '',
+ HInterID_Choose: 0,
+
+ hiddenFields: ["HItemID"],
+
+ baseURL: process.env.VUE_APP_BASE_URL || 'http://47.96.97.237/API/',
+ user: 'admin',
+ HModName: 'Gy_Currency',
+ HModuleName: '璐у竵鍒楄〃缁存姢'
+ }
+ },
+ computed: {
+ visibleColumns() {
+ return this.tableColumns
+ .filter(col => !this.hiddenFields.includes(col.field))
+ .map(col => ({
+ field: col.field,
+ label: col.label
+ }))
+ }
+ },
+ watch: {
+ visible: {
+ immediate: true,
+ handler(val) {
+ this.dialogVisible = val
+ if (val) {
+ this.initData()
+ }
+ }
+ },
+ dialogVisible(val) {
+ this.$emit('update:visible', val)
+ }
+ },
+ methods: {
+ // 鍒濆鍖栨暟鎹�
+ initData() {
+ this.loadTableData()
+ this.getDefaultFilterScheme()
+ },
+
+ async loadTableData() {
+ this.loading = true
+ try {
+ const sWhere = this.buildQueryCondition()
+
+ const response = await axios.get(`${this.baseURL}/Gy_Currency/list1`, {
+ params: {
+ sWhere: sWhere,
+ user: this.user,
+ page: this.pagination.page,
+ size: this.pagination.size
+ }
+ })
+
+ if (response.data.count === 1) {
+ this.tableData = response.data.data
+ this.pagination.total = response.data.total || response.data.data.length
+ this.generateTableColumns(response.data.list)
+ } else {
+ this.$message.error(response.data.Message || '鍔犺浇鏁版嵁澶辫触')
+ }
+ } catch (error) {
+ console.error('鍔犺浇璐у竵鏁版嵁澶辫触:', error)
+ this.$message.error('鍔犺浇璐у竵鏁版嵁澶辫触')
+ } finally {
+ this.loading = false
+ }
+ },
+
+ buildQueryCondition() {
+ let sWhere = ""
+
+ if (this.queryParams.HNumber) {
+ sWhere += ` and 璐у竵浠g爜 like '%${this.queryParams.HNumber}%'`
+ }
+ if (this.queryParams.HName) {
+ sWhere += ` and 璐у竵鍚嶇О like '%${this.queryParams.HName}%'`
+ }
+
+ if (this.queryParams.ColName && this.queryParams.ColName !== "0" &&
+ this.queryParams.Comparator && this.queryParams.Comparator !== "0") {
+ let com = ""
+ switch (this.queryParams.Comparator) {
+ case "7":
+ com = `like '%${this.queryParams.ColContent}%'`
+ break
+ case "8":
+ com = `like '%${this.queryParams.ColContent}'`
+ break
+ case "9":
+ com = `like '${this.queryParams.ColContent}%'`
+ break
+ case "10":
+ com = `not like '%${this.queryParams.ColContent}%'`
+ break
+ default:
+ com = `${this.queryParams.Comparator} '${this.queryParams.ColContent}'`
+ break
+ }
+ sWhere += ` and ${this.queryParams.ColName} ${com}`
+ }
+
+ sWhere += this.addSWhereByOpenType()
+
+ return sWhere
+ },
+
+ addSWhereByOpenType() {
+
+ return " and 绂佺敤鏍囪 = '' and 瀹℃牳浜� != ''"
+ },
+
+ // 鐢熸垚琛ㄦ牸鍒�
+ generateTableColumns(columnList) {
+ this.tableColumns = []
+
+ // 娣诲姞閫夋嫨鍒�
+ this.tableColumns.push({ type: 'selection', fixed: 'left' })
+
+ // 鍔ㄦ�佺敓鎴愬垪
+ if (columnList && columnList.length > 0) {
+ columnList.forEach(item => {
+ if (!this.hiddenFields.includes(item.ColmCols)) {
+ const column = {
+ field: item.ColmCols,
+ label: item.ColmCols,
+ align: 'center',
+ sortable: true,
+ width: 200
+ }
+
+ if (item.ColmType === 'DateTime') {
+ column.formatter = this.formatDate
+ }
+
+ this.tableColumns.push(column)
+ }
+ })
+ } else {
+ // 榛樿鍒楋紙濡傛灉鎺ュ彛娌℃湁杩斿洖鍒椾俊鎭級
+ const defaultColumns = [
+ { field: '璐у竵浠g爜', label: '璐у竵浠g爜', align: 'center', width: 120 },
+ { field: '璐у竵鍚嶇О', label: '璐у竵鍚嶇О', align: 'center', width: 120 },
+ { field: '灏忔暟浣�', label: '灏忔暟浣�', align: 'center', width: 100 },
+ { field: '姹囩巼', label: '姹囩巼', align: 'center', width: 100 },
+ { field: '绂佺敤鏍囪', label: '绂佺敤鏍囪', align: 'center', width: 100 },
+ { field: '澶囨敞', label: '澶囨敞', align: 'center', width: 150 },
+ { field: '浣跨敤鏍囪', label: '浣跨敤鏍囪', align: 'center', width: 100 },
+ { field: '瀹℃牳浜�', label: '瀹℃牳浜�', align: 'center', width: 100 },
+ { field: '鍒涘缓浜�', label: '鍒涘缓浜�', align: 'center', width: 100 },
+ { field: '鍒涘缓鏃堕棿', label: '鍒涘缓鏃堕棿', align: 'center', width: 150 }
+ ]
+ this.tableColumns = [...this.tableColumns, ...defaultColumns]
+ }
+ },
+
+ // 鏌ヨ
+ handleQuery() {
+ this.pagination.page = 1
+ this.loadTableData()
+ },
+
+ // 閲嶇疆鏌ヨ
+ handleReset() {
+ this.queryParams = {
+ HNumber: '',
+ HName: '',
+ ColName: '0',
+ Comparator: '0',
+ ColContent: ''
+ }
+ this.pagination.page = 1
+ this.loadTableData()
+ },
+
+ // 鍒锋柊
+ handleRefresh() {
+ this.loadTableData()
+ },
+
+ // 鍒囨崲鎶樺彔鐘舵��
+ toggleCollapse() {
+ this.collapse = !this.collapse
+ },
+
+ // 琛屽弻鍑讳簨浠�
+ handleRowDblClick(row) {
+ this.selectedRow = row
+ this.confirmSelection()
+ },
+
+ // 琛岀偣鍑讳簨浠�
+ handleRowClick(row) {
+ this.$refs.table.toggleRowSelection(row)
+ this.selectedRow = row
+ },
+
+ handleCurrencyCodeClick(row) {
+ console.log('鐐瑰嚮璐у竵浠g爜:', row)
+ this.selectedRow = row
+ this.confirmSelection()
+ },
+
+ // 閫夋嫨鍙樺寲
+ handleSelectionChange(selection) {
+ this.multipleSelection = selection
+ if (selection.length === 1) {
+ this.selectedRow = selection[0]
+ }
+ },
+
+ // 纭閫夋嫨
+ confirmSelection() {
+ if (this.selectedRow) {
+ this.$emit('selected', {
+ HItemID: this.selectedRow.HItemID,
+ 璐у竵鍚嶇О: this.selectedRow.璐у竵鍚嶇О,
+ 姹囩巼: this.selectedRow.姹囩巼
+ })
+ this.dialogVisible = false
+ } else {
+ this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�')
+ }
+ },
+
+ // 閫�鍑�
+ handleExit() {
+ this.dialogVisible = false
+ },
+
+ // 鍏抽棴瀵硅瘽妗�
+ handleClose(done) {
+ this.$confirm('纭鍏抽棴锛�')
+ .then(_ => {
+ done()
+ })
+ .catch(_ => {})
+ },
+
+ // 鍒嗛〉澶у皬鏀瑰彉
+ handleSizeChange(size) {
+ this.pagination.size = size
+ this.pagination.page = 1
+ this.loadTableData()
+ },
+
+ // 褰撳墠椤垫敼鍙�
+ handleCurrentChange(page) {
+ this.pagination.page = page
+ this.loadTableData()
+ },
+
+ // 鏍煎紡鍖栨棩鏈�
+ formatDate(dateString) {
+ if (!dateString) return ''
+ try {
+ const date = new Date(dateString)
+ return date.toLocaleDateString('zh-CN')
+ } catch (error) {
+ return dateString
+ }
+ },
+
+ // 鑾峰彇榛樿杩囨护鏂规
+ async getDefaultFilterScheme() {
+ try {
+ const response = await axios.get(`${this.baseURL}/Xt_FastICScheme/Chooselist`, {
+ params: {
+ user: this.user,
+ HModuleName: this.HModuleName,
+ HInterID: 0,
+ Type: "Default"
+ }
+ })
+
+ if (response.data.count === 1) {
+ const data = response.data.data[0]
+ this.HInterID_Choose = data.hmainid
+ this.currentFilterScheme = `褰撳墠杩囨护鏂规锛�${data.鏂规鍚嶇О} (${data.澶囨敞})`
+
+ // 搴旂敤杩囨护鏉′欢
+ this.applyFilterConditions(response.data.data)
+ }
+ } catch (error) {
+ console.error('鑾峰彇杩囨护鏂规澶辫触:', error)
+ }
+ },
+
+ // 搴旂敤杩囨护鏉′欢
+ applyFilterConditions(filterData) {
+ filterData.forEach(item => {
+ if (this.queryParams.hasOwnProperty(item.杩囨护瀛楁ID)) {
+ this.queryParams[item.杩囨护瀛楁ID] = item.杩囨护鍊�
+ }
+ })
+ },
+
+ // 淇濆瓨杩囨护鏂规
+ handleSaveScheme() {
+ // 瀹炵幇淇濆瓨杩囨护鏂规鐨勯�昏緫
+ this.$message.info('淇濆瓨鏂规鍔熻兘')
+ },
+
+ // 璇诲彇杩囨护鏂规
+ handleReadScheme() {
+ // 瀹炵幇璇诲彇杩囨护鏂规鐨勯�昏緫
+ this.$message.info('璇诲彇鏂规鍔熻兘')
+ }
+ }
+}
+</script>
+
+<style scoped>
+.currency-dialog {
+ height: 70vh;
+ display: flex;
+ flex-direction: column;
+}
+
+.search-card {
+ margin-bottom: 15px;
+}
+
+.table-card {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+}
+
+.table-card >>> .el-card__body {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+}
+
+.clearfix:before,
+.clearfix:after {
+ display: table;
+ content: "";
+}
+.clearfix:after {
+ clear: both;
+}
+
+.el-form-item {
+ margin-bottom: 15px;
+}
+
+.el-table {
+ flex: 1;
+}
+
+.filter-scheme {
+ text-align: center;
+ font-size: 15px;
+ font-weight: bold;
+ color: #fc9393;
+ margin: 10px 0;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/component/CustomerTypeDialog/index.vue b/src/views/component/CustomerTypeDialog/index.vue
new file mode 100644
index 0000000..4e7b048
--- /dev/null
+++ b/src/views/component/CustomerTypeDialog/index.vue
@@ -0,0 +1,794 @@
+<template>
+ <el-dialog
+ title="閫夋嫨瀹㈡埛鍒嗙被"
+ :visible.sync="dialogVisible"
+ width="80%"
+ :before-close="handleClose"
+ append-to-body
+ >
+ <div class="customer-type-dialog">
+ <el-card class="search-card">
+ <div slot="header" class="clearfix">
+ <span>鏌ヨ鏉′欢</span>
+ <el-button
+ style="float: right; padding: 3px 0"
+ type="text"
+ @click="toggleCollapse"
+ >
+ {{ collapse ? '灞曞紑' : '鏀惰捣' }}
+ </el-button>
+ </div>
+
+ <el-form :model="queryParams" ref="queryForm" :inline="true">
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="瀹㈡埛鍒嗙被浠g爜">
+ <el-input
+ v-model="queryParams.HNumber"
+ placeholder="璇疯緭鍏ュ鎴峰垎绫讳唬鐮�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="瀹㈡埛鍒嗙被鍚嶇О">
+ <el-input
+ v-model="queryParams.HName"
+ placeholder="璇疯緭鍏ュ鎴峰垎绫诲悕绉�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item>
+ <el-button type="primary" icon="el-icon-search" @click="handleQuery">鏌ヨ</el-button>
+ <el-button icon="el-icon-refresh" @click="handleReset">閲嶇疆</el-button>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-collapse-transition>
+ <div v-show="!collapse">
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="杩囨护瀛楁">
+ <el-select v-model="queryParams.ColName" placeholder="璇烽�夋嫨瀛楁" style="width: 100%">
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="column in visibleColumns"
+ :key="column.field"
+ :label="column.label"
+ :value="column.field"
+ />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="姣旇緝绗�">
+ <el-select v-model="queryParams.Comparator" placeholder="璇烽�夋嫨姣旇緝绗�" style="width: 100%">
+ <el-option value="0" label=""></el-option>
+ <el-option label="=" value="=" />
+ <el-option label=">=" value=">=" />
+ <el-option label=">" value=">" />
+ <el-option label="<=" value="<=" />
+ <el-option label="<" value="<" />
+ <el-option label="<>" value="<>" />
+ <el-option label="鍖呭惈" value="7" />
+ <el-option label="宸﹀寘鍚�" value="8" />
+ <el-option label="鍙冲寘鍚�" value="9" />
+ <el-option label="涓嶅寘鍚�" value="10" />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍐呭">
+ <el-input
+ v-model="queryParams.ColContent"
+ placeholder="璇疯緭鍏ュ唴瀹�"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="杩囨护瀛楁">
+ <el-select v-model="queryParams.ColName1" placeholder="璇烽�夋嫨瀛楁" style="width: 100%">
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="column in visibleColumns"
+ :key="column.field"
+ :label="column.label"
+ :value="column.field"
+ />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="姣旇緝绗�">
+ <el-select v-model="queryParams.Comparator1" placeholder="璇烽�夋嫨姣旇緝绗�" style="width: 100%">
+ <el-option value="0" label=""></el-option>
+ <el-option label="=" value="=" />
+ <el-option label=">=" value=">=" />
+ <el-option label=">" value=">" />
+ <el-option label="<=" value="<=" />
+ <el-option label="<" value="<" />
+ <el-option label="<>" value="<>" />
+ <el-option label="鍖呭惈" value="7" />
+ <el-option label="宸﹀寘鍚�" value="8" />
+ <el-option label="鍙冲寘鍚�" value="9" />
+ <el-option label="涓嶅寘鍚�" value="10" />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍐呭">
+ <el-input
+ v-model="queryParams.ColContent1"
+ placeholder="璇疯緭鍏ュ唴瀹�"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="杩囨护瀛楁">
+ <el-select v-model="queryParams.ColName2" placeholder="璇烽�夋嫨瀛楁" style="width: 100%">
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="column in visibleColumns"
+ :key="column.field"
+ :label="column.label"
+ :value="column.field"
+ />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="姣旇緝绗�">
+ <el-select v-model="queryParams.Comparator2" placeholder="璇烽�夋嫨姣旇緝绗�" style="width: 100%">
+ <el-option value="0" label=""></el-option>
+ <el-option label="=" value="=" />
+ <el-option label=">=" value=">=" />
+ <el-option label=">" value=">" />
+ <el-option label="<=" value="<=" />
+ <el-option label="<" value="<" />
+ <el-option label="<>" value="<>" />
+ <el-option label="鍖呭惈" value="7" />
+ <el-option label="宸﹀寘鍚�" value="8" />
+ <el-option label="鍙冲寘鍚�" value="9" />
+ <el-option label="涓嶅寘鍚�" value="10" />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍐呭">
+ <el-input
+ v-model="queryParams.ColContent2"
+ placeholder="璇疯緭鍏ュ唴瀹�"
+ clearable
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </div>
+ </el-collapse-transition>
+
+ <div v-if="currentFilterScheme" class="filter-scheme">
+ {{ currentFilterScheme }}
+ </div>
+ </el-form>
+ </el-card>
+
+ <div class="content-area">
+ <el-card class="tree-card">
+ <div slot="header">
+ <span>瀹㈡埛鍒嗙被鏍�</span>
+ </div>
+ <el-tree
+ ref="tree"
+ :data="treeData"
+ :props="treeProps"
+ node-key="id"
+ default-expand-all
+ :expand-on-click-node="false"
+ @node-click="handleTreeNodeClick"
+ :highlight-current="true"
+ style="height: 400px; overflow: auto;"
+ >
+ <span class="custom-tree-node" slot-scope="{ node, data }">
+ <span>{{ node.label }}</span>
+ </span>
+ </el-tree>
+ </el-card>
+
+
+ <el-card class="table-card">
+ <div slot="header" class="clearfix">
+ <span>瀹㈡埛鍒嗙被鍒楄〃</span>
+ <el-button-group style="float: right">
+ <el-button type="primary" icon="el-icon-refresh" @click="handleRefresh">鍒锋柊</el-button>
+ <el-button type="primary" icon="el-icon-close" @click="handleExit">閫�鍑�</el-button>
+ </el-button-group>
+ </div>
+
+ <el-table
+ ref="table"
+ :data="tableData"
+ v-loading="loading"
+ height="400"
+ border
+ highlight-current-row
+ @row-dblclick="handleRowDblClick"
+ @row-click="handleRowClick"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column type="selection" width="55" align="center" />
+ <el-table-column
+ v-for="column in tableColumns"
+ :key="column.field"
+ :prop="column.field"
+ :label="column.label"
+ :width="column.width"
+ :align="column.align"
+ :sortable="column.sortable"
+ show-overflow-tooltip
+ >
+ <template slot-scope="{ row, column }">
+ <!-- 瀹㈡埛鍒嗙被浠g爜鐗规畩澶勭悊锛屾樉绀轰负鍙偣鍑荤殑閾炬帴鏍峰紡 -->
+ <el-button
+ v-if="column.property === '瀹㈡埛鍒嗙被浠g爜'"
+ type="text"
+ @click="handleCustomerTypeCodeClick(row)"
+ style="color: #409EFF;"
+ >
+ {{ row[column.property] }}
+ </el-button>
+ <span v-else-if="column.property.includes('鏃堕棿') || column.property.includes('鏃ユ湡')">
+ {{ formatDate(row[column.property]) }}
+ </span>
+ <span v-else>{{ row[column.property] }}</span>
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <!-- 鍒嗛〉 -->
+ <el-pagination
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ :current-page="pagination.page"
+ :page-sizes="[50, 100, 500, 5000]"
+ :page-size="pagination.size"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="pagination.total"
+ style="margin-top: 15px; text-align: right;"
+ />
+ </el-card>
+ </div>
+ </div>
+ </el-dialog>
+</template>
+
+<script>
+import axios from 'axios'
+
+export default {
+ name: 'CustomerTypeDialog',
+ props: {
+ visible: {
+ type: Boolean,
+ default: false
+ }
+ },
+ data() {
+ return {
+ dialogVisible: false,
+ collapse: false,
+ loading: false,
+ treeLoading: false,
+
+ // 鏌ヨ鍙傛暟
+ queryParams: {
+ HNumber: '',
+ HName: '',
+ ColName: '0',
+ Comparator: '0',
+ ColContent: '',
+ ColName1: '0',
+ Comparator1: '0',
+ ColContent1: '',
+ ColName2: '0',
+ Comparator2: '0',
+ ColContent2: ''
+ },
+
+ // 鏍戝舰鏁版嵁
+ treeData: [],
+ treeProps: {
+ children: 'children',
+ label: 'title'
+ },
+
+ // 琛ㄦ牸鏁版嵁
+ tableData: [],
+ tableColumns: [],
+ selectedRow: null,
+ multipleSelection: [],
+
+ // 鍒嗛〉
+ pagination: {
+ page: 1,
+ size: 50,
+ total: 0
+ },
+
+ // 杩囨护鏂规
+ currentFilterScheme: '',
+ HInterID_Choose: 0,
+
+ // 闅愯棌瀛楁
+ hiddenFields: ["HItemID"],
+
+ baseURL: process.env.VUE_APP_BASE_URL || 'http://47.96.97.237/API/',
+ user: 'admin',
+ HModName: 'Gy_CusType',
+ HModuleName: '瀹㈡埛鍒嗙被鍒楄〃缁存姢'
+ }
+ },
+ computed: {
+ visibleColumns() {
+ return this.tableColumns
+ .filter(col => !this.hiddenFields.includes(col.field))
+ .map(col => ({
+ field: col.field,
+ label: col.label
+ }))
+ }
+ },
+ watch: {
+ visible: {
+ immediate: true,
+ handler(val) {
+ this.dialogVisible = val
+ if (val) {
+ this.initData()
+ }
+ }
+ },
+ dialogVisible(val) {
+ this.$emit('update:visible', val)
+ }
+ },
+ methods: {
+ // 鍒濆鍖栨暟鎹�
+ initData() {
+ this.loadTreeData()
+ this.loadTableData()
+ this.getDefaultFilterScheme()
+ },
+
+ // 鍔犺浇鏍戝舰鏁版嵁
+ async loadTreeData() {
+ this.treeLoading = true
+ try {
+ const response = await axios.get(`${this.baseURL}/Gy_BadReason/Gy_CusTypeTreeListByLevel`)
+
+ if (response.data.count === 1) {
+ this.treeData = JSON.parse(response.data.data)
+ } else {
+ this.$message.error(response.data.Message || '鍔犺浇鏍戝舰鏁版嵁澶辫触')
+ }
+ } catch (error) {
+ console.error('鍔犺浇瀹㈡埛鍒嗙被鏍戝舰鏁版嵁澶辫触:', error)
+ this.$message.error('鍔犺浇瀹㈡埛鍒嗙被鏍戝舰鏁版嵁澶辫触')
+ } finally {
+ this.treeLoading = false
+ }
+ },
+
+ // 鍔犺浇琛ㄦ牸鏁版嵁
+ async loadTableData() {
+ this.loading = true
+ try {
+ const sWhere = this.buildQueryCondition()
+
+ const response = await axios.get(`${this.baseURL}/Gy_BadReason/Gy_CusTypeList`, {
+ params: {
+ sWhere: sWhere,
+ user: this.user,
+ page: this.pagination.page,
+ size: this.pagination.size
+ }
+ })
+
+ if (response.data.count === 1) {
+ this.tableData = response.data.data
+ this.pagination.total = response.data.total || response.data.data.length
+ this.generateTableColumns(response.data.list)
+ } else {
+ this.$message.error(response.data.Message || '鍔犺浇鏁版嵁澶辫触')
+ }
+ } catch (error) {
+ console.error('鍔犺浇瀹㈡埛鍒嗙被鏁版嵁澶辫触:', error)
+ this.$message.error('鍔犺浇瀹㈡埛鍒嗙被鏁版嵁澶辫触')
+ } finally {
+ this.loading = false
+ }
+ },
+
+ // 鏋勫缓鏌ヨ鏉′欢
+ buildQueryCondition() {
+ let sWhere = ""
+
+ // 鍩烘湰鏌ヨ鏉′欢
+ if (this.queryParams.HNumber) {
+ sWhere += ` and 瀹㈡埛鍒嗙被浠g爜 like '%${this.queryParams.HNumber}%'`
+ }
+ if (this.queryParams.HName) {
+ sWhere += ` and 瀹㈡埛鍒嗙被鍚嶇О like '%${this.queryParams.HName}%'`
+ }
+
+ // 澶勭悊涓夌粍杩囨护鏉′欢
+ const filterGroups = [
+ { 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 }
+ ]
+
+ filterGroups.forEach(filter => {
+ if (filter.colName && filter.colName !== "0" &&
+ filter.comparator && filter.comparator !== "0") {
+ let com = ""
+ switch (filter.comparator) {
+ case "7":
+ com = `like '%${filter.content}%'`
+ break
+ case "8":
+ com = `like '%${filter.content}'`
+ break
+ case "9":
+ com = `like '${filter.content}%'`
+ break
+ case "10":
+ com = `not like '%${filter.content}%'`
+ break
+ default:
+ com = `${filter.comparator} '${filter.content}'`
+ break
+ }
+ sWhere += ` and ${filter.colName} ${com}`
+ }
+ })
+
+ // 娣诲姞鎵撳紑绫诲瀷鐨勮繃婊ゆ潯浠�
+ sWhere += this.addSWhereByOpenType()
+
+ return sWhere
+ },
+
+ // 鏍规嵁鎵撳紑绫诲瀷娣诲姞鏉′欢
+ addSWhereByOpenType() {
+ // 杩欓噷鍙互鏍规嵁闇�瑕佹坊鍔犵壒瀹氱殑杩囨护鏉′欢
+ return " and 绂佺敤鏍囧織 = '鍚�' and 瀹℃牳浜� != ''"
+ },
+
+ // 鐢熸垚琛ㄦ牸鍒�
+ generateTableColumns(columnList) {
+ this.tableColumns = []
+
+ // 娣诲姞閫夋嫨鍒�
+ this.tableColumns.push({ type: 'selection', fixed: 'left' })
+
+ // 鍔ㄦ�佺敓鎴愬垪
+ if (columnList && columnList.length > 0) {
+ columnList.forEach(item => {
+ if (!this.hiddenFields.includes(item.ColmCols)) {
+ const column = {
+ field: item.ColmCols,
+ label: item.ColmCols,
+ align: 'center',
+ sortable: true,
+ width: 200
+ }
+
+ // 鏍规嵁瀛楁绫诲瀷璁剧疆涓嶅悓鐨勬ā鏉�
+ if (item.ColmType === 'DateTime') {
+ column.formatter = this.formatDate
+ }
+
+ this.tableColumns.push(column)
+ }
+ })
+ } else {
+ const defaultColumns = [
+ { field: '瀹㈡埛鍒嗙被浠g爜', label: '瀹㈡埛鍒嗙被浠g爜', align: 'center', width: 120 },
+ { field: '瀹㈡埛鍒嗙被鍚嶇О', label: '瀹㈡埛鍒嗙被鍚嶇О', align: 'center', width: 120 },
+ { field: '鏉$爜缂栧彿', label: '鏉$爜缂栧彿', align: 'center', width: 120 },
+ { field: '绂佺敤鏍囪', label: '绂佺敤鏍囪', align: 'center', width: 100 },
+ { field: '澶囨敞', label: '澶囨敞', align: 'center', width: 150 },
+ { field: '瀹℃牳浜�', label: '瀹℃牳浜�', align: 'center', width: 100 },
+ { field: '鍒涘缓浜�', label: '鍒涘缓浜�', align: 'center', width: 100 },
+ { field: '鍒涘缓鏃堕棿', label: '鍒涘缓鏃堕棿', align: 'center', width: 150 }
+ ]
+ this.tableColumns = [...this.tableColumns, ...defaultColumns]
+ }
+ },
+
+ handleTreeNodeClick(data) {
+ let sWhere = ""
+ if (data.id !== '0') {
+ sWhere = ` and 鐖剁骇ID = '${data.id}' or HItemID = '${data.id}'`
+ }
+ this.loadTableDataWithCondition(sWhere)
+ },
+
+ async loadTableDataWithCondition(sWhere) {
+ this.loading = true
+ try {
+ const response = await axios.get(`${this.baseURL}/Gy_BadReason/Gy_CusTypeList`, {
+ params: {
+ sWhere: sWhere,
+ user: this.user
+ }
+ })
+
+ if (response.data.count === 1) {
+ this.tableData = response.data.data
+ this.pagination.total = response.data.total || response.data.data.length
+ }
+ } catch (error) {
+ console.error('鍔犺浇鏁版嵁澶辫触:', error)
+ } finally {
+ this.loading = false
+ }
+ },
+
+ handleQuery() {
+ this.pagination.page = 1
+ this.loadTableData()
+ },
+
+ handleReset() {
+ this.queryParams = {
+ HNumber: '',
+ HName: '',
+ ColName: '0',
+ Comparator: '0',
+ ColContent: '',
+ ColName1: '0',
+ Comparator1: '0',
+ ColContent1: '',
+ ColName2: '0',
+ Comparator2: '0',
+ ColContent2: ''
+ }
+ this.pagination.page = 1
+ this.loadTableData()
+ },
+
+ // 鍒锋柊
+ handleRefresh() {
+ this.loadTreeData()
+ this.loadTableData()
+ },
+
+
+ toggleCollapse() {
+ this.collapse = !this.collapse
+ },
+
+ // 琛屽弻鍑讳簨浠�
+ handleRowDblClick(row) {
+ this.selectedRow = row
+ this.confirmSelection()
+ },
+
+ // 琛岀偣鍑讳簨浠�
+ handleRowClick(row) {
+ this.$refs.table.toggleRowSelection(row)
+ this.selectedRow = row
+ },
+
+ handleCustomerTypeCodeClick(row) {
+ console.log('鐐瑰嚮瀹㈡埛鍒嗙被浠g爜:', row)
+ this.selectedRow = row
+ this.confirmSelection()
+ },
+
+
+ handleSelectionChange(selection) {
+ this.multipleSelection = selection
+ if (selection.length === 1) {
+ this.selectedRow = selection[0]
+ }
+ },
+
+
+ confirmSelection() {
+ if (this.selectedRow) {
+ this.$emit('selected', {
+ HItemID: this.selectedRow.HItemID,
+ 瀹㈡埛鍒嗙被鍚嶇О: this.selectedRow.瀹㈡埛鍒嗙被鍚嶇О
+ })
+ this.dialogVisible = false
+ } else {
+ this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�')
+ }
+ },
+
+ // 閫�鍑�
+ handleExit() {
+ this.dialogVisible = false
+ },
+
+ // 鍏抽棴瀵硅瘽妗�
+ handleClose(done) {
+ this.$confirm('纭鍏抽棴锛�')
+ .then(_ => {
+ done()
+ })
+ .catch(_ => {})
+ },
+
+ // 鍒嗛〉澶у皬鏀瑰彉
+ handleSizeChange(size) {
+ this.pagination.size = size
+ this.pagination.page = 1
+ this.loadTableData()
+ },
+
+ // 褰撳墠椤垫敼鍙�
+ handleCurrentChange(page) {
+ this.pagination.page = page
+ this.loadTableData()
+ },
+
+ // 鏍煎紡鍖栨棩鏈�
+ formatDate(dateString) {
+ if (!dateString) return ''
+ try {
+ const date = new Date(dateString)
+ return date.toLocaleDateString('zh-CN')
+ } catch (error) {
+ return dateString
+ }
+ },
+
+ // 鑾峰彇榛樿杩囨护鏂规
+ async getDefaultFilterScheme() {
+ try {
+ const response = await axios.get(`${this.baseURL}/Xt_FastICScheme/Chooselist`, {
+ params: {
+ user: this.user,
+ HModuleName: this.HModuleName,
+ HInterID: 0,
+ Type: "Default"
+ }
+ })
+
+ if (response.data.count === 1) {
+ const data = response.data.data[0]
+ this.HInterID_Choose = data.hmainid
+ this.currentFilterScheme = `褰撳墠杩囨护鏂规锛�${data.鏂规鍚嶇О} (${data.澶囨敞})`
+
+ // 搴旂敤杩囨护鏉′欢
+ this.applyFilterConditions(response.data.data)
+ }
+ } catch (error) {
+ console.error('鑾峰彇杩囨护鏂规澶辫触:', error)
+ }
+ },
+
+ // 搴旂敤杩囨护鏉′欢
+ applyFilterConditions(filterData) {
+ filterData.forEach(item => {
+ if (this.queryParams.hasOwnProperty(item.杩囨护瀛楁ID)) {
+ this.queryParams[item.杩囨护瀛楁ID] = item.杩囨护鍊�
+ }
+ })
+ },
+
+ // 淇濆瓨杩囨护鏂规
+ handleSaveScheme() {
+ this.$message.info('淇濆瓨鏂规鍔熻兘')
+ },
+
+ // 璇诲彇杩囨护鏂规
+ handleReadScheme() {
+ this.$message.info('璇诲彇鏂规鍔熻兘')
+ },
+
+ // 鍒楄缃�
+ handleColumnSetting() {
+ this.$message.info('鍒楄缃姛鑳�')
+ }
+ }
+}
+</script>
+
+<style scoped>
+.customer-type-dialog {
+ height: 80vh;
+ display: flex;
+ flex-direction: column;
+}
+
+.search-card {
+ margin-bottom: 15px;
+}
+
+.content-area {
+ flex: 1;
+ display: flex;
+ gap: 15px;
+}
+
+.tree-card {
+ width: 25%;
+ display: flex;
+ flex-direction: column;
+}
+
+.table-card {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+}
+
+.table-card >>> .el-card__body {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+}
+
+.tree-card >>> .el-card__body {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+}
+
+.clearfix:before,
+.clearfix:after {
+ display: table;
+ content: "";
+}
+.clearfix:after {
+ clear: both;
+}
+
+.el-form-item {
+ margin-bottom: 15px;
+}
+
+.el-table {
+ flex: 1;
+}
+
+.filter-scheme {
+ text-align: center;
+ font-size: 15px;
+ font-weight: bold;
+ color: #fc9393;
+ margin: 10px 0;
+}
+
+.custom-tree-node {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 14px;
+ padding-right: 8px;
+}
+
+/* 鏍戣妭鐐归�変腑鏍峰紡 */
+.el-tree >>> .el-tree-node.is-current > .el-tree-node__content {
+ background-color: #aef0f7;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/component/SettleStyleDialog/index.vue b/src/views/component/SettleStyleDialog/index.vue
new file mode 100644
index 0000000..e15d97a
--- /dev/null
+++ b/src/views/component/SettleStyleDialog/index.vue
@@ -0,0 +1,609 @@
+<template>
+ <el-dialog
+ title="閫夋嫨缁撶畻鏂瑰紡"
+ :visible.sync="dialogVisible"
+ width="80%"
+ :before-close="handleClose"
+ append-to-body
+ >
+ <div class="settle-style-dialog">
+ <!-- 鎼滅储鍖哄煙 -->
+ <el-card class="search-card">
+ <div slot="header" class="clearfix">
+ <span>鏌ヨ鏉′欢</span>
+ <el-button
+ style="float: right; padding: 3px 0"
+ type="text"
+ @click="toggleCollapse"
+ >
+ {{ collapse ? '灞曞紑' : '鏀惰捣' }}
+ </el-button>
+ </div>
+
+ <el-form :model="queryParams" ref="queryForm" :inline="true">
+ <el-row :gutter="20">
+ <el-col :span="6">
+ <el-form-item label="浠g爜">
+ <el-input
+ v-model="queryParams.HNumber"
+ placeholder="璇疯緭鍏ヤ唬鐮�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="鍚嶇О">
+ <el-input
+ v-model="queryParams.HName"
+ placeholder="璇疯緭鍏ュ悕绉�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="缁撶畻鏂瑰紡浠g爜">
+ <el-input
+ v-model="queryParams.HNumber2"
+ placeholder="璇疯緭鍏ョ粨绠楁柟寮忎唬鐮�"
+ clearable
+ style="width: 190px"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item>
+ <el-button type="primary" icon="el-icon-search" @click="handleQuery">鏌ヨ</el-button>
+ <el-button icon="el-icon-refresh" @click="handleReset">閲嶇疆</el-button>
+ <el-button type="primary" @click="handleResCnz" style="margin-left: 10px">閲嶆柊鍚屾</el-button>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 楂樼骇鎼滅储 -->
+ <el-collapse-transition>
+ <div v-show="!collapse">
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="杩囨护瀛楁">
+ <el-select v-model="queryParams.ColName" placeholder="璇烽�夋嫨瀛楁" style="width: 100%">
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="column in visibleColumns"
+ :key="column.field"
+ :label="column.label"
+ :value="column.field"
+ />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="姣旇緝绗�">
+ <el-select v-model="queryParams.Comparator" placeholder="璇烽�夋嫨姣旇緝绗�" style="width: 100%">
+ <el-option value="0" label=""></el-option>
+ <el-option label="=" value="=" />
+ <el-option label=">=" value=">=" />
+ <el-option label=">" value=">" />
+ <el-option label="<=" value="<=" />
+ <el-option label="<" value="<" />
+ <el-option label="<>" value="<>" />
+ <el-option label="鍖呭惈" value="7" />
+ <el-option label="宸﹀寘鍚�" value="8" />
+ <el-option label="鍙冲寘鍚�" value="9" />
+ <el-option label="涓嶅寘鍚�" value="10" />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍐呭">
+ <el-input
+ v-model="queryParams.ColContent"
+ placeholder="璇疯緭鍏ュ唴瀹�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </div>
+ </el-collapse-transition>
+
+ <!-- 褰撳墠杩囨护鏂规鏄剧ず -->
+ <div v-if="currentFilterScheme" class="filter-scheme">
+ {{ currentFilterScheme }}
+ </div>
+ </el-form>
+ </el-card>
+
+ <!-- 琛ㄦ牸鍖哄煙 -->
+ <el-card class="table-card">
+ <div slot="header" class="clearfix">
+ <span>缁撶畻鏂瑰紡鍒楄〃</span>
+ <el-button-group style="float: right">
+ <el-button type="primary" icon="el-icon-refresh" @click="handleRefresh">鍒锋柊</el-button>
+ <el-button type="primary" icon="el-icon-close" @click="handleExit">閫�鍑�</el-button>
+ </el-button-group>
+ </div>
+
+ <el-table
+ ref="table"
+ :data="tableData"
+ v-loading="loading"
+ height="400"
+ border
+ highlight-current-row
+ @row-dblclick="handleRowDblClick"
+ @row-click="handleRowClick"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column type="selection" width="55" align="center" />
+ <el-table-column
+ v-for="column in tableColumns"
+ :key="column.field"
+ :prop="column.field"
+ :label="column.label"
+ :width="column.width"
+ :align="column.align"
+ :sortable="column.sortable"
+ show-overflow-tooltip
+ >
+ <template slot-scope="{ row, column }">
+ <span v-if="column.property.includes('鏃堕棿') || column.property.includes('鏃ユ湡')">
+ {{ formatDate(row[column.property]) }}
+ </span>
+ <span v-else>{{ row[column.property] }}</span>
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <!-- 鍒嗛〉 -->
+ <el-pagination
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ :current-page="pagination.page"
+ :page-sizes="[50, 100, 500, 5000]"
+ :page-size="pagination.size"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="pagination.total"
+ style="margin-top: 15px; text-align: right;"
+ />
+ </el-card>
+ </div>
+ </el-dialog>
+</template>
+
+<script>
+import axios from 'axios'
+
+export default {
+ name: 'SettleStyleDialog',
+ props: {
+ visible: {
+ type: Boolean,
+ default: false
+ }
+ },
+ data() {
+ return {
+ dialogVisible: false,
+ collapse: false,
+ loading: false,
+
+ // 鏌ヨ鍙傛暟
+ queryParams: {
+ HNumber: '',
+ HName: '',
+ HNumber2: '',
+ ColName: '0',
+ Comparator: '0',
+ ColContent: ''
+ },
+
+ // 琛ㄦ牸鏁版嵁
+ tableData: [],
+ tableColumns: [],
+ selectedRow: null,
+ multipleSelection: [],
+
+ // 鍒嗛〉
+ pagination: {
+ page: 1,
+ size: 50,
+ total: 0
+ },
+
+ // 杩囨护鏂规
+ currentFilterScheme: '',
+ HInterID_Choose: 0,
+
+ // 闅愯棌瀛楁
+ hiddenFields: ["HItemID", "HUSEORGID", "HCREATEORGID", "鐖剁骇ID"],
+
+ baseURL: process.env.VUE_APP_BASE_URL || 'http://47.96.97.237/API/',
+ user: 'admin',
+ HModName: 'Gy_SettleStyle',
+ HModuleName: '缁撶畻鏂瑰紡缁存姢',
+ Organization: '100038'
+ }
+ },
+ computed: {
+ visibleColumns() {
+ return this.tableColumns
+ .filter(col => !this.hiddenFields.includes(col.field))
+ .map(col => ({
+ field: col.field,
+ label: col.label
+ }))
+ }
+ },
+ watch: {
+ visible: {
+ immediate: true,
+ handler(val) {
+ this.dialogVisible = val
+ if (val) {
+ this.initData()
+ }
+ }
+ },
+ dialogVisible(val) {
+ this.$emit('update:visible', val)
+ }
+ },
+ methods: {
+ // 鍒濆鍖栨暟鎹�
+ initData() {
+ this.loadTableData()
+ this.getDefaultFilterScheme()
+ },
+
+ // 鍔犺浇琛ㄦ牸鏁版嵁
+ async loadTableData() {
+ this.loading = true
+ try {
+ const sWhere = this.buildQueryCondition()
+
+ const response = await axios.get(`${this.baseURL}/Gy_SettleStyle/SettleStyleList`, {
+ params: {
+ sWhere: sWhere,
+ user: this.user,
+ Organization: this.Organization
+ }
+ })
+
+ if (response.data.count === 1) {
+ this.tableData = response.data.data
+ console.log('缁撶畻鏂瑰紡鏁版嵁:', this.tableData)
+ this.pagination.total = response.data.total || response.data.data.length
+ this.generateTableColumns(response.data.list)
+ } else {
+ this.$message.error(response.data.Message || '鍔犺浇鏁版嵁澶辫触')
+ }
+ } catch (error) {
+ console.error('鍔犺浇缁撶畻鏂瑰紡鏁版嵁澶辫触:', error)
+ this.$message.error('鍔犺浇缁撶畻鏂瑰紡鏁版嵁澶辫触')
+ } finally {
+ this.loading = false
+ }
+ },
+
+ // 鏋勫缓鏌ヨ鏉′欢
+ buildQueryCondition() {
+ let sWhere = ""
+
+ // 鍩烘湰鏌ヨ鏉′欢
+ if (this.queryParams.HNumber) {
+ sWhere += ` and 缁撶畻鏂瑰紡浠g爜 like '%${this.queryParams.HNumber}%'`
+ }
+ if (this.queryParams.HName) {
+ sWhere += ` and 缁撶畻鏂瑰紡鍚嶇О like '%${this.queryParams.HName}%'`
+ }
+
+ // 楂樼骇杩囨护鏉′欢
+ if (this.queryParams.ColName && this.queryParams.ColName !== "0" &&
+ this.queryParams.Comparator && this.queryParams.Comparator !== "0") {
+ let com = ""
+ switch (this.queryParams.Comparator) {
+ case "7":
+ com = `like '%${this.queryParams.ColContent}%'`
+ break
+ case "8":
+ com = `like '%${this.queryParams.ColContent}'`
+ break
+ case "9":
+ com = `like '${this.queryParams.ColContent}%'`
+ break
+ case "10":
+ com = `not like '%${this.queryParams.ColContent}%'`
+ break
+ default:
+ com = `${this.queryParams.Comparator} '${this.queryParams.ColContent}'`
+ break
+ }
+ sWhere += ` and ${this.queryParams.ColName} ${com}`
+ }
+
+ // 娣诲姞鎵撳紑绫诲瀷鐨勮繃婊ゆ潯浠�
+ sWhere += this.addSWhereByOpenType()
+
+ return sWhere
+ },
+
+ // 鏍规嵁鎵撳紑绫诲瀷娣诲姞鏉′欢
+ addSWhereByOpenType() {
+ // 杩欓噷鍙互鏍规嵁闇�瑕佹坊鍔犵壒瀹氱殑杩囨护鏉′欢
+ return " and 绂佺敤鏍囪 = ''"
+ },
+
+ // 鐢熸垚琛ㄦ牸鍒�
+ generateTableColumns(columnList) {
+ this.tableColumns = []
+
+ // 娣诲姞閫夋嫨鍒�
+ this.tableColumns.push({ type: 'selection', fixed: 'left' })
+
+ // 鍔ㄦ�佺敓鎴愬垪
+ if (columnList && columnList.length > 0) {
+ columnList.forEach(item => {
+ if (!this.hiddenFields.includes(item.ColmCols)) {
+ const column = {
+ field: item.ColmCols,
+ label: item.ColmCols,
+ align: 'center',
+ sortable: true,
+ width: 200
+ }
+
+ // 鏍规嵁瀛楁绫诲瀷璁剧疆涓嶅悓鐨勬ā鏉�
+ if (item.ColmType === 'DateTime') {
+ column.formatter = this.formatDate
+ }
+
+ this.tableColumns.push(column)
+ }
+ })
+ } else {
+ // 榛樿鍒楋紙濡傛灉鎺ュ彛娌℃湁杩斿洖鍒椾俊鎭級
+ const defaultColumns = [
+ { field: '缁撶畻鏂瑰紡浠g爜', label: '缁撶畻鏂瑰紡浠g爜', align: 'center', width: 120 },
+ { field: '缁撶畻鏂瑰紡鍚嶇О', label: '缁撶畻鏂瑰紡鍚嶇О', align: 'center', width: 120 },
+ { field: '鏉$爜缂栧彿', label: '鏉$爜缂栧彿', align: 'center', width: 120 },
+ { field: '绂佺敤鏍囪', label: '绂佺敤鏍囪', align: 'center', width: 100 },
+ { field: '澶囨敞', label: '澶囨敞', align: 'center', width: 150 },
+ { field: '瀹℃牳浜�', label: '瀹℃牳浜�', align: 'center', width: 100 },
+ { field: '鍒涘缓浜�', label: '鍒涘缓浜�', align: 'center', width: 100 },
+ { field: '鍒涘缓鏃堕棿', label: '鍒涘缓鏃堕棿', align: 'center', width: 150 }
+ ]
+ this.tableColumns = [...this.tableColumns, ...defaultColumns]
+ }
+ },
+
+ // 鏌ヨ
+ handleQuery() {
+ this.pagination.page = 1
+ this.loadTableData()
+ },
+
+ // 閲嶇疆鏌ヨ
+ handleReset() {
+ this.queryParams = {
+ HNumber: '',
+ HName: '',
+ HNumber2: '',
+ ColName: '0',
+ Comparator: '0',
+ ColContent: ''
+ }
+ this.pagination.page = 1
+ this.loadTableData()
+ },
+
+ // 閲嶆柊鍚屾
+ async handleResCnz() {
+ if (!this.queryParams.HNumber2) {
+ this.$message.warning('璇疯緭鍏ョ粨绠楁柟寮忎唬鐮�')
+ return
+ }
+
+ try {
+ const response = await axios.get(`${this.baseURL}/Gy_SettleStyle/Gy_SettleStyleViewApi`, {
+ params: {
+ Number: this.queryParams.HNumber2,
+ Type: 'JSFS'
+ }
+ })
+
+ if (response.data.count === 1) {
+ this.$message.success(response.data.Message)
+ this.loadTableData() // 閲嶆柊鍔犺浇鏁版嵁
+ } else {
+ this.$message.error(response.data.Message)
+ }
+ } catch (error) {
+ console.error('閲嶆柊鍚屾澶辫触:', error)
+ this.$message.error('閲嶆柊鍚屾澶辫触')
+ }
+ },
+
+ // 鍒锋柊
+ handleRefresh() {
+ this.loadTableData()
+ },
+
+ // 鍒囨崲鎶樺彔鐘舵��
+ toggleCollapse() {
+ this.collapse = !this.collapse
+ },
+
+ // 琛屽弻鍑讳簨浠�
+ handleRowDblClick(row) {
+ this.selectedRow = row
+ this.confirmSelection()
+ },
+
+ // 琛岀偣鍑讳簨浠�
+ handleRowClick(row) {
+ this.$refs.table.toggleRowSelection(row)
+ this.selectedRow = row
+ },
+
+ // 閫夋嫨鍙樺寲
+ handleSelectionChange(selection) {
+ this.multipleSelection = selection
+ if (selection.length === 1) {
+ this.selectedRow = selection[0]
+ }
+ },
+
+ // 纭閫夋嫨
+ confirmSelection() {
+ if (this.selectedRow) {
+ this.$emit('selected', {
+ HItemID: this.selectedRow.HItemID,
+ 缁撶畻鏂瑰紡鍚嶇О: this.selectedRow.缁撶畻鏂瑰紡鍚嶇О
+ })
+ this.dialogVisible = false
+ } else {
+ this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�')
+ }
+ },
+
+ // 閫�鍑�
+ handleExit() {
+ this.dialogVisible = false
+ },
+
+ // 鍏抽棴瀵硅瘽妗�
+ handleClose(done) {
+ this.$confirm('纭鍏抽棴锛�')
+ .then(_ => {
+ done()
+ })
+ .catch(_ => {})
+ },
+
+ // 鍒嗛〉澶у皬鏀瑰彉
+ handleSizeChange(size) {
+ this.pagination.size = size
+ this.pagination.page = 1
+ this.loadTableData()
+ },
+
+ // 褰撳墠椤垫敼鍙�
+ handleCurrentChange(page) {
+ this.pagination.page = page
+ this.loadTableData()
+ },
+
+ // 鏍煎紡鍖栨棩鏈�
+ formatDate(dateString) {
+ if (!dateString) return ''
+ try {
+ const date = new Date(dateString)
+ return date.toLocaleDateString('zh-CN')
+ } catch (error) {
+ return dateString
+ }
+ },
+
+ // 鑾峰彇榛樿杩囨护鏂规
+ async getDefaultFilterScheme() {
+ try {
+ const response = await axios.get(`${this.baseURL}/Xt_FastICScheme/Chooselist`, {
+ params: {
+ user: this.user,
+ HModuleName: this.HModuleName,
+ HInterID: 0,
+ Type: "Default"
+ }
+ })
+
+ if (response.data.count === 1) {
+ const data = response.data.data[0]
+ this.HInterID_Choose = data.hmainid
+ this.currentFilterScheme = `褰撳墠杩囨护鏂规锛�${data.鏂规鍚嶇О} (${data.澶囨敞})`
+
+ // 搴旂敤杩囨护鏉′欢
+ this.applyFilterConditions(response.data.data)
+ }
+ } catch (error) {
+ console.error('鑾峰彇杩囨护鏂规澶辫触:', error)
+ }
+ },
+
+ // 搴旂敤杩囨护鏉′欢
+ applyFilterConditions(filterData) {
+ filterData.forEach(item => {
+ if (this.queryParams.hasOwnProperty(item.杩囨护瀛楁ID)) {
+ this.queryParams[item.杩囨护瀛楁ID] = item.杩囨护鍊�
+ }
+ })
+ },
+
+ // 淇濆瓨杩囨护鏂规
+ handleSaveScheme() {
+ this.$message.info('淇濆瓨鏂规鍔熻兘')
+ },
+
+ // 璇诲彇杩囨护鏂规
+ handleReadScheme() {
+ this.$message.info('璇诲彇鏂规鍔熻兘')
+ },
+
+ // 鍒楄缃�
+ handleColumnSetting() {
+ this.$message.info('鍒楄缃姛鑳�')
+ }
+ }
+}
+</script>
+
+<style scoped>
+.settle-style-dialog {
+ height: 70vh;
+ display: flex;
+ flex-direction: column;
+}
+
+.search-card {
+ margin-bottom: 15px;
+}
+
+.table-card {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+}
+
+.table-card >>> .el-card__body {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+}
+
+.clearfix:before,
+.clearfix:after {
+ display: table;
+ content: "";
+}
+.clearfix:after {
+ clear: both;
+}
+
+.el-form-item {
+ margin-bottom: 15px;
+}
+
+.el-table {
+ flex: 1;
+}
+
+.filter-scheme {
+ text-align: center;
+ font-size: 15px;
+ font-weight: bold;
+ color: #fc9393;
+ margin: 10px 0;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/gyMaterial/GyMaterial.vue b/src/views/gyMaterial/GyMaterial.vue
new file mode 100644
index 0000000..090e0d0
--- /dev/null
+++ b/src/views/gyMaterial/GyMaterial.vue
@@ -0,0 +1,1506 @@
+<template>
+ <div style="padding: 10px">
+ <!-- 鎼滅储渚ц竟鏍� -->
+ <el-drawer title="鏌ヨ" :visible.sync="searchOpen" :with-header="false" size="650px">
+ <div style="padding: 50px; width: 630px">
+ <div class="searchText">
+ <div style="font-size: 18px">QUICK SEARCH</div>
+ <div>蹇�熸悳绱�</div>
+ <div class="searchImg"></div>
+ </div>
+ <el-form :model="queryParams" ref="queryForm" label-width="98px">
+ <el-row>
+ <el-form-item label="鐗╂枡浠g爜" prop="HNumber">
+ <el-input
+ v-model="queryParams.HNumber"
+ placeholder="璇疯緭鍏ョ墿鏂欎唬鐮�"
+ @keyup.enter.native="handleQuery"
+ class="ForFilteringSchemes"
+ />
+ </el-form-item>
+ <el-form-item label="鐗╂枡鍚嶇О" prop="HName">
+ <el-input
+ v-model="queryParams.HName"
+ placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"
+ @keyup.enter.native="handleQuery"
+ class="ForFilteringSchemes"
+ />
+ </el-form-item>
+ <el-form-item label="缁勭粐鍚嶇О" prop="HOrgID">
+ <el-select
+ v-model="queryParams.HOrgID"
+ placeholder="璇烽�夋嫨缁勭粐"
+ class="ForFilteringSchemes"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in organizationOptions"
+ :key="item.ID"
+ :label="item.Name"
+ :value="item.ID"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="椤圭洰鍙�" prop="HProject">
+ <el-select
+ v-model="queryParams.HProject"
+ placeholder="璇烽�夋嫨椤圭洰鍙�"
+ class="ForFilteringSchemes"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in projectOptions"
+ :key="item.HName"
+ :label="item.HName"
+ :value="item.HName"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="閲嶆柊鍚屾">
+ <el-input
+ v-model="queryParams.HNumber2"
+ placeholder="璇疯緭鍏ョ墿鏂欎唬鐮�"
+ class="ForFilteringSchemes"
+ style="width: 190px"
+ />
+ <el-button type="primary" @click="handleResCnz" style="margin-left: 10px">閲嶆柊鍚屾</el-button>
+ </el-form-item>
+ <el-form-item label="瑙勬牸鍨嬪彿" prop="HModel">
+ <el-input
+ v-model="queryParams.HModel"
+ placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�"
+ class="ForFilteringSchemes"
+ />
+ </el-form-item>
+ </el-row>
+ <el-card class="box-card">
+ <div slot="header" class="clearfix"><span>杩囨护</span></div>
+ <div>
+ <el-form-item label-width="0">
+ <el-row>
+ <el-col :span="7">
+ <el-select
+ v-model="queryParams.ColName"
+ placeholder="璇烽�夋嫨"
+ class="ForFilteringSchemes"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="(item, index) in visibleColumns"
+ :key="index"
+ :label="item.title"
+ :value="item.field"
+ ></el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="6" style="padding: 0 10px">
+ <el-select
+ v-model="queryParams.Comparator"
+ placeholder="璇烽�夋嫨"
+ class="ForFilteringSchemes"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="(item, index) in comparatorList"
+ :key="index"
+ :label="item.label"
+ :value="item.value"
+ ></el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="11">
+ <el-input
+ v-model="queryParams.ColContent"
+ placeholder="璇疯緭鍏�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ class="ForFilteringSchemes"
+ />
+ </el-col>
+ </el-row>
+ </el-form-item>
+ <el-form-item label-width="0">
+ <el-row>
+ <el-col :span="7">
+ <el-select
+ v-model="queryParams.ColName1"
+ placeholder="璇烽�夋嫨"
+ class="ForFilteringSchemes"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="(item, index) in visibleColumns"
+ :key="index"
+ :label="item.title"
+ :value="item.field"
+ ></el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="6" style="padding: 0 10px">
+ <el-select
+ v-model="queryParams.Comparator1"
+ placeholder="璇烽�夋嫨"
+ class="ForFilteringSchemes"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="(item, index) in comparatorList"
+ :key="index"
+ :label="item.label"
+ :value="item.value"
+ ></el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="11">
+ <el-input
+ v-model="queryParams.ColContent1"
+ placeholder="璇疯緭鍏�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ class="ForFilteringSchemes"
+ />
+ </el-col>
+ </el-row>
+ </el-form-item>
+ <el-form-item label-width="0">
+ <el-row>
+ <el-col :span="7">
+ <el-select
+ v-model="queryParams.ColName2"
+ placeholder="璇烽�夋嫨"
+ class="ForFilteringSchemes"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="(item, index) in visibleColumns"
+ :key="index"
+ :label="item.title"
+ :value="item.field"
+ ></el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="6" style="padding: 0 10px">
+ <el-select
+ v-model="queryParams.Comparator2"
+ placeholder="璇烽�夋嫨"
+ class="ForFilteringSchemes"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="(item, index) in comparatorList"
+ :key="index"
+ :label="item.label"
+ :value="item.value"
+ ></el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="11">
+ <el-input
+ v-model="queryParams.ColContent2"
+ placeholder="璇疯緭鍏�"
+ clearable
+ @keyup.enter.native="handleQuery"
+ class="ForFilteringSchemes"
+ />
+ </el-col>
+ </el-row>
+ </el-form-item>
+ </div>
+ </el-card>
+ <div style="text-align:center;font-size:15px;font-weight:bold;color:#fc9393;margin: 20px 0;">
+ {{ currentFilterScheme }}
+ </div>
+ <el-form-item label-width="78px" style="margin-top: 20px">
+ <el-button type="primary" icon="el-icon-search" @click="handleQuery">
+ 鎼� 绱�</el-button
+ >
+ <el-button icon="el-icon-circle-close" @click="searchOpen = false"
+ >鍙� 娑�</el-button
+ >
+ </el-form-item>
+ </el-form>
+ </div>
+ </el-drawer>
+
+ <!-- 宸ュ叿鏍� -->
+ <el-row :gutter="10" class="mb8">
+ <el-col :span="1.5">
+ <el-button
+ type="warning"
+ plain
+ icon="el-icon-upload2"
+ size="mini"
+ @click="handleImport"
+ >瀵煎叆</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="warning"
+ plain
+ icon="el-icon-download"
+ size="mini"
+ @click="handleExport"
+ >瀵煎嚭</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="primary"
+ plain
+ icon="el-icon-document"
+ size="mini"
+ @click="handleNumAdd"
+ >娴佹按鍙锋柊澧�</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="primary"
+ plain
+ icon="el-icon-plus"
+ size="mini"
+ @click="handleAdd"
+ >鏂板</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="success"
+ plain
+ icon="el-icon-document-copy"
+ size="mini"
+ :disabled="single"
+ @click="handleCopy"
+ >澶嶅埗</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="success"
+ plain
+ icon="el-icon-edit"
+ size="mini"
+ :disabled="single"
+ @click="handleEdit"
+ >缂栬緫</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="danger"
+ plain
+ icon="el-icon-delete"
+ size="mini"
+ :disabled="single"
+ @click="handleDelete"
+ >鍒犻櫎</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="success"
+ plain
+ icon="el-icon-check"
+ size="mini"
+ :disabled="single"
+ @click="handleAudit(0)"
+ >瀹℃牳</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="success"
+ plain
+ icon="el-icon-close"
+ size="mini"
+ :disabled="single"
+ @click="handleAudit(1)"
+ >鍙嶅鏍�</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="warning"
+ plain
+ icon="el-icon-turn-off"
+ size="mini"
+ :disabled="single"
+ @click="handleStop(0)"
+ >绂佺敤</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="warning"
+ plain
+ icon="el-icon-open"
+ size="mini"
+ :disabled="single"
+ @click="handleStop(1)"
+ >鍙嶇鐢�</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="info"
+ plain
+ icon="el-icon-setting"
+ size="mini"
+ @click="handleColumnSetting"
+ >鍒楄缃�</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="info"
+ plain
+ icon="el-icon-s-operation"
+ size="mini"
+ @click="handleButtonSetting"
+ >鎸夐挳璁剧疆</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="primary"
+ plain
+ icon="el-icon-folder-checked"
+ size="mini"
+ @click="handleSaveScheme"
+ >淇濆瓨鏂规</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="primary"
+ plain
+ icon="el-icon-folder-opened"
+ size="mini"
+ @click="handleReadScheme"
+ >璇诲彇鏂规</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="info"
+ plain
+ icon="el-icon-refresh"
+ size="mini"
+ @click="handleRefresh"
+ >鍒锋柊</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="info"
+ plain
+ icon="el-icon-close"
+ size="mini"
+ @click="handleExit"
+ >閫�鍑�</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="primary"
+ plain
+ icon="el-icon-edit"
+ size="mini"
+ @click="handleCorrect"
+ >鎵规敼</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button
+ type="primary"
+ plain
+ icon="el-icon-edit"
+ size="mini"
+ @click="handleCorrect2"
+ >鎵规敼(鏂规2)</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearch"
+ >鎼� 绱�</el-button
+ >
+ </el-col>
+ <el-col :span="1.5">
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+ >閲� 缃�</el-button
+ >
+ </el-col>
+ </el-row>
+
+ <!-- 涓昏鍐呭鍖哄煙 -->
+ <el-row :gutter="10" style="margin-top: 10px">
+ <!-- 宸︿晶鏍戝舰缁撴瀯鍜岃疆鎾浘 -->
+ <el-col :span="6">
+ <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;">
+ <el-tree
+ :data="treeData"
+ :props="treeProps"
+ node-key="id"
+ default-expand-all
+ :expand-on-click-node="false"
+ @node-click="handleTreeNodeClick"
+ :highlight-current="true"
+ class="custom-tree"
+ >
+ <span class="custom-tree-node" slot-scope="{ node, data }">
+ <span>{{ node.label }}</span>
+ </span>
+ </el-tree>
+ </div>
+ <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;"
+ @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%;"
+ />
+ </div>
+ <div v-else class="carousel-item">
+ <h1 style="text-align:center;line-height:180px;color:red;font-weight:bolder;">
+ 鏆傛湭涓婁紶鏂囦欢
+ </h1>
+ </div>
+ </el-carousel-item>
+ </el-carousel>
+ </div>
+ </el-card>
+ </el-col>
+
+ <!-- 鍙充晶琛ㄦ牸 -->
+ <el-col :span="18">
+ <div class="tableBox" v-loading="loading">
+ <el-table
+ :data="tableData"
+ ref="tableData"
+ height="600"
+ @selection-change="handleSelectionChange"
+ border
+ @row-click="handleRowClick"
+ @row-dblclick="handleDblclick"
+ :row-style="rowStyle"
+ v-if="tableShow"
+ >
+ <el-table-column type="selection" width="55" align="center" fixed="left" />
+ <el-table-column prop="hmainid" label="鍗曟嵁ID" v-if="false" />
+ <el-table-column
+ v-for="(item, index) in btList"
+ :key="index"
+ :align="item.align"
+ :prop="item.field"
+ :label="item.title"
+ :width="item.width"
+ v-if="!item.hide"
+ :sortable="item.sort"
+ show-overflow-tooltip
+ :fixed="item.fixed"
+ >
+ <template slot-scope="{ row, column }">
+ <div :style="item.style">
+ <el-button
+ type="text"
+ @click="handleMaterialCodeClick(row)"
+ v-if="column.property === '鐗╂枡浠g爜'"
+ >{{ row[column.property] }}</el-button
+ >
+ <span v-else-if="(column.property || '').includes('鏃堕棿') || (column.property || '').includes('鏃ユ湡')">
+ {{ formatDate(row[column.property]) }}
+ </span>
+ <span v-else>{{ row[column.property] }}</span>
+ </div>
+ </template>
+ </el-table-column>
+ </el-table>
+ <pagination
+ v-show="total > 0"
+ :total="total"
+ :page.sync="page"
+ :limit.sync="pageSize"
+ :pageSizes="pageSizes"
+ @pagination="getList"
+ />
+ </div>
+
+ </el-col>
+ </el-row>
+
+ <el-dialog
+ :visible.sync="previewVisible"
+ width="80%"
+ top="5vh"
+ :before-close="handlePreviewClose"
+ >
+ <img :src="previewImage" style="width: 100%;" />
+ </el-dialog>
+
+ <el-dialog
+ title="闅愯棌鍒楄缃�"
+ :visible.sync="openColumnSetting"
+ width="816px"
+ append-to-body
+ >
+ <RowSettings
+ :colName="btResList"
+ :HModName="HModName"
+ @rowEditClose="columnSettingClose"
+ v-if="columnSettingShow"
+ />
+ </el-dialog>
+
+ <el-dialog
+ :title="editTitle"
+ :visible.sync="openEdit"
+ width="95%"
+ top="2vh"
+ append-to-body
+ class="material-edit-dialog"
+ :before-close="closeEdit"
+ >
+ <MaterialEdit
+ v-if="editShow"
+ :hID="currentEditId"
+ :OperationType="OperationType"
+ :HMaterTypeID="currentMaterTypeID"
+ @close="handleEditClose"
+ />
+ </el-dialog>
+
+
+ <MaterialCorrection
+ :visible.sync="openCorrect"
+ @close="closeCorrect"
+ />
+
+ <el-dialog
+ title="鎵规敼(鏂规2)"
+ :visible.sync="openCorrect2"
+ width="1480px"
+ append-to-body
+ :before-close="closeCorrect2"
+ >
+ <!-- 鎵规敼鏂规2缁勪欢棰勭暀浣嶇疆 -->
+ <div style="text-align: center; padding: 50px;">
+ <h2>鐗╂枡鎵规敼鍔熻兘(鏂规2)</h2>
+ <p>鐗╂枡鎵规敼鍔熻兘(鏂规2)寰呭悗缁紑鍙�</p>
+ <el-button type="primary" @click="closeCorrect2">鍏抽棴</el-button>
+ </div>
+ </el-dialog>
+
+ <el-dialog
+ :title="upload.title"
+ :visible.sync="upload.open"
+ width="1500px"
+ append-to-body
+ >
+ <div style="margin-top: -20px">
+ <el-button type="primary" @click="handleImportSubmit">瀵煎叆鏁版嵁</el-button>
+ <el-button type="primary" @click="upload.open = false">閫� 鍑�</el-button>
+ <el-upload
+ ref="upload"
+ :limit="1"
+ accept=".xlsx, .xls"
+ style="display: inline-block; margin-left: 10px"
+ :action="upload.url + '?updateSupport=' + upload.updateSupport"
+ :disabled="upload.isUploading"
+ :on-progress="handleFileUploadProgress"
+ :on-success="handleFileSuccess"
+ >
+ <el-button type="primary">鏂囦欢涓婁紶</el-button>
+ </el-upload>
+ </div>
+ <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" />
+ <el-table-column label="鐗╂枡鍒嗙被" prop="鐗╂枡鍒嗙被" align="center" width="120" />
+ <el-table-column label="鎿嶄綔" align="center">
+ <template slot-scope="scope">
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-delete"
+ @click="uploadDataDelete(scope.$index)"
+ >鍒犻櫎</el-button
+ >
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import axios from "axios";
+import RowSettings from "@/views/component/rowSettings";
+import MaterialEdit from "@/views/gyMaterial/edit";
+import MaterialCorrection from "@/views/gyMaterial/GyMaterialCorrection";
+
+export default {
+ name: "GyMaterial",
+ components: { RowSettings,MaterialEdit,MaterialCorrection },
+ props: {
+ openPage: { type: String },
+ },
+ data() {
+ return {
+ HModName: "Gy_Material",
+ HModuleName: "鐗╂枡鍒楄〃缁存姢",
+ HClassTag: "ForFilteringSchemes",
+
+ // 鎼滅储渚ц竟鏍�
+ searchOpen: false,
+
+ // 鏍戝舰鏁版嵁
+ treeData: [],
+ treeProps: {
+ children: 'children',
+ label: 'title'
+ },
+ currentMaterTypeID: 0,
+
+ // 杞挱鍥炬暟鎹�
+ fileList: [
+ {
+ type: 'empty',
+ url: '',
+ name: '鏆傛棤鏂囦欢'
+ }
+ ],
+
+ // 缂栬緫鐩稿叧
+ editShow: false,
+ openEdit: false,
+ OperationType: null,
+ editTitle: "缂栬緫鐗╂枡",
+ currentEditId: 0,
+
+ // 鎵规敼鐩稿叧
+ openCorrect: false,
+ openCorrect2: false,
+
+ // 鍒楄缃�
+ columnSettingShow: false,
+ openColumnSetting: false,
+
+ // 鍥剧墖棰勮
+ previewVisible: false,
+ previewImage: '',
+
+ // 琛ㄦ牸鏄剧ず
+ tableShow: true,
+ loading: true,
+
+ // 鏌ヨ鍙傛暟
+ queryParams: {
+ HNumber: null,
+ HName: null,
+ HNumber2: null,
+ HModel: null,
+ HOrgID: null,
+ HProject: null,
+ ColName: "0",
+ ColName1: "0",
+ ColName2: "0",
+ Comparator: "0",
+ Comparator1: "0",
+ Comparator2: "0",
+ ColContent: "",
+ ColContent1: "",
+ ColContent2: "",
+ },
+
+ // 缁勭粐閫夐」
+ organizationOptions: [],
+
+ // 椤圭洰鍙烽�夐」
+ projectOptions: [],
+
+ // 杩囨护鏂规
+ currentFilterScheme: "",
+ HInterID_Choose: 0,
+
+ // 姣旇緝鍣ㄥ垪琛�
+ comparatorList: [
+ { label: "=", value: "=" },
+ { label: ">=", value: ">=" },
+ { label: ">", value: ">" },
+ { label: "<=", value: "<=" },
+ { label: "<", value: "<" },
+ { label: "<>", value: "<>" },
+ { label: "鍖呭惈", value: "7" },
+ { label: "宸﹀寘鍚�", value: "8" },
+ { label: "鍙冲寘鍚�", value: "9" },
+ { label: "涓嶅寘鍚�", value: "10" },
+ ],
+
+ // 琛ㄦ牸鏁版嵁
+ sWhere: "",
+ selectedRow: null,
+ ids: [],
+ single: true,
+ multiple: true,
+ tyResList: [],
+ btList: [],
+ btResList: [],
+ tableData: [],
+ pageSizes: [50, 100, 500, 5000, 50000],
+ page: 1,
+ pageSize: 50,
+ total: 0,
+
+ // 瀵煎叆鐩稿叧
+ upload: {
+ open: false,
+ title: "瀵煎叆",
+ isUploading: false,
+ updateSupport: 0,
+ url: "http://47.96.97.237/API/Gy_Material/Gy_Material_Excel",
+ },
+ uploadData: [],
+ uploadTableLoading: false,
+
+ baseURL: process.env.VUE_APP_BASE_URL || "http://47.96.97.237/API/",
+ user: "admin",
+ };
+ },
+ computed: {
+ visibleColumns() {
+ return this.btList.filter(item => !item.hide && item.field);
+ }
+ },
+ created() {
+ 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.getTreeData();
+ this.getProjectOptions();
+ this.getList();
+ this.getDefaultFilterScheme();
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ // 鑾峰彇缁勭粐鍒楄〃
+ getOrganizations() {
+ axios
+ .get(this.baseURL + "/Web/GetOrganizations")
+ .then((response) => {
+ if (response.data.count == 1) {
+ this.organizationOptions = response.data.data;
+ // 璁剧疆榛樿缁勭粐
+ if (this.organizationOptions.length > 0) {
+ this.queryParams.HOrgID = this.organizationOptions[0].ID;
+ }
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ // 鑾峰彇鏍戝舰鏁版嵁
+ getTreeData() {
+ axios
+ .get(this.baseURL + "/Gy_MaterType/Gy_MaterTypeTreeListByLevel",{
+ params: {
+ HOrgID: '100038'
+ }
+ })
+ .then((response) => {
+ if (response.data.count == 1) {
+ this.treeData = JSON.parse(response.data.data);
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ // 鑾峰彇椤圭洰鍙烽�夐」
+ getProjectOptions() {
+ axios
+ .get(this.baseURL + "/Gy_Material/Get_HProject", {
+ params: {
+ HOrgID: this.queryParams.HOrgID
+ }
+ })
+ .then((response) => {
+ if (response.data.count == 1) {
+ this.projectOptions = response.data.data;
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ // 鑾峰彇鍒楄〃鏁版嵁
+ getList() {
+ this.tableShow = false;
+ this.loading = true;
+ // console.log(this.sWhere);
+ // console.log(this.user);
+ // console.log(this.page);
+ // console.log(this.pageSize);
+ // console.log(this.this.queryParams.HOrgID);
+ axios
+ .get(this.baseURL + "/Gy_Material/page", {
+ params: {
+ sWhere: this.sWhere,
+ user: this.user,
+ page: this.page,
+ size: this.pageSize,
+ Organization: ''
+ },
+ })
+ .then((response) => {
+ let data1 = response.data;
+ if (data1.code == 1) {
+ this.tyResList = data1.data;
+ this.btResList = data1.data;
+ this.total = data1.count;
+ this.setDefaultColumns();
+ this.tableData = data1.data;
+ this.tableShow = true;
+ this.loading = false;
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ 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 }
+ ];
+ },
+
+ // 鏍戣妭鐐圭偣鍑�
+ handleTreeNodeClick(data) {
+ this.currentMaterTypeID = data.id;
+
+ if (data.id == "100") {
+ this.sWhere = " and HMaterTypeID= 0";
+ } else if (data.id == "0") {
+ this.sWhere = "";
+ } else {
+ this.sWhere = " and HMaterTypeID='" + data.id + "' ";
+ }
+ this.getList();
+ },
+
+ // 鎵撳紑鎼滅储渚ц竟鏍�
+ handleSearch() {
+ this.searchOpen = true;
+ },
+
+ // 鏌ヨ
+ async handleQuery() {
+ this.sWhere = "";
+
+ // 澶勭悊杩囨护鏉′欢
+ this.processFilterConditions();
+
+ // 澶勭悊鍩烘湰鏌ヨ鏉′欢
+ if (this.queryParams.HNumber) {
+ this.sWhere += " and 鐗╂枡浠g爜 like '%" + this.queryParams.HNumber + "%'";
+ }
+ if (this.queryParams.HName) {
+ this.sWhere += " and 鐗╂枡鍚嶇О like '%" + this.queryParams.HName + "%'";
+ }
+ if (this.queryParams.HModel) {
+ this.sWhere += " and 瑙勬牸鍨嬪彿 like '%" + this.queryParams.HModel + "%'";
+ }
+ if (this.queryParams.HProject) {
+ this.sWhere += " and 椤圭洰鍙� like '%" + this.queryParams.HProject + "%'";
+ }
+
+ this.searchOpen = false;
+ 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 }
+ ];
+
+ conditions.forEach(condition => {
+ if (condition.colName && condition.colName !== "0" && condition.comparator && condition.comparator !== "0") {
+ let com = "";
+ switch (condition.comparator) {
+ case "7":
+ com = "like'%" + condition.content + "%'";
+ break;
+ case "8":
+ com = "like'%" + condition.content + "'";
+ break;
+ case "9":
+ com = "like'" + condition.content + "%'";
+ break;
+ case "10":
+ com = "not like'%" + condition.content + "%'";
+ break;
+ default:
+ com = "" + condition.comparator + "'" + condition.content + "'";
+ break;
+ }
+ this.sWhere += " and " + condition.colName + " " + com;
+ }
+ });
+ },
+
+ // 閲嶇疆鏌ヨ
+ resetQuery() {
+ this.sWhere = "";
+ this.queryParams = {
+ HNumber: null,
+ HName: null,
+ HNumber2: null,
+ HModel: null,
+ HOrgID: this.organizationOptions.length > 0 ? this.organizationOptions[0].ID : null,
+ HProject: null,
+ ColName: "0",
+ ColName1: "0",
+ ColName2: "0",
+ Comparator: "0",
+ Comparator1: "0",
+ Comparator2: "0",
+ ColContent: "",
+ ColContent1: "",
+ ColContent2: "",
+ };
+ this.getList();
+ },
+
+ // 閲嶆柊鍚屾
+ handleResCnz() {
+ if (!this.queryParams.HNumber2) {
+ this.$modal.msgWarning("璇疯緭鍏ョ墿鏂欎唬鐮�");
+ return;
+ }
+
+ axios
+ .get(this.baseURL + "/Gy_Material/Gy_MaterialViewApi", {
+ params: {
+ Number: this.queryParams.HNumber2,
+ Type: 'WL'
+ }
+ })
+ .then((response) => {
+ if (response.data.count == 1) {
+ this.$modal.msgSuccess(response.data.Message);
+ this.getList();
+ } else {
+ this.$modal.msgError(response.data.Message);
+ }
+ })
+ .catch((error) => {
+ 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
+ }
+ })
+ .then((response) => {
+ if (response.data.count == 1) {
+ const ws = this.$XLSX.utils.json_to_sheet(this.tyResList);
+ const wb = this.$XLSX.utils.book_new();
+ this.$XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
+ this.$XLSX.writeFile(wb, `Gy_Material_${new Date().getTime()}.xlsx`);
+ } else {
+ this.$modal.msgError("褰撳墠妯″潡娌℃湁瀵煎嚭鏉冮檺!");
+ }
+ })
+ .catch((error) => {
+ 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;
+ },
+
+ handleCopy() {
+ 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;
+ },
+
+ handleDelete() {
+ if (this.single) {
+ this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
+ return;
+ }
+
+ if (this.selectedRow.瀹℃牳浜� !== null && this.selectedRow.瀹℃牳浜� !== '') {
+ this.$modal.msgError("宸茶瀹℃牳鐨勭墿鏂欎笉鑳借鍒犻櫎!");
+ return;
+ }
+
+ this.$modal
+ .confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠")
+ .then(() => {
+ axios
+ .get(this.baseURL + "/Gy_Material/Delete", {
+ params: {
+ HItemID: this.selectedRow.HItemID,
+ user: this.user
+ }
+ })
+ .then((response) => {
+ if (response.data.count == 1) {
+ this.getList();
+ this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ } else {
+ this.$modal.msgError("閿欒:" + response.data.code + response.data.Message);
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ })
+ .catch(() => {});
+ },
+
+ handleAudit(isAudit) {
+ if (this.single) {
+ this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
+ return;
+ }
+
+ axios
+ .get(this.baseURL + "/Gy_Material/AuditGy_Material", {
+ params: {
+ HInterID: this.selectedRow.HItemID,
+ IsAudit: isAudit,
+ CurUserName: this.user
+ }
+ })
+ .then((response) => {
+ if (response.data.count == 1) {
+ this.getList();
+ this.$modal.msgSuccess(response.data.Message);
+ } else {
+ this.$modal.msgError(response.data.Message);
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ handleStop(isStop) {
+ if (this.single) {
+ this.$modal.msgWarning("璇烽�夋嫨涓�鏉℃暟鎹�");
+ return;
+ }
+ axios
+ .get(this.baseURL + "/Gy_Material/StopGy_Material", {
+ params: {
+ HInterID: this.selectedRow.HItemID,
+ IsStop: isStop,
+ CurUserName: this.user
+ }
+ })
+ .then((response) => {
+ if (response.data.count == 1) {
+ this.getList();
+ this.$modal.msgSuccess(response.data.Message);
+ } else {
+ this.$modal.msgError(response.data.Message);
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ handleColumnSetting() {
+ this.columnSettingShow = true;
+ this.openColumnSetting = true;
+ },
+
+ handleButtonSetting() {
+ this.$modal.msgInfo("鎸夐挳璁剧疆鍔熻兘");
+ },
+
+ handleSaveScheme() {
+ this.$modal.msgInfo("淇濆瓨鏂规鍔熻兘");
+ },
+
+ handleReadScheme() {
+ this.$modal.msgInfo("璇诲彇鏂规鍔熻兘");
+ },
+
+ handleRefresh() {
+ this.getList();
+ },
+
+ 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;
+ },
+
+ // 琛岀偣鍑�
+ handleRowClick(row, column, event) {
+ this.$refs.tableData.toggleRowSelection(row);
+ this.selectedRow = row;
+ this.getFileList(row.鐗╂枡浠g爜);
+ },
+
+ // 鑾峰彇鏂囦欢鍒楄〃
+ getFileList(HMaterNumber) {
+ if (!HMaterNumber) return;
+
+ axios
+ .get(this.baseURL + "/Cj_StationOutBill/Filelist", {
+ 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: '鏆傛棤鏂囦欢'
+ });
+ } else {
+ data.forEach(item => {
+ if (item.HFileType === '.jpeg' || item.HFileType === '.jpg') {
+ this.fileList.push({
+ type: 'image',
+ url: `../../..${item.HFilePath}`,
+ name: item.HFileName
+ });
+ } else if (item.HFileType === '.pdf') {
+ this.fileList.push({
+ type: 'pdf',
+ url: `../../..${item.HFilePath}`,
+ name: item.HFileName
+ });
+ }
+ });
+ }
+ }
+ })
+ .catch((error) => {
+ this.$modal.msgError("鑾峰彇鏂囦欢鍒楄〃澶辫触!");
+ });
+ },
+
+ // 鍥剧墖棰勮
+ previewImg(url) {
+ this.previewImage = url;
+ this.previewVisible = true;
+ },
+
+ handlePreviewClose() {
+ this.previewVisible = false;
+ this.previewImage = '';
+ },
+
+ // 琛屾牱寮�
+ rowStyle({ row, rowIndex }) {
+ if (this.ids.includes(row.hmainid)) {
+ return { background: "#ecf5ff" };
+ }
+ },
+
+ // 鍙屽嚮琛�
+ handleDblclick(row, column, cell, event) {
+ this.handleMaterialCodeClick(row);
+ },
+
+ // 閫夋嫨鍙樺寲
+ handleSelectionChange(selection) {
+ this.ids = selection.map((item) => item.hmainid);
+ this.single = selection.length != 1;
+ this.multiple = !selection.length;
+ if (!this.single) {
+ this.selectedRow = selection[0];
+ }
+ },
+ // 缂栬緫鍏抽棴鍥炶皟
+ handleEditClose() {
+ this.openEdit = false;
+ this.editShow = false;
+ this.getList(); // 鍒锋柊鍒楄〃
+ },
+ // 鍏抽棴缂栬緫
+ 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();
+ },
+
+ // 瀵煎叆鐩稿叧鏂规硶
+ handleFileUploadProgress(event, file, fileList) {
+ this.upload.isUploading = true;
+ this.uploadTableLoading = true;
+ },
+
+ handleFileSuccess(response, file, fileList) {
+ this.upload.isUploading = true;
+ this.$refs.upload.clearFiles();
+ if (response.code == 1) {
+ this.uploadData = response.data;
+ this.uploadTableLoading = false;
+ } else {
+ this.$alert(
+ "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+ response.Message +
+ "</div>",
+ "瀵煎叆缁撴灉",
+ { dangerouslyUseHTMLString: true }
+ );
+ }
+ },
+
+ handleImportSubmit() {
+ if (this.uploadData.length === 0) {
+ this.$modal.msgWarning("璇峰厛涓婁紶鏂囦欢");
+ return;
+ }
+
+ var sMainSub = JSON.stringify(this.uploadData) + "&鍜�" + this.user;
+ axios({
+ method: "post",
+ url: this.baseURL + "/Gy_Material/Gy_Material_btnSave",
+ data: {
+ sMainSub: sMainSub,
+ },
+ })
+ .then((res) => {
+ this.$alert(
+ "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+ res.data.Message +
+ "</div>",
+ "瀵煎叆缁撴灉",
+ { dangerouslyUseHTMLString: true }
+ );
+ this.upload.open = false;
+ this.getList();
+ })
+ .catch((error) => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ uploadDataDelete(index) {
+ this.uploadData.splice(index, 1);
+ },
+
+ // 宸ュ叿鏂规硶
+ formatDate(dateString) {
+ if (!dateString) return '';
+ const date = new Date(dateString);
+ 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) {
+ return true;
+ } else {
+ return false;
+ }
+ },
+
+ getDefaultFilterScheme() {
+ // 鑾峰彇榛樿杩囨护鏂规鐨勫疄鐜�
+ this.currentFilterScheme = "褰撳墠杩囨护鏂规锛氶粯璁ゆ柟妗�";
+ }
+ },
+};
+</script>
+
+<style scoped>
+.searchText {
+ text-align: center;
+ margin-bottom: 30px;
+}
+
+.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;
+ margin-top: 10px;
+}
+
+.custom-tree-node {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 14px;
+ padding-right: 8px;
+}
+
+.custom-tree {
+ height: 100%;
+ overflow-y: auto;
+}
+
+.carousel-item {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.materialBox .el-date-editor.el-input {
+ width: 100%;
+}
+
+/* 鏍戠姸鍥剧偣鍑婚珮浜彉鑹� */
+.el-tree-node.is-current > .el-tree-node__content {
+ background-color: #aef0f7;
+}
+
+.box-card {
+ margin-top: 20px;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/gyMaterial/GyMaterialCorrection.vue b/src/views/gyMaterial/GyMaterialCorrection.vue
new file mode 100644
index 0000000..2b20ba1
--- /dev/null
+++ b/src/views/gyMaterial/GyMaterialCorrection.vue
@@ -0,0 +1,913 @@
+<template>
+ <div class="material-correction">
+ <!-- 鎵规敼瀵硅瘽妗� -->
+ <el-dialog
+ title="鐗╂枡鎵规敼"
+ :visible.sync="openCorrect"
+ width="95%"
+ top="2vh"
+ append-to-body
+ class="material-correction-dialog"
+ :before-close="handleClose"
+ >
+ <div class="correction-container">
+ <!-- 鎼滅储鏉′欢鍖哄煙 -->
+ <el-card class="search-card">
+ <div slot="header" class="clearfix">
+ <span>鏌ヨ鏉′欢</span>
+ <el-button
+ style="float: right; padding: 3px 0"
+ type="text"
+ @click="toggleSearchMore"
+ >
+ {{ searchMore ? '鏀惰捣' : '鏇村' }}
+ </el-button>
+ </div>
+
+ <el-form :model="queryParams" ref="queryForm" label-width="80px">
+ <el-row :gutter="20">
+ <el-col :span="6">
+ <el-form-item label="鐗╂枡浠g爜">
+ <el-input
+ v-model="queryParams.HNumber"
+ placeholder="璇疯緭鍏ョ墿鏂欎唬鐮�"
+ @keyup.enter.native="handleSearch"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="鐗╂枡鍚嶇О">
+ <el-input
+ v-model="queryParams.HName"
+ placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"
+ @keyup.enter.native="handleSearch"
+ />
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="缁勭粐">
+ <el-select
+ v-model="queryParams.HOrgID"
+ placeholder="璇烽�夋嫨缁勭粐"
+ style="width: 100%"
+ >
+ <el-option
+ v-for="item in organizationOptions"
+ :key="item.ID"
+ :label="item.Name"
+ :value="item.ID"
+ />
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item>
+ <el-button type="primary" @click="handleSearch">鏌ヨ</el-button>
+ <el-button @click="resetQuery">閲嶇疆</el-button>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 鏇村鎼滅储鏉′欢 -->
+ <div v-show="searchMore">
+ <el-divider></el-divider>
+ <div class="filter-conditions">
+ <div class="filter-group" v-for="(filter, index) in filterConditions" :key="index">
+ <el-row :gutter="10">
+ <el-col :span="8">
+ <el-select
+ v-model="filter.colName"
+ placeholder="閫夋嫨鍒�"
+ style="width: 100%"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option
+ v-for="col in visibleColumns"
+ :key="col.field"
+ :label="col.title"
+ :value="col.field"
+ />
+ </el-select>
+ </el-col>
+ <el-col :span="6">
+ <el-select
+ v-model="filter.comparator"
+ placeholder="姣旇緝绗�"
+ style="width: 100%"
+ >
+ <el-option value="0" label=""></el-option>
+ <el-option value="=" label="="></el-option>
+ <el-option value=">=" label=">="></el-option>
+ <el-option value=">" label=">"></el-option>
+ <el-option value="<=" label="<="></el-option>
+ <el-option value="<" label="<"></el-option>
+ <el-option value="<>" label="<>"></el-option>
+ <el-option value="7" label="鍖呭惈"></el-option>
+ <el-option value="8" label="宸﹀寘鍚�"></el-option>
+ <el-option value="9" label="鍙冲寘鍚�"></el-option>
+ <el-option value="10" label="涓嶅寘鍚�"></el-option>
+ </el-select>
+ </el-col>
+ <el-col :span="8">
+ <el-input
+ v-model="filter.colContent"
+ placeholder="璇疯緭鍏ュ唴瀹�"
+ @keyup.enter.native="handleSearch"
+ />
+ </el-col>
+ <el-col :span="2">
+ <el-button
+ type="danger"
+ icon="el-icon-delete"
+ circle
+ @click="removeFilter(index)"
+ v-if="filterConditions.length > 1"
+ ></el-button>
+ </el-col>
+ </el-row>
+ </div>
+
+ <el-button
+ type="primary"
+ icon="el-icon-plus"
+ @click="addFilter"
+ style="margin-top: 10px;"
+ >
+ 娣诲姞杩囨护鏉′欢
+ </el-button>
+ </div>
+ </div>
+ </el-form>
+ </el-card>
+
+ <!-- 涓昏鍐呭鍖哄煙 -->
+ <div class="main-content">
+ <!-- 宸︿晶涓昏〃鏍� -->
+ <div class="table-section left-table">
+ <div class="table-header">
+ <span>鐗╂枡鍒楄〃</span>
+ <div class="table-actions">
+ <el-button
+ type="danger"
+ icon="el-icon-delete"
+ size="mini"
+ @click="handleDelete"
+ :disabled="selectedRows.length === 0"
+ >
+ 鍒犻櫎
+ </el-button>
+ <el-button
+ type="success"
+ icon="el-icon-check"
+ size="mini"
+ @click="handleDataConfirm"
+ :disabled="selectedRows.length === 0"
+ >
+ 鏁版嵁纭
+ </el-button>
+ <el-button
+ type="info"
+ icon="el-icon-setting"
+ size="mini"
+ @click="handleColumnSetting"
+ >
+ 鍒楄缃�
+ </el-button>
+ </div>
+ </div>
+
+ <div class="table-container">
+ <el-table
+ ref="mainTable"
+ :data="tableData"
+ height="500"
+ @selection-change="handleSelectionChange"
+ border
+ v-loading="loading"
+ :row-class-name="getRowClassName"
+ >
+ <el-table-column type="selection" width="55" align="center"></el-table-column>
+ <el-table-column
+ v-for="column in mainTableColumns"
+ :key="column.field"
+ :prop="column.field"
+ :label="column.title"
+ :width="column.width"
+ :align="column.align || 'center'"
+ :show-overflow-tooltip="true"
+ >
+ <template slot-scope="{ row }">
+ <span v-if="isDateColumn(column.field)">
+ {{ formatDate(row[column.field]) }}
+ </span>
+ <span v-else>{{ row[column.field] }}</span>
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <!-- 鍒嗛〉 -->
+ <div class="pagination-container">
+ <el-pagination
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ :current-page="pagination.page"
+ :page-sizes="[50, 100, 500, 1000]"
+ :page-size="pagination.size"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="pagination.total"
+ >
+ </el-pagination>
+ </div>
+ </div>
+ </div>
+
+ <!-- 鍙充晶涓存椂琛ㄦ牸 -->
+ <div class="table-section right-table">
+ <div class="table-header">
+ <span>鎵规敼鏁版嵁</span>
+ <div class="table-actions">
+ <el-button
+ type="primary"
+ icon="el-icon-upload"
+ size="mini"
+ @click="handleSave"
+ :disabled="tempTableData.length === 0"
+ >
+ 淇濆瓨
+ </el-button>
+ <el-button
+ type="info"
+ icon="el-icon-close"
+ size="mini"
+ @click="handleExit"
+ >
+ 閫�鍑�
+ </el-button>
+ </div>
+ </div>
+
+ <div class="table-container">
+ <el-table
+ ref="tempTable"
+ :data="tempTableData"
+ height="500"
+ border
+ v-loading="tempLoading"
+ >
+ <el-table-column
+ v-for="column in tempTableColumns"
+ :key="column.field"
+ :prop="column.field"
+ :label="column.title"
+ :width="column.width"
+ :align="column.align || 'center'"
+ >
+ <template slot-scope="{ row, $index }">
+ <!-- 鍙紪杈戠殑鏂囨湰瀛楁 -->
+ <el-input
+ v-if="isEditableColumn(column.field) && !isSelectColumn(column.field)"
+ v-model="row[column.field]"
+ size="mini"
+ @change="handleCellEdit(row, column.field, $index)"
+ />
+
+ <!-- 涓嬫媺閫夋嫨妗� - 鐗╂枡灞炴�� -->
+ <el-select
+ v-else-if="column.field === '鐗╂枡灞炴��'"
+ v-model="row[column.field]"
+ size="mini"
+ style="width: 100%"
+ @change="handleSelectChange(column.field)"
+ >
+ <el-option value="澶栬喘" label="澶栬喘"></el-option>
+ <el-option value="鑷埗" label="鑷埗"></el-option>
+ <el-option value="濮斿" label="濮斿"></el-option>
+ </el-select>
+
+ <!-- 涓嬫媺閫夋嫨妗� - 浜嬩笟閮� -->
+ <el-select
+ v-else-if="column.field === '浜嬩笟閮�'"
+ v-model="row[column.field]"
+ size="mini"
+ style="width: 100%"
+ @change="handleSelectChange(column.field)"
+ >
+ <el-option value="娉ㄥ浜嬩笟閮�" label="娉ㄥ浜嬩笟閮�"></el-option>
+ <el-option value="杞浜嬩笟閮�" label="杞浜嬩笟閮�"></el-option>
+ <el-option value="鍏朵粬浜嬩笟閮�" label="鍏朵粬浜嬩笟閮�"></el-option>
+ </el-select>
+
+ <!-- 涓嶅彲缂栬緫瀛楁 -->
+ <span v-else>{{ row[column.field] }}</span>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </div>
+ </div>
+ </div>
+ </el-dialog>
+
+ <el-dialog
+ title="闅愯棌鍒楄缃�"
+ :visible.sync="openColumnSetting"
+ width="816px"
+ append-to-body
+ >
+ <RowSettings
+ :colName="btResList"
+ :HModName="HModName"
+ @rowEditClose="columnSettingClose"
+ v-if="columnSettingShow"
+ />
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import axios from 'axios'
+import RowSettings from '@/views/component/rowSettings'
+
+
+export default {
+ name: 'MaterialCorrection',
+ components: {
+ RowSettings
+ },
+ props: {
+ visible: {
+ type: Boolean,
+ default: false
+ }
+ },
+ data() {
+ return {
+ openCorrect: false,
+ searchMore: false,
+ loading: false,
+ tempLoading: false,
+ columnSettingVisible: false,
+
+ // 鏌ヨ鍙傛暟
+ queryParams: {
+ HNumber: '',
+ HName: '',
+ HOrgID: ''
+ },
+
+ // 杩囨护鏉′欢
+ filterConditions: [
+ { colName: '0', comparator: '0', colContent: '' }
+ ],
+
+ // 缁勭粐閫夐」
+ organizationOptions: [],
+
+ // 琛ㄦ牸鏁版嵁
+ tableData: [],
+ tempTableData: [],
+ selectedRows: [],
+
+ // 鍒嗛〉
+ pagination: {
+ page: 1,
+ size: 50,
+ total: 0
+ },
+
+ // 鍒楅厤缃�
+ allColumns: [],
+ mainTableColumns: [],
+ tempTableColumns: [],
+ // 鍒楄缃�
+ columnSettingShow: false,
+ openColumnSetting: false,
+ // 妯″潡鍚嶇О
+ HModName: 'Gy_Material_Correction',
+
+ baseURL: process.env.VUE_APP_BASE_URL || 'http://47.96.97.237/API/',
+ user: 'admin'
+ }
+ },
+ computed: {
+ visibleColumns() {
+ return this.allColumns.filter(col => !col.hide)
+ }
+ },
+ watch: {
+ visible: {
+ immediate: true,
+ handler(newVal) {
+ this.openCorrect = newVal
+ if (newVal) {
+ this.initData()
+ }
+ }
+ },
+ openCorrect(newVal) {
+ this.$emit('update:visible', newVal)
+ }
+ },
+ methods: {
+ // 鍒濆鍖栨暟鎹�
+ async initData() {
+ await this.getOrganizations()
+ await this.getTableData()
+ },
+
+ // 鑾峰彇缁勭粐鍒楄〃
+ async getOrganizations() {
+ try {
+ const response = await axios.get(`${this.baseURL}/Web/GetOrganizations`)
+ if (response.data.count === 1) {
+ this.organizationOptions = response.data.data
+ if (this.organizationOptions.length > 0) {
+ this.queryParams.HOrgID = this.organizationOptions[0].ID
+ }
+ }
+ } catch (error) {
+ this.$modal.msgError('鑾峰彇缁勭粐鍒楄〃澶辫触!')
+ }
+ },
+
+
+
+ // 璁剧疆榛樿鍒�
+ setDefaultColumns() {
+ this.allColumns = [
+ { field: 'HItemID', title: '鐗╂枡ID', hide: true },
+ { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', width: 120 },
+ { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', width: 150 },
+ { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 120 },
+ { field: '鐗╂枡灞炴��', title: '鐗╂枡灞炴��', width: 100 },
+ { field: '浜嬩笟閮�', title: '浜嬩笟閮�', width: 120 },
+ { field: '缁勭粐鍚嶇О', title: '缁勭粐鍚嶇О', width: 120 },
+ { field: '榛樿浠撳簱', title: '榛樿浠撳簱', width: 120 },
+ { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅', width: 100 },
+ { field: '鍩烘湰璁¢噺鍗曚綅', title: '鍩烘湰璁¢噺鍗曚綅', width: 120 },
+ { field: '鐗╂枡鍒嗙被', title: '鐗╂枡鍒嗙被', width: 120 },
+ { field: '鏁伴噺绮惧害', title: '鏁伴噺绮惧害', width: 100 },
+ { field: '鍗曚环绮惧害', title: '鍗曚环绮惧害', width: 100 },
+ { field: '閲戦绮惧害', title: '閲戦绮惧害', width: 100 },
+ { field: '榛樿绋庣巼', title: '榛樿绋庣巼', width: 100 },
+ { field: '榛樿鍒╂鼎鐜�', title: '榛樿鍒╂鼎鐜�', width: 100 },
+ { field: '鍏嬮噸', title: '鍏嬮噸', width: 100 },
+ { field: '骞呭', title: '骞呭', width: 100 },
+ { field: '鏌撹壊瑕佹眰', title: '鏌撹壊瑕佹眰', width: 120 },
+ { field: '澶囨敞', title: '澶囨敞', width: 150 },
+ { field: '瀹℃牳浜�', title: '瀹℃牳浜�', width: 100 },
+ { field: '鍒涘缓浜�', title: '鍒涘缓浜�', width: 100 },
+ { field: '鍒涘缓鏃堕棿', title: '鍒涘缓鏃堕棿', width: 150 }
+ ]
+
+ this.mainTableColumns = this.allColumns.filter(col => !col.hide)
+ this.tempTableColumns = this.mainTableColumns.map(col => ({
+ ...col,
+ editable: this.isEditableColumn(col.field)
+ }))
+ },
+
+ // 鑾峰彇琛ㄦ牸鏁版嵁
+ async getTableData() {
+ this.loading = true
+ try {
+ const sWhere = this.buildWhereCondition()
+
+ const response = await axios.get(`${this.baseURL}/Gy_Material/page`, {
+ params: {
+ sWhere: sWhere,
+ user: this.user,
+ page: this.pagination.page,
+ size: this.pagination.size,
+ Organization: ''
+ }
+ })
+
+ if (response.data.code === 1) {
+ this.tableData = response.data.data
+ this.pagination.total = response.data.count
+ } else {
+ this.$modal.msgError(response.data.Message)
+ }
+ } catch (error) {
+ this.$modal.msgError('鑾峰彇鏁版嵁澶辫触!')
+ } finally {
+ this.loading = false
+ }
+ },
+
+ // 鏋勫缓鏌ヨ鏉′欢
+ buildWhereCondition() {
+ let sWhere = ''
+
+ // 鍩烘湰鏌ヨ鏉′欢
+ if (this.queryParams.HNumber) {
+ sWhere += ` and 鐗╂枡浠g爜 like '%${this.queryParams.HNumber}%'`
+ }
+ if (this.queryParams.HName) {
+ sWhere += ` and 鐗╂枡鍚嶇О like '%${this.queryParams.HName}%'`
+ }
+ if (this.queryParams.HOrgID) {
+ sWhere += ` and HUSEORGID = '${this.queryParams.HOrgID}'`
+ }
+
+ // 杩囨护鏉′欢
+ this.filterConditions.forEach(filter => {
+ if (filter.colName && filter.colName !== '0' && filter.comparator && filter.comparator !== '0') {
+ let condition = ''
+ switch (filter.comparator) {
+ case '7': // 鍖呭惈
+ condition = `like '%${filter.colContent}%'`
+ break
+ case '8': // 宸﹀寘鍚�
+ condition = `like '%${filter.colContent}'`
+ break
+ case '9': // 鍙冲寘鍚�
+ condition = `like '${filter.colContent}%'`
+ break
+ case '10': // 涓嶅寘鍚�
+ condition = `not like '%${filter.colContent}%'`
+ break
+ default:
+ condition = `${filter.comparator} '${filter.colContent}'`
+ }
+ sWhere += ` and ${filter.colName} ${condition}`
+ }
+ })
+
+ return sWhere
+ },
+
+ // 鏌ヨ
+ handleSearch() {
+ this.pagination.page = 1
+ this.getTableData()
+ },
+
+ handleColumnSetting() {
+ this.columnSettingShow = true;
+ this.openColumnSetting = true;
+ },
+ // 鍒楄缃叧闂�
+ columnSettingClose(val) {
+ this.columnSettingShow = false;
+ this.openColumnSetting = val;
+ this.getList();
+ },
+
+ // 閲嶇疆鏌ヨ
+ resetQuery() {
+ this.queryParams = {
+ HNumber: '',
+ HName: '',
+ HOrgID: this.organizationOptions.length > 0 ? this.organizationOptions[0].ID : ''
+ }
+ this.filterConditions = [
+ { colName: '0', comparator: '0', colContent: '' }
+ ]
+ this.pagination.page = 1
+ this.getTableData()
+ },
+
+ // 娣诲姞杩囨护鏉′欢
+ addFilter() {
+ this.filterConditions.push({
+ colName: '0',
+ comparator: '0',
+ colContent: ''
+ })
+ },
+
+ // 鍒犻櫎杩囨护鏉′欢
+ removeFilter(index) {
+ this.filterConditions.splice(index, 1)
+ },
+
+ // 鍒囨崲鏇村鎼滅储鏉′欢
+ toggleSearchMore() {
+ this.searchMore = !this.searchMore
+ },
+
+ // 閫夋嫨琛屽彉鍖�
+ handleSelectionChange(selection) {
+ this.selectedRows = selection
+ },
+
+ // 鏁版嵁纭 - 灏嗛�変腑鐨勬暟鎹鍒跺埌涓存椂琛ㄦ牸
+ handleDataConfirm() {
+ if (this.selectedRows.length === 0) {
+ this.$modal.msgWarning('璇峰厛閫夋嫨瑕佹壒鏀圭殑鏁版嵁!')
+ return
+ }
+
+ // 娣辨嫹璐濋�変腑鐨勬暟鎹埌涓存椂琛ㄦ牸
+ this.tempTableData = JSON.parse(JSON.stringify(this.selectedRows))
+
+ // 閿佸畾涓昏〃鏍间腑宸查�変腑鐨勮锛堥�氳繃CSS绫诲悕锛�
+ this.$nextTick(() => {
+ this.$refs.mainTable.clearSelection()
+ })
+
+ this.$modal.msgSuccess(`宸茬‘璁� ${this.selectedRows.length} 鏉℃暟鎹紝璇峰湪鍙充晶琛ㄦ牸涓繘琛屾壒鏀筦)
+ },
+
+ // 淇濆瓨鎵规敼鏁版嵁
+ async handleSave() {
+ if (this.tempTableData.length === 0) {
+ this.$modal.msgWarning('娌℃湁闇�瑕佷繚瀛樼殑鏁版嵁!')
+ return
+ }
+
+ try {
+ this.tempLoading = true
+
+ // 杞崲鏁版嵁鏍煎紡
+ const saveData = this.tempTableData.map(item => ({
+ HOnceRightRate: item['涓�娆″悎鏍肩巼鏍囧噯鍊�'],
+ HDivisionID: this.divisionJudgment(item['浜嬩笟閮�']),
+ HNumber: item['鐗╂枡浠g爜'],
+ HName: item['鐗╂枡鍚嶇О'],
+ HModel: item['瑙勬牸鍨嬪彿'],
+ HMaterClsID: this.materClsJudgment(item['鐗╂枡灞炴��']),
+ HRemark: item['澶囨敞'],
+ HQtyDec: item['鏁伴噺绮惧害'],
+ HPriceDec: item['鍗曚环绮惧害'],
+ HMoneyDec: item['閲戦绮惧害'],
+ HTaxRate: item['榛樿绋庣巼'],
+ HProfitRate: item['榛樿鍒╂鼎鐜�'],
+ HTaxCost: item['鍚◣鎴愭湰浠�'],
+ HFootPrice: item['缁撶畻浠�'],
+ HWeight: item['鍏嬮噸'],
+ HColorRemark: item['鏌撹壊瑕佹眰'],
+ HWidth: item['骞呭'],
+ // 鍏朵粬闇�瑕佷繚瀛樼殑瀛楁...
+ HItemID: item.HItemID
+ }))
+
+ // 鏁版嵁楠岃瘉
+ for (const item of saveData) {
+ if (!item.HNumber) {
+ throw new Error('璇疯緭鍏ョ墿鏂欎唬鐮侊紒')
+ }
+ if (!item.HName) {
+ throw new Error('璇疯緭鍏ョ墿鏂欏悕绉帮紒')
+ }
+ // 鍏朵粬楠岃瘉瑙勫垯...
+ }
+
+ const dataStr = JSON.stringify(saveData)
+ const response = await axios.post(`${this.baseURL}/Gy_Material/SaveGy_MaterialList_Batch`, {
+ msg: dataStr + ';' + this.user + ';' + this.queryParams.HOrgID
+ })
+
+ if (response.data.count === 1) {
+ this.$modal.msgSuccess('淇濆瓨鎴愬姛!')
+ this.tempTableData = []
+ this.getTableData() // 鍒锋柊涓昏〃鏍�
+ } else {
+ this.$modal.msgError(response.data.Message)
+ }
+ } catch (error) {
+ this.$modal.msgError(error.message || '淇濆瓨澶辫触!')
+ } finally {
+ this.tempLoading = false
+ }
+ },
+
+ // 鍒犻櫎鏁版嵁
+ async handleDelete() {
+ if (this.selectedRows.length === 0) {
+ this.$modal.msgWarning('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁!')
+ return
+ }
+
+ try {
+ await this.$confirm('纭瑕佸垹闄ら�変腑鐨勬暟鎹悧锛�', '鎻愮ず', {
+ type: 'warning'
+ })
+ for (const row of this.selectedRows) {
+ await axios.get(`${this.baseURL}/Gy_Material/Delete`, {
+ params: {
+ HItemID: row.HItemID,
+ user: this.user
+ }
+ })
+ }
+
+ this.$modal.msgSuccess('鍒犻櫎鎴愬姛!')
+ this.getTableData()
+ this.selectedRows = []
+ } catch (error) {
+ if (error !== 'cancel') {
+ this.$modal.msgError('鍒犻櫎澶辫触!')
+ }
+ }
+ },
+
+ // 鍗曞厓鏍肩紪杈�
+ handleCellEdit(row, field, index) {
+ // 鍙互鍦ㄨ繖閲屾坊鍔犵紪杈戦獙璇侀�昏緫
+ console.log(`缂栬緫绗�${index + 1}琛岋紝瀛楁: ${field}, 鍊�: ${row[field]}`)
+ },
+
+ // 涓嬫媺閫夋嫨鍙樺寲
+ handleSelectChange(field) {
+ // 鎵归噺鏇存柊鐩稿悓瀛楁鐨勫��
+ this.tempTableData.forEach(item => {
+ // 杩欓噷鍙互鏍规嵁涓氬姟闇�姹傚喅瀹氭槸鍚﹀悓姝ユ洿鏂版墍鏈夎鐨勭浉鍚屽瓧娈�
+ })
+ },
+
+ // 鍒楄缃�
+ handleColumnSetting() {
+ this.columnSettingVisible = true
+ },
+
+ // 淇濆瓨鍒楄缃�
+ handleColumnSave(columns) {
+ this.allColumns = columns
+ this.mainTableColumns = this.allColumns.filter(col => !col.hide)
+ this.tempTableColumns = this.mainTableColumns.map(col => ({
+ ...col,
+ editable: this.isEditableColumn(col.field)
+ }))
+ this.columnSettingVisible = false
+ },
+
+
+
+ // 閫�鍑�
+ handleExit() {
+ if (this.tempTableData.length > 0) {
+ this.$confirm('鏈夋湭淇濆瓨鐨勬壒鏀规暟鎹紝纭畾瑕侀��鍑哄悧锛�', '鎻愮ず', {
+ type: 'warning'
+ }).then(() => {
+ this.handleClose()
+ })
+ } else {
+ this.handleClose()
+ }
+ },
+
+ // 鍏抽棴瀵硅瘽妗�
+ handleClose() {
+ this.openCorrect = false
+ this.$emit('close')
+ },
+
+ // 鍒嗛〉澶у皬鍙樺寲
+ handleSizeChange(size) {
+ this.pagination.size = size
+ this.pagination.page = 1
+ this.getTableData()
+ },
+
+ // 褰撳墠椤靛彉鍖�
+ handleCurrentChange(page) {
+ this.pagination.page = page
+ this.getTableData()
+ },
+
+ // 宸ュ叿鏂规硶
+ isEditableColumn(field) {
+ const nonEditableFields = [
+ 'HItemID', '鐗╂枡浠g爜', '鐗╂枡鍚嶇О', '缁勭粐鍚嶇О', '瀹℃牳浜�', '鍒涘缓浜�', '鍒涘缓鏃堕棿'
+ ]
+ return !nonEditableFields.includes(field)
+ },
+
+ isSelectColumn(field) {
+ return ['鐗╂枡灞炴��', '浜嬩笟閮�'].includes(field)
+ },
+
+ isDateColumn(field) {
+ return field.includes('鏃堕棿') || field.includes('鏃ユ湡')
+ },
+
+ formatDate(dateString) {
+ if (!dateString) return ''
+ const date = new Date(dateString)
+ return date.toLocaleString('zh-CN')
+ },
+
+ getRowClassName({ row }) {
+ return this.selectedRows.some(selected => selected.HItemID === row.HItemID) ? 'locked-row' : ''
+ },
+
+ divisionJudgment(divisionStr) {
+ switch (divisionStr) {
+ case '娉ㄥ浜嬩笟閮�': return 3
+ case '杞浜嬩笟閮�': return 4
+ default: return 0
+ }
+ },
+
+ materClsJudgment(materClsStr) {
+ switch (materClsStr) {
+ case '澶栬喘': return '1'
+ case '鑷埗': return '2'
+ case '濮斿': return '3'
+ default: return '0'
+ }
+ }
+ }
+}
+</script>
+
+<style scoped>
+.material-correction-dialog ::v-deep .el-dialog__body {
+ padding: 10px 20px;
+}
+
+.correction-container {
+ height: 70vh;
+ display: flex;
+ flex-direction: column;
+}
+
+.search-card {
+ margin-bottom: 10px;
+}
+
+.main-content {
+ flex: 1;
+ display: flex;
+ gap: 10px;
+ min-height: 0;
+}
+
+.table-section {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ border: 1px solid #e6e6e6;
+ border-radius: 4px;
+ background: #fff;
+}
+
+.table-header {
+ padding: 8px 12px;
+ background: #f5f7fa;
+ border-bottom: 1px solid #e6e6e6;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.table-header span {
+ font-weight: bold;
+ color: #333;
+}
+
+.table-actions {
+ display: flex;
+ gap: 8px;
+}
+
+.table-container {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+}
+
+.pagination-container {
+ padding: 10px;
+ background: #f5f7fa;
+ border-top: 1px solid #e6e6e6;
+}
+
+.filter-conditions {
+ margin-top: 10px;
+}
+
+.filter-group {
+ margin-bottom: 10px;
+}
+
+/* 閿佸畾琛岀殑鏍峰紡 */
+::v-deep .locked-row {
+ background-color: #f0f0f0 !important;
+ cursor: not-allowed;
+}
+
+::v-deep .locked-row .el-checkbox {
+ cursor: not-allowed;
+}
+
+::v-deep .locked-row .el-checkbox__input.is-disabled .el-checkbox__inner {
+ background-color: #f5f7fa;
+ border-color: #e4e7ed;
+ cursor: not-allowed;
+}
+
+/* 涓存椂琛ㄦ牸缂栬緫鏍峰紡 */
+::v-deep .temp-table .el-input__inner {
+ border: 1px solid #409eff;
+ border-radius: 4px;
+}
+
+::v-deep .temp-table .el-select {
+ width: 100%;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/gyMaterial/edit/index.vue b/src/views/gyMaterial/edit/index.vue
new file mode 100644
index 0000000..70dc005
--- /dev/null
+++ b/src/views/gyMaterial/edit/index.vue
@@ -0,0 +1,1179 @@
+<template>
+ <div class="material-edit-container">
+ <div class="layui-fluid">
+ <div class="layui-row layui-col-space15">
+ <div class="layui-col-md12">
+ <div class="layui-card">
+ <el-form
+ id="form0"
+ class="layui-form"
+ :model="formData"
+ ref="materialForm"
+ label-width="85px"
+ >
+ <div class="layui-card-header">
+ <div class="layui-btn-group">
+ <el-button
+ type="primary"
+ class="layui-btn layui-btn-normal layui-btn-radius"
+ @click="handleCopy"
+ :disabled="!canCopy"
+ >
+ 澶嶅埗
+ </el-button>
+ <el-button
+ type="primary"
+ class="layui-btn layui-btn-normal layui-btn-radius"
+ @click="handleSave"
+ >
+ 淇濆瓨
+ </el-button>
+ <el-button
+ type="primary"
+ class="layui-btn layui-btn-normal layui-btn-radius"
+ @click="handleExit"
+ >
+ 閫�鍑�
+ </el-button>
+ </div>
+ </div>
+ <div class="layui-card-body">
+ <el-tabs v-model="activeTab" type="border-card">
+ <el-tab-pane label="鍩烘湰淇℃伅" name="basic">
+ <h1 style="text-align:center;"><b>鐗╂枡璁剧疆</b></h1>
+
+ <!-- 鍩烘湰淇℃伅琛ㄥ崟 -->
+ <div class="form-section">
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鐗╂枡浠g爜*" prop="HNumber">
+ <el-input
+ v-model="formData.HNumber"
+ placeholder="璇疯緭鍏ョ墿鏂欎唬鐮�"
+ :readonly="operationType === 4"
+ ></el-input>
+ <input type="hidden" v-model="formData.HItemID" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鐗╂枡鍚嶇О*" prop="HName">
+ <el-input
+ v-model="formData.HName"
+ placeholder="璇疯緭鍏ョ墿鏂欏悕绉�"
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="瑙勬牸鍨嬪彿*" prop="HModel">
+ <el-input
+ v-model="formData.HModel"
+ placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�"
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鍔╄鐮�">
+ <el-input
+ v-model="formData.HHelpCode"
+ placeholder="璇疯緭鍏ュ姪璁扮爜"
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍦嗘満浠g爜">
+ <el-input
+ v-model="formData.HCircularKnittingMachineCode"
+ placeholder="璇疯緭鍏ュ渾鏈轰唬鐮�"
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="涓昏閲忓崟浣�*" prop="HUnitID">
+ <el-input
+ v-model="formData.HUnitName"
+ placeholder="璇烽�夋嫨涓昏閲忓崟浣�"
+ readonly
+ style="width: calc(100% - 50px); float: left;"
+ ></el-input>
+ <el-button
+ type="primary"
+ style="width: 40px;"
+ @click="openUnitDialog"
+ >
+ <i class="el-icon-search"></i>
+ </el-button>
+ <input type="hidden" v-model="formData.HUnitID" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍏嬮噸">
+ <el-input
+ v-model="formData.HWeight"
+ placeholder="璇疯緭鍏ユ暟瀛�"
+ type="number"
+ min="0"
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="榛樿浠撳簱">
+ <el-input
+ v-model="formData.HWhName"
+ placeholder="璇烽�夋嫨榛樿浠撳簱"
+ readonly
+ style="width: calc(100% - 50px); float: left;"
+ ></el-input>
+ <el-button
+ type="primary"
+ style="width: 40px;"
+ @click="openWarehouseDialog"
+ >
+ <i class="el-icon-search"></i>
+ </el-button>
+ <input type="hidden" v-model="formData.HWhID" />
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鏌撹壊瑕佹眰">
+ <el-input
+ v-model="formData.HColorRemark"
+ placeholder="璇疯緭鍏ユ煋鑹茶姹�"
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="棰滆壊">
+ <el-input
+ v-model="formData.HColor"
+ placeholder="璇疯緭鍏ラ鑹�"
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="骞呭">
+ <el-input
+ v-model="formData.HWidth"
+ placeholder="璇疯緭鍏ユ暟瀛�"
+ type="number"
+ min="0"
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鐗╂枡鍒嗙被">
+ <el-input
+ v-model="formData.HMaterClsName"
+ placeholder="璇烽�夋嫨鐗╂枡鍒嗙被"
+ readonly
+ style="width: calc(100% - 50px); float: left;"
+ ></el-input>
+ <el-button
+ type="primary"
+ style="width: 40px;"
+ @click="openMaterialTypeDialog"
+ >
+ <i class="el-icon-search"></i>
+ </el-button>
+ <input type="hidden" v-model="formData.HMaterTypeID" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鐗╂枡灞炴��">
+ <el-select v-model="formData.HMaterClsID" style="width: 100%;">
+ <el-option value="1" label="澶栬喘"></el-option>
+ <el-option value="2" label="鑷埗"></el-option>
+ <el-option value="3" label="濮斿"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 妫�楠屾柟妗堥儴鍒� -->
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="棣栦欢妫�楠屾柟妗�">
+ <el-input
+ v-model="formData.HQCSchemeName_Fst"
+ placeholder="璇烽�夋嫨棣栦欢妫�楠屾柟妗�"
+ readonly
+ style="width: calc(100% - 50px); float: left; background-color: #efefef4d;"
+ ></el-input>
+ <el-button
+ type="primary"
+ style="width: 40px;"
+ @click="openQCSchemeDialog('fst')"
+ >
+ <i class="el-icon-search"></i>
+ </el-button>
+ <input type="hidden" v-model="formData.HQCSchemeID_Fst" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="杞簭妫�楠屾柟妗�">
+ <el-input
+ v-model="formData.HQCSchemeName_Proc"
+ placeholder="璇烽�夋嫨杞簭妫�楠屾柟妗�"
+ readonly
+ style="width: calc(100% - 50px); float: left; background-color: #efefef4d;"
+ ></el-input>
+ <el-button
+ type="primary"
+ style="width: 40px;"
+ @click="openQCSchemeDialog('proc')"
+ >
+ <i class="el-icon-search"></i>
+ </el-button>
+ <input type="hidden" v-model="formData.HQCSchemeID_Proc" />
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="宸℃妫�楠屾柟妗�">
+ <el-input
+ v-model="formData.HQCSchemeName_Patrol"
+ placeholder="璇烽�夋嫨宸℃妫�楠屾柟妗�"
+ readonly
+ style="width: calc(100% - 50px); float: left; background-color: #efefef4d;"
+ ></el-input>
+ <el-button
+ type="primary"
+ style="width: 40px;"
+ @click="openQCSchemeDialog('patrol')"
+ >
+ <i class="el-icon-search"></i>
+ </el-button>
+ <input type="hidden" v-model="formData.HQCSchemeID_Patrol" />
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 鐗╂枡鍏紡閮ㄥ垎 -->
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鐗╂枡鍏紡">
+ <el-select v-model="formData.HMaterRuleType" style="width: 100%;">
+ <el-option value="鍏朵粬" label="鍏朵粬"></el-option>
+ <el-option value="鏌撴枡" label="鏌撴枡"></el-option>
+ <el-option value="鍔╁墏" label="鍔╁墏"></el-option>
+ <el-option value="鍔╁墏锛堟寜甯冪畻锛�" label="鍔╁墏锛堟寜甯冪畻锛�"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鐗╂枡鍏紡(缇婃瘺)" style="display: flex; flex-direction: row;">
+ <el-select v-model="formData.HMaterRuleExternType" style="width: 100%;">
+ <el-option value="鍏朵粬" label="鍏朵粬"></el-option>
+ <el-option value="鏌撴枡" label="鏌撴枡"></el-option>
+ <el-option value="鍔╁墏" label="鍔╁墏"></el-option>
+ <el-option value="鍔╁墏锛堟寜甯冪畻锛�" label="鍔╁墏锛堟寜甯冪畻锛�"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鐗╂枡鍏紡(姣涘皷)" style="display: flex; flex-direction: row;">
+ <el-select v-model="formData.HMaterRuleExternType1" style="width: 100%;">
+ <el-option value="鍏朵粬" label="鍏朵粬"></el-option>
+ <el-option value="鏌撴枡" label="鏌撴枡"></el-option>
+ <el-option value="鍔╁墏" label="鍔╁墏"></el-option>
+ <el-option value="鍔╁墏锛堟寜娴嗛噸绠楋級" label="鍔╁墏锛堟寜娴嗛噸绠楋級"></el-option>
+ <el-option value="杞墏" label="杞墏"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 棰滆壊鑹插彿鍜屽悎鏍肩巼 -->
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="棰滆壊鑹插彿">
+ <el-input
+ v-model="formData.HColorNo"
+ placeholder="璇烽�夋嫨棰滆壊"
+ readonly
+ style="width: 70%; float: left; background-color: #efefef4d;"
+ ></el-input>
+ <el-color-picker
+ v-model="formData.HColorNo"
+ style="width: 30%;"
+ ></el-color-picker>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="涓�娆″悎鏍肩巼鏍囧噯鍊�">
+ <el-input
+ v-model="formData.HOnceRightRate"
+ placeholder="璇疯緭鍏ュ悎鏍肩巼"
+ type="number"
+ min="0"
+ max="100"
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鐧藉澂瑕佹眰">
+ <el-input
+ type="textarea"
+ v-model="formData.HRemark"
+ placeholder="璇疯緭鍏ョ櫧鍧姹�"
+ ></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="绂佺敤鏍囧織">
+ <el-checkbox
+ v-model="formData.HStopflag"
+ :disabled="true"
+ >鏄惁绂佺敤</el-checkbox>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </div>
+ </el-tab-pane>
+
+ <el-tab-pane label="琛ュ厖淇℃伅" name="supplement">
+ <!-- 缇婃瘺淇℃伅 -->
+ <div class="form-section">
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="姣涢珮">
+ <el-input v-model="formData.HHeight_M"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="瀵告暟缁勭粐">
+ <el-input v-model="formData.HInches_M"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鍏ㄦ瘺闀�">
+ <el-input v-model="formData.HAl1Long_M"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鍧竷瀵嗗害">
+ <el-input v-model="formData.HDensity_M"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="姣涚罕鍚嶇О鍙婅鏍�">
+ <el-input v-model="formData.HTela_M"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="搴曚笣">
+ <el-input v-model="formData.HUnderTela_M"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="瀹氬瀷娴嗘枡">
+ <el-input v-model="formData.HSizing_M"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </div>
+ </el-tab-pane>
+
+ <el-tab-pane label="鍏朵粬淇℃伅" name="other">
+ <!-- 鍏朵粬淇℃伅 -->
+ <div class="form-section">
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="榛樿浠撲綅缁�">
+ <el-input v-model="formData.HSPGroupID" type="number" min="0"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="榛樿浠撲綅">
+ <el-input v-model="formData.HSPID" type="number" min="0"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="榛樿bom">
+ <el-input v-model="formData.HBomID" type="number" min="0"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鎹㈢畻鐜�">
+ <el-input v-model="formData.HSecUnitRate" type="number" min="0"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="榛樿鎵撳嵃妯℃澘">
+ <el-input v-model="formData.HBarCodePrintName"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 搴撳瓨鐩稿叧 -->
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鏈�楂樺簱瀛�">
+ <el-input v-model="formData.HHighStock" type="number" min="0"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="鏈�浣庡簱瀛�">
+ <el-input v-model="formData.HLowStock" type="number" min="0"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="瀹夊叏搴撳瓨">
+ <el-input v-model="formData.HSafeStock" type="number" min="0"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 浠锋牸鐩稿叧 -->
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="閲囪喘鍗曚环">
+ <el-input v-model="formData.HOrderPrice" type="number" min="0"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="閿�鍞崟浠�">
+ <el-input v-model="formData.HSalePrice" type="number" min="0"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="璁″垝鍗曚环">
+ <el-input v-model="formData.HPlanPrice" type="number" min="0"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <!-- 鏇村瀛楁鍙互鏍规嵁闇�瑕佺户缁坊鍔� -->
+ </div>
+ </el-tab-pane>
+
+ <el-tab-pane label="鍒跺崟淇℃伅" name="order">
+ <!-- 鍒跺崟淇℃伅 -->
+ <div class="form-section">
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鍒跺崟浜�">
+ <el-input v-model="formData.HMakeEmp" readonly style="background-color:#efefef4d;"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="瀹℃牳浜�">
+ <el-input v-model="formData.HCheckEmp" readonly style="background-color:#efefef4d;"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="绂佺敤浜�">
+ <el-input v-model="formData.HStopEmp" readonly style="background-color:#efefef4d;"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+
+ <el-row :gutter="20">
+ <el-col :span="8">
+ <el-form-item label="鍒跺崟鏃ユ湡">
+ <el-input v-model="formData.HMakeDate" readonly style="background-color:#efefef4d;"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="瀹℃牳鏃ユ湡">
+ <el-input v-model="formData.HCheckDate" readonly style="background-color:#efefef4d;"></el-input>
+ </el-form-item>
+ </el-col>
+ <el-col :span="8">
+ <el-form-item label="绂佺敤鏃ユ湡">
+ <el-input v-model="formData.HStopDate" readonly style="background-color:#efefef4d;"></el-input>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ </div>
+ </el-tab-pane>
+
+ <el-tab-pane label="闄勪欢淇℃伅" name="attachment">
+ <!-- 闄勪欢淇℃伅 -->
+ <div class="form-section">
+ <el-upload
+ class="upload-demo"
+ action="#"
+ :on-preview="handlePreview"
+ :on-remove="handleRemove"
+ :before-remove="beforeRemove"
+ multiple
+ :limit="10"
+ :on-exceed="handleExceed"
+ :file-list="fileList"
+ >
+ <el-button size="small" type="primary">閫夋嫨鏂囦欢</el-button>
+ <div slot="tip" class="el-upload__tip">鍙兘涓婁紶jpg/png/pdf鏂囦欢锛屼笖涓嶈秴杩�500kb</div>
+ </el-upload>
+
+ <el-table :data="fileList" style="width: 100%">
+ <el-table-column prop="name" label="鏂囦欢鍚�"></el-table-column>
+ <el-table-column label="鍥剧墖">
+ <template slot-scope="scope">
+ <img
+ v-if="scope.row.type === 'image'"
+ :src="scope.row.url"
+ style="width: 150px; margin:10px;cursor:pointer;"
+ @click="previewImg(scope.row.url)"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column prop="size" label="澶у皬"></el-table-column>
+ <el-table-column prop="status" label="鐘舵��"></el-table-column>
+ <el-table-column label="鎿嶄綔">
+ <template slot-scope="scope">
+ <el-button
+ size="mini"
+ @click="handleUpload(scope.$index, scope.row)"
+ >涓婁紶</el-button>
+ <el-button
+ size="mini"
+ type="danger"
+ @click="handleDelete(scope.$index, scope.row)"
+ >鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </el-tab-pane>
+ </el-tabs>
+ </div>
+ </el-form>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <!-- 鍚勭寮圭獥缁勪欢 - 鏆傛椂鐣欑┖ -->
+ <el-dialog
+ title="閫夋嫨璁¢噺鍗曚綅"
+ :visible.sync="unitDialogVisible"
+ width="80%"
+ append-to-body
+ >
+ <!-- 璁¢噺鍗曚綅閫夋嫨缁勪欢棰勭暀浣嶇疆 -->
+ <div style="text-align: center; padding: 50px;">
+ <h2>璁¢噺鍗曚綅閫夋嫨鍔熻兘</h2>
+ <p>璁¢噺鍗曚綅閫夋嫨鍔熻兘寰呭悗缁紑鍙�</p>
+ <el-button type="primary" @click="unitDialogVisible = false">鍏抽棴</el-button>
+ </div>
+ </el-dialog>
+
+ <el-dialog
+ title="閫夋嫨浠撳簱"
+ :visible.sync="warehouseDialogVisible"
+ width="80%"
+ append-to-body
+ >
+ <!-- 浠撳簱閫夋嫨缁勪欢棰勭暀浣嶇疆 -->
+ <div style="text-align: center; padding: 50px;">
+ <h2>浠撳簱閫夋嫨鍔熻兘</h2>
+ <p>浠撳簱閫夋嫨鍔熻兘寰呭悗缁紑鍙�</p>
+ <el-button type="primary" @click="warehouseDialogVisible = false">鍏抽棴</el-button>
+ </div>
+ </el-dialog>
+
+ <el-dialog
+ title="閫夋嫨鐗╂枡鍒嗙被"
+ :visible.sync="materialTypeDialogVisible"
+ width="80%"
+ append-to-body
+ >
+ <!-- 鐗╂枡鍒嗙被閫夋嫨缁勪欢棰勭暀浣嶇疆 -->
+ <div style="text-align: center; padding: 50px;">
+ <h2>鐗╂枡鍒嗙被閫夋嫨鍔熻兘</h2>
+ <p>鐗╂枡鍒嗙被閫夋嫨鍔熻兘寰呭悗缁紑鍙�</p>
+ <el-button type="primary" @click="materialTypeDialogVisible = false">鍏抽棴</el-button>
+ </div>
+ </el-dialog>
+
+ <el-dialog
+ title="閫夋嫨妫�楠屾柟妗�"
+ :visible.sync="qcSchemeDialogVisible"
+ width="80%"
+ append-to-body
+ >
+ <!-- 妫�楠屾柟妗堥�夋嫨缁勪欢棰勭暀浣嶇疆 -->
+ <div style="text-align: center; padding: 50px;">
+ <h2>妫�楠屾柟妗堥�夋嫨鍔熻兘</h2>
+ <p>妫�楠屾柟妗堥�夋嫨鍔熻兘寰呭悗缁紑鍙�</p>
+ <el-button type="primary" @click="qcSchemeDialogVisible = false">鍏抽棴</el-button>
+ </div>
+ </el-dialog>
+
+ <!-- 鍥剧墖棰勮寮圭獥 -->
+ <el-dialog
+ :visible.sync="previewVisible"
+ width="80%"
+ top="5vh"
+ :before-close="handlePreviewClose"
+ >
+ <img :src="previewImage" style="width: 100%;" />
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import axios from "axios";
+
+export default {
+ name: "MaterialEdit",
+ props: {
+ hID: { type: [String, Number], default: 0 },
+ OperationType: { type: [String, Number], default: 1 }, // 1 鏂板 2澶嶅埗 3缂栬緫 4娴佹按鍙锋柊澧�
+ HMaterTypeID: { type: [String, Number], default: 0 }
+ },
+ data() {
+ return {
+ // 鏍囩椤垫縺娲荤姸鎬�
+ activeTab: 'basic',
+
+ // 琛ㄥ崟鏁版嵁
+ formData: {
+ HItemID: 0,
+ HNumber: '',
+ HName: '',
+ HModel: '',
+ HHelpCode: '',
+ HCircularKnittingMachineCode: '',
+ HUnitID: 0,
+ HUnitName: '',
+ HWeight: 0,
+ HWhID: 0,
+ HWhName: '',
+ HColorRemark: '',
+ HColor: '',
+ HWidth: 0,
+ HMaterTypeID: 0,
+ HMaterClsName: '',
+ HMaterClsID: '1',
+ HQCSchemeID_Fst: 0,
+ HQCSchemeName_Fst: '',
+ HQCSchemeID_Proc: 0,
+ HQCSchemeName_Proc: '',
+ HQCSchemeID_Patrol: 0,
+ HQCSchemeName_Patrol: '',
+ HMaterRuleType: '鍏朵粬',
+ HMaterRuleExternType: '鍏朵粬',
+ HMaterRuleExternType1: '鍏朵粬',
+ HColorNo: '',
+ HOnceRightRate: 0,
+ HRemark: '',
+ HStopflag: false,
+
+ // 琛ュ厖淇℃伅
+ HHeight_M: '',
+ HInches_M: '',
+ HAl1Long_M: '',
+ HDensity_M: '',
+ HTela_M: '',
+ HUnderTela_M: '',
+ HSizing_M: '',
+
+ // 鍏朵粬淇℃伅
+ HSPGroupID: 0,
+ HSPID: 0,
+ HBomID: 0,
+ HSecUnitRate: 0,
+ HBarCodePrintName: '',
+ HHighStock: 0,
+ HLowStock: 0,
+ HSafeStock: 0,
+ HOrderPrice: 0,
+ HSalePrice: 0,
+ HPlanPrice: 0,
+
+ // 鍒跺崟淇℃伅
+ HMakeEmp: '',
+ HMakeDate: '',
+ HCheckEmp: '',
+ HCheckDate: '',
+ HStopEmp: '',
+ HStopDate: ''
+ },
+
+ // 闄勪欢鍒楄〃
+ fileList: [],
+
+ // 寮圭獥鎺у埗
+ unitDialogVisible: false,
+ warehouseDialogVisible: false,
+ materialTypeDialogVisible: false,
+ qcSchemeDialogVisible: false,
+ previewVisible: false,
+ previewImage: '',
+
+ // 鍏朵粬鏁版嵁
+ canCopy: false,
+ qcSchemeType: 'fst', // fst, proc, patrol
+
+ baseURL: process.env.VUE_APP_BASE_URL || "http://47.96.97.237/API/",
+ user: "admin"
+ };
+ },
+ computed: {
+ operationType() {
+ return parseInt(this.OperationType);
+ },
+ materialTypeID() {
+ return parseInt(this.HMaterTypeID);
+ },
+ materialID() {
+ return parseInt(this.hID);
+ }
+ },
+ created() {
+ this.initData();
+ },
+ methods: {
+ // 鍒濆鍖栨暟鎹�
+ initData() {
+ // 璁剧疆褰撳墠鐢ㄦ埛鍜屾棩鏈�
+ this.formData.HMakeEmp = this.user;
+ this.formData.HMakeDate = this.formatDate(new Date());
+
+ // 鏍规嵁鎿嶄綔绫诲瀷鍒濆鍖�
+ if (this.materialID === 0 || this.materialID === null) {
+ // 鏂板
+ this.formData.HItemID = 0;
+ this.readConfigFile();
+ } else if (this.operationType === 2) {
+ // 澶嶅埗
+ this.loadMaterialData(this.materialID);
+ this.formData.HItemID = 0;
+ this.formData.HMakeEmp = this.user;
+ this.formData.HMakeDate = this.formatDate(new Date());
+ this.formData.HCheckEmp = '';
+ this.formData.HCheckDate = '';
+ this.formData.HStopEmp = '';
+ this.formData.HStopDate = '';
+ } else if (this.operationType === 3) {
+ // 缂栬緫
+ this.formData.HItemID = this.materialID;
+ this.loadMaterialData(this.materialID);
+ }
+
+ // 娴佹按鍙锋柊澧�
+ if (this.operationType === 4) {
+ this.getMaxNumber(this.materialTypeID);
+ }
+
+ // 鍒濆鍖栭檮浠�
+ this.initFileUpload();
+ },
+
+ // 璇诲彇閰嶇疆鏂囦欢
+ readConfigFile() {
+ // 浠庢湰鍦板瓨鍌ㄨ鍙栭厤缃�
+ const config = localStorage.getItem("Add_Edit_Gy_Material");
+ if (config) {
+ const configData = JSON.parse(config);
+ this.formData.HWhID = configData.HWhID || 0;
+ this.formData.HWhName = configData.HWhName || '';
+ this.formData.HMaterClsID = configData.HMaterClsID || '1';
+ this.formData.HUnitID = configData.HUnitID || 0;
+ this.formData.HUnitName = configData.HUnitName || '';
+ }
+ },
+
+ // 鍐欏叆閰嶇疆鏂囦欢
+ writeConfigFile() {
+ const configData = {
+ HWhID: this.formData.HWhID,
+ HWhName: this.formData.HWhName,
+ HMaterClsID: this.formData.HMaterClsID,
+ HUnitID: this.formData.HUnitID,
+ HUnitName: this.formData.HUnitName
+ };
+ localStorage.setItem("Add_Edit_Gy_Material", JSON.stringify(configData));
+ },
+
+ // 鍔犺浇鐗╂枡鏁版嵁
+ loadMaterialData(id) {
+ this.$modal.loading("鍔犺浇涓�...");
+ axios
+ .get(this.baseURL + "/Gy_Material/GetGy_MaterialDetail", {
+ params: { HID: id }
+ })
+ .then(response => {
+ this.$modal.closeLoading();
+ if (response.data.code === 1) {
+ const data = response.data.data.h_v_Edit_Gy_MaterialList[0];
+ this.populateFormData(data);
+
+ // 濡傛灉鏄鍒舵搷浣滐紝娓呯┖鐗╂枡浠g爜
+ if (this.operationType === 2) {
+ this.formData.HNumber = '';
+ }
+
+ // 鍔犺浇闄勪欢
+ this.loadFiles();
+ } else {
+ this.$modal.msgError(response.data.msg || "鍔犺浇鏁版嵁澶辫触");
+ }
+ })
+ .catch(error => {
+ this.$modal.closeLoading();
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ // 濉厖琛ㄥ崟鏁版嵁
+ populateFormData(data) {
+ // 鍩烘湰淇℃伅
+ this.formData.HNumber = data.鐗╂枡浠g爜 || '';
+ this.formData.HName = data.鐗╂枡鍚嶇О || '';
+ this.formData.HModel = data.瑙勬牸鍨嬪彿 || '';
+ this.formData.HHelpCode = data.鍔╄鐮� || '';
+ this.formData.HUnitID = data.涓昏閲忓崟浣� || 0;
+ this.formData.HUnitName = data.涓昏閲忓崟浣嶅悕绉� || '';
+ this.formData.HColor = data.棰滆壊 || '';
+ this.formData.HMaterTypeID = data.HMaterTypeID || 0;
+ this.formData.HMaterClsName = data.鐗╂枡鍒嗙被 || '';
+ this.formData.HMaterClsID = data.鐗╂枡灞炴�� === "0" ? "1" : (data.鐗╂枡灞炴�� || "1");
+ this.formData.HWhID = data.榛樿浠撳簱 || 0;
+ this.formData.HWhName = data.浠撳簱鍚嶇О || '';
+ this.formData.HWidth = data.HWidth || 0;
+ this.formData.HWeight = data.HWeight || 0;
+ this.formData.HColorRemark = data.鏌撹壊瑕佹眰 || '';
+ this.formData.HQCSchemeID_Fst = data.HQCSchemeID_Fst || 0;
+ this.formData.HQCSchemeName_Fst = data.棣栦欢妫�楠屾柟妗� || '';
+ this.formData.HQCSchemeID_Proc = data.HQCSchemeID_Proc || 0;
+ this.formData.HQCSchemeName_Proc = data.杞簭妫�楠屾柟妗� || '';
+ this.formData.HQCSchemeID_Patrol = data.HQCSchemeID_Patrol || 0;
+ this.formData.HQCSchemeName_Patrol = data.宸℃妫�楠屾柟妗� || '';
+ this.formData.HMaterRuleType = data.鐗╂枡鍏紡 || '鍏朵粬';
+ this.formData.HMaterRuleExternType = data.缇婃瘺鐗╂枡鍏紡 || '鍏朵粬';
+ this.formData.HMaterRuleExternType1 = data.姣涘皷鐗╂枡鍏紡 || '鍏朵粬';
+ this.formData.HColorNo = data.棰滆壊鑹插彿 || '';
+ this.formData.HOnceRightRate = data.涓�娆″悎鏍肩巼鏍囧噯鍊� || 0;
+ this.formData.HRemark = data.澶囨敞 || '';
+ this.formData.HStopflag = data.绂佺敤鏍囪 === "true";
+
+ // 琛ュ厖淇℃伅
+ this.formData.HHeight_M = data.姣涢珮 || '';
+ this.formData.HInches_M = data.瀵告暟缁勭粐 || '';
+ this.formData.HAl1Long_M = data.鍏ㄦ瘺闀� || '';
+ this.formData.HDensity_M = data.鍧忓竷瀵嗗害 || '';
+ this.formData.HTela_M = data.姣涚罕鍚嶇О鍙婅鏍� || '';
+ this.formData.HUnderTela_M = data.搴曚笣 || '';
+ this.formData.HSizing_M = data.瀹氬瀷娴嗘枡 || '';
+
+ // 鍏朵粬淇℃伅
+ this.formData.HBarCodePrintName = data.榛樿鎵撳嵃妯℃澘 || '';
+
+ // 鍒跺崟淇℃伅
+ this.formData.HMakeEmp = data.鍒涘缓浜� || '';
+ this.formData.HMakeDate = data.鍒涘缓鏃ユ湡 ? this.formatDate(new Date(data.鍒涘缓鏃ユ湡)) : '';
+ this.formData.HCheckEmp = data.瀹℃牳浜� || '';
+ this.formData.HCheckDate = data.瀹℃牳鏃ユ湡 ? this.formatDate(new Date(data.瀹℃牳鏃ユ湡)) : '';
+ this.formData.HStopEmp = data.绂佺敤浜� || '';
+ this.formData.HStopDate = data.绂佺敤鏃ユ湡 ? this.formatDate(new Date(data.绂佺敤鏃ユ湡)) : '';
+ },
+
+ // 鑾峰彇鏈�澶х紪鍙凤紙娴佹按鍙锋柊澧烇級
+ getMaxNumber(typeID) {
+ axios
+ .get(this.baseURL + "/Gy_Material/getMaxNum", {
+ params: {
+ HMaterTypeID: typeID,
+ user: this.user,
+ Organization: "default"
+ }
+ })
+ .then(response => {
+ if (response.data.data) {
+ this.formData.HNumber = response.data.data;
+ } else {
+ this.$modal.msgError(response.data.Message || "鑾峰彇缂栧彿澶辫触");
+ }
+ })
+ .catch(error => {
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ // 淇濆瓨鐗╂枡
+ handleSave() {
+ // 琛ㄥ崟楠岃瘉
+ if (!this.validateForm()) {
+ return;
+ }
+
+ this.$modal.loading("淇濆瓨涓�...");
+
+ // 鍑嗗鏁版嵁
+ const formData = { ...this.formData };
+
+ // 鍙戦�佽姹�
+ axios
+ .post(this.baseURL + "Gy_Material/SaveGy_MaterialList", {
+ msg: JSON.stringify(formData) + ';' + this.user + ';' + "default"
+ })
+ .then(response => {
+ this.$modal.closeLoading();
+ if (response.data.count === 1) {
+ this.$modal.msgSuccess(response.data.Message);
+ this.writeConfigFile();
+ // 淇濆瓨鎴愬姛鍚庣鐢ㄤ繚瀛樻寜閽�
+ this.canCopy = true;
+ } else {
+ this.$modal.msgError(response.data.Message);
+ }
+ })
+ .catch(error => {
+ this.$modal.closeLoading();
+ this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+ });
+ },
+
+ // 琛ㄥ崟楠岃瘉
+ validateForm() {
+ if (!this.formData.HNumber) {
+ this.$modal.msgWarning("璇疯緭鍏ョ墿鏂欎唬鐮侊紒");
+ return false;
+ }
+ if (!this.formData.HName) {
+ this.$modal.msgWarning("璇疯緭鍏ョ墿鏂欏悕绉帮紒");
+ return false;
+ }
+ if (!this.formData.HWhID) {
+ this.$modal.msgWarning("璇烽�夋嫨榛樿浠撳簱锛�");
+ return false;
+ }
+ if (!this.formData.HUnitID) {
+ this.$modal.msgWarning("璇烽�夋嫨涓昏閲忓崟浣嶏紒");
+ return false;
+ }
+
+ // 鏁板瓧瀛楁楠岃瘉
+ const numberFields = [
+ { field: 'HWeight', name: '鍏嬮噸' },
+ { field: 'HWidth', name: '骞呭' },
+ { field: 'HSecUnitRate', name: '鎹㈢畻鐜�' },
+ { field: 'HHighStock', name: '鏈�楂樺簱瀛�' },
+ { field: 'HLowStock', name: '鏈�浣庡簱瀛�' },
+ { field: 'HSafeStock', name: '瀹夊叏搴撳瓨' },
+ { field: 'HOrderPrice', name: '閲囪喘鍗曚环' },
+ { field: 'HSalePrice', name: '閿�鍞崟浠�' },
+ { field: 'HPlanPrice', name: '璁″垝鍗曚环' },
+ { field: 'HOnceRightRate', name: '涓�娆″悎鏍肩巼鏍囧噯鍊�' }
+ ];
+
+ for (const item of numberFields) {
+ if (this.formData[item.field] && !this.isValidNumber(this.formData[item.field])) {
+ this.$modal.msgWarning(`${item.name}璇疯緭鍏ユ纭殑鏁板瓧锛乣);
+ return false;
+ }
+ }
+
+ return true;
+ },
+
+ // 楠岃瘉鏁板瓧
+ isValidNumber(value) {
+ return /^[0-9]+\.?[0-9]*$/.test(value);
+ },
+
+ // 澶嶅埗
+ handleCopy() {
+ this.formData.HItemID = 0;
+ this.formData.HNumber = '';
+ this.canCopy = false;
+ this.$modal.msgSuccess("宸查噸缃〃鍗曪紝鍙互寮�濮嬪鍒舵搷浣�");
+ },
+
+ // 閫�鍑�
+ handleExit() {
+ this.$emit('close');
+ },
+
+ // 鎵撳紑璁¢噺鍗曚綅閫夋嫨寮圭獥
+ openUnitDialog() {
+ this.unitDialogVisible = true;
+ },
+
+ // 鎵撳紑浠撳簱閫夋嫨寮圭獥
+ openWarehouseDialog() {
+ this.warehouseDialogVisible = true;
+ },
+
+ // 鎵撳紑鐗╂枡鍒嗙被閫夋嫨寮圭獥
+ openMaterialTypeDialog() {
+ this.materialTypeDialogVisible = true;
+ },
+
+ // 鎵撳紑妫�楠屾柟妗堥�夋嫨寮圭獥
+ openQCSchemeDialog(type) {
+ this.qcSchemeType = type;
+ this.qcSchemeDialogVisible = true;
+ },
+
+ // 鍒濆鍖栨枃浠朵笂浼�
+ initFileUpload() {
+ // 鏂囦欢涓婁紶鍒濆鍖栭�昏緫
+ },
+
+ // 鍔犺浇鏂囦欢鍒楄〃
+ loadFiles() {
+ if (!this.formData.HNumber) return;
+
+ axios
+ .get(this.baseURL + "/Gy_Mater/Filelist", {
+ params: { HNumber: this.formData.HNumber }
+ })
+ .then(response => {
+ if (response.data.count === 1) {
+ this.fileList = response.data.data.map(item => ({
+ name: item.HFileName,
+ url: item.HFilePath,
+ size: (item.HFileSize / 1014).toFixed(1) + 'kb',
+ status: '涓婁紶鎴愬姛',
+ type: this.getFileType(item.HFileType)
+ }));
+ }
+ })
+ .catch(error => {
+ this.$modal.msgError("鑾峰彇鏂囦欢鍒楄〃澶辫触!");
+ });
+ },
+
+ // 鑾峰彇鏂囦欢绫诲瀷
+ getFileType(fileType) {
+ if (fileType === '.jpeg' || fileType === '.jpg' || fileType === '.png') {
+ return 'image';
+ } else if (fileType === '.pdf') {
+ return 'pdf';
+ }
+ return 'other';
+ },
+
+ // 鏂囦欢涓婁紶鐩稿叧鏂规硶
+ handleRemove(file, fileList) {
+ console.log(file, fileList);
+ },
+
+ handlePreview(file) {
+ console.log(file);
+ },
+
+ handleExceed(files, fileList) {
+ this.$modal.msgWarning(`褰撳墠闄愬埗閫夋嫨 10 涓枃浠讹紝鏈閫夋嫨浜� ${files.length} 涓枃浠讹紝鍏遍�夋嫨浜� ${files.length + fileList.length} 涓枃浠禶);
+ },
+
+ beforeRemove(file, fileList) {
+ return this.$confirm(`纭畾绉婚櫎 ${file.name}锛焋);
+ },
+
+ handleUpload(index, file) {
+ // 鏂囦欢涓婁紶閫昏緫
+ this.$modal.msgInfo("鏂囦欢涓婁紶鍔熻兘寰呭紑鍙�");
+ },
+
+ handleDelete(index, file) {
+ this.$confirm('纭瑕佸垹闄よ繖涓枃浠跺悧锛�', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ this.fileList.splice(index, 1);
+ this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ });
+ },
+
+ // 鍥剧墖棰勮
+ previewImg(url) {
+ this.previewImage = url;
+ this.previewVisible = true;
+ },
+
+ handlePreviewClose() {
+ this.previewVisible = false;
+ this.previewImage = '';
+ },
+
+ // 宸ュ叿鏂规硶
+ formatDate(date) {
+ const year = date.getFullYear();
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
+ const day = date.getDate().toString().padStart(2, '0');
+ return `${year}-${month}-${day}`;
+ }
+ }
+};
+</script>
+
+<style scoped>
+.material-edit-container {
+ padding: 10px;
+}
+
+.layui-fluid {
+ width: 100%;
+}
+
+.layui-card {
+ margin-bottom: 15px;
+ border-radius: 2px;
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
+}
+
+.layui-card-header {
+ padding: 10px 15px;
+ border-bottom: 1px solid #f6f6f6;
+ background-color: #f8f8f8;
+}
+
+.layui-card-body {
+ padding: 15px;
+}
+
+.layui-btn-group {
+ margin-bottom: 0;
+}
+
+.form-section {
+ margin-top: 20px;
+}
+
+.el-form-item {
+ margin-bottom: 18px;
+}
+
+.el-row {
+ margin-bottom: 10px;
+}
+
+.upload-demo {
+ margin-bottom: 20px;
+}
+
+/* 鍝嶅簲寮忚皟鏁� */
+@media (max-width: 768px) {
+ .el-col {
+ margin-bottom: 15px;
+ }
+}
+</style>
\ No newline at end of file
--
Gitblit v1.9.1