Browse Source

货币管理,供应商分组管理前端页面的完成

master
常熟吴彦祖 2 weeks ago
committed by qiankanghui
parent
commit
0c4a4233ad
  1. 2
      config/index.js
  2. 4
      index.html
  3. 207
      package-lock.json
  4. 5
      src/api/srm/srmSupplier.js
  5. 13
      src/views/main-navbar.vue
  6. 94
      src/views/modules/srmBaseInformation/srmSupplierAddress.vue
  7. 350
      src/views/modules/srmBaseInformation/srmSupplierCurrency.vue
  8. 489
      src/views/modules/srmBaseInformation/srmSupplierGroup.vue
  9. 1247
      src/views/modules/srmSupplier/supplierList.vue

2
config/index.js

@ -24,7 +24,7 @@ module.exports = {
// Various Dev Server settings // Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST host: 'localhost', // can be overwritten by process.env.HOST
port: 8090, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
port: 8091, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: true, autoOpenBrowser: true,
errorOverlay: true, errorOverlay: true,
notifyOnErrors: true, notifyOnErrors: true,

4
index.html

@ -4,13 +4,13 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Checkpoint SRM</title>
<title>KRD SRM</title>
<% if (process.env.NODE_ENV === 'production') { %> <% if (process.env.NODE_ENV === 'production') { %>
<!-- 生产环境 --> <!-- 生产环境 -->
<script>document.write('<script src="./config/index.js?t=' + new Date().getTime() + '"><\/script>');</script> <script>document.write('<script src="./config/index.js?t=' + new Date().getTime() + '"><\/script>');</script>
<% }else { %> <% }else { %>
<!-- 开发环境 --> <!-- 开发环境 -->
<link rel="shortcut icon" type="image/x-icon" href="./static/img/favicon.ico">
<link rel="shortcut icon" type="image/x-icon" href="./static/img/avatar.png">
<script src="./static/config/index.js"></script> <script src="./static/config/index.js"></script>
<script src="./static/plugins/mock-1.0.0-beta3/mock-min.js"></script> <script src="./static/plugins/mock-1.0.0-beta3/mock-min.js"></script>
<script src="./static/plugins/echarts-3.8.5/echarts.common.min.js"></script> <script src="./static/plugins/echarts-3.8.5/echarts.common.min.js"></script>

207
package-lock.json

@ -194,6 +194,12 @@
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
"dev": true "dev": true
}, },
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"string-width": { "string-width": {
"version": "5.1.2", "version": "5.1.2",
"resolved": "https://registry.npmmirror.com/string-width/-/string-width-5.1.2.tgz", "resolved": "https://registry.npmmirror.com/string-width/-/string-width-5.1.2.tgz",
@ -205,6 +211,40 @@
"strip-ansi": "^7.0.1" "strip-ansi": "^7.0.1"
} }
}, },
"string-width-cjs": {
"version": "npm:string-width@4.2.3",
"resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
},
"emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
"strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1"
}
}
}
},
"strip-ansi": { "strip-ansi": {
"version": "7.1.2", "version": "7.1.2",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-7.1.2.tgz", "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-7.1.2.tgz",
@ -214,6 +254,23 @@
"ansi-regex": "^6.0.1" "ansi-regex": "^6.0.1"
} }
}, },
"strip-ansi-cjs": {
"version": "npm:strip-ansi@6.0.1",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
}
}
},
"wrap-ansi": { "wrap-ansi": {
"version": "8.1.0", "version": "8.1.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz", "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
@ -224,6 +281,60 @@
"string-width": "^5.0.1", "string-width": "^5.0.1",
"strip-ansi": "^7.0.1" "strip-ansi": "^7.0.1"
} }
},
"wrap-ansi-cjs": {
"version": "npm:wrap-ansi@7.0.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
"string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
}
},
"strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1"
}
}
}
} }
} }
}, },
@ -18789,40 +18900,6 @@
"strip-ansi": "^3.0.0" "strip-ansi": "^3.0.0"
} }
}, },
"string-width-cjs": {
"version": "npm:string-width@4.2.3",
"resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1"
}
}
}
},
"string.prototype.trim": { "string.prototype.trim": {
"version": "1.2.10", "version": "1.2.10",
"resolved": "https://registry.npmmirror.com/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", "resolved": "https://registry.npmmirror.com/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz",
@ -18874,23 +18951,6 @@
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
}, },
"strip-ansi-cjs": {
"version": "npm:strip-ansi@6.0.1",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
}
}
},
"strip-bom": { "strip-bom": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmmirror.com/strip-bom/-/strip-bom-2.0.0.tgz", "resolved": "https://registry.npmmirror.com/strip-bom/-/strip-bom-2.0.0.tgz",
@ -22410,51 +22470,6 @@
"strip-ansi": "^3.0.1" "strip-ansi": "^3.0.1"
} }
}, },
"wrap-ansi-cjs": {
"version": "npm:wrap-ansi@7.0.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"dependencies": {
"ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
},
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
}
},
"strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.1"
}
}
}
},
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz", "resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz",

5
src/api/srm/srmSupplier.js

@ -44,3 +44,8 @@ export const updatePaymentProposal = (data) => createAPI(`/srmPaymentProposal/sa
export const getProposalOssList = (data) => createAPI(`/srmPaymentProposal/getProposalOssList`, 'post', data) export const getProposalOssList = (data) => createAPI(`/srmPaymentProposal/getProposalOssList`, 'post', data)
export const removeOssFile = (data) => createAPI(`/oss/remove`, 'post', data) export const removeOssFile = (data) => createAPI(`/oss/remove`, 'post', data)
export const submitForApprovalPaymentProposal = (data) => createAPI(`/srmPaymentProposal/submitForApprovalPaymentProposal`, 'post', data) export const submitForApprovalPaymentProposal = (data) => createAPI(`/srmPaymentProposal/submitForApprovalPaymentProposal`, 'post', data)
//------supplier management--------------
export const createSrmSupplier = (data) => createAPI(`/srmSupplier/createSrmSupplier`, 'post', data)
export const updateSrmSupplier = (data) => createAPI(`/srmSupplier/updateSrmSupplier`, 'post', data)
export const deleteSrmSupplier = (id) => createAPI(`/srmSupplier/deleteSrmSupplier`, 'post', { id: id })

13
src/views/main-navbar.vue

@ -52,7 +52,7 @@
<el-menu-item class="site-navbar__avatar" index="4"> <el-menu-item class="site-navbar__avatar" index="4">
<el-dropdown :show-timeout="0" placement="bottom"> <el-dropdown :show-timeout="0" placement="bottom">
<span class="el-dropdown-link custom-avatar"> <span class="el-dropdown-link custom-avatar">
<img src="~@/assets/img/ckp.png" :alt="userName">{{ userName }}
<img src="~@/assets/img/xujie.png" :alt="userName">{{ userName }}
<!-- <img src="~@/assets/img/avatar.png" :alt="userName">{{ userName }}--> <!-- <img src="~@/assets/img/avatar.png" :alt="userName">{{ userName }}-->
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
@ -71,7 +71,7 @@
<el-dialog append-to-body top="26vh" :show-close="false" :close-on-click-modal="true" v-drag :visible.sync="revisionModalFlag" width="335px"> <el-dialog append-to-body top="26vh" :show-close="false" :close-on-click-modal="true" v-drag :visible.sync="revisionModalFlag" width="335px">
<div slot="title" style="text-align: center"> <div slot="title" style="text-align: center">
<img src="~@/assets/img/ckp.png" style="width: 115px;height: 45px;vertical-align: middle;object-fit: contain;">
<img src="~@/assets/img/xujie.png" style="width: 115px;height: 45px;vertical-align: middle;object-fit: contain;">
<!-- <img src="~@/assets/img/avatar.png" style="width: 115px;height: 45px;vertical-align: middle;object-fit: contain;">--> <!-- <img src="~@/assets/img/avatar.png" style="width: 115px;height: 45px;vertical-align: middle;object-fit: contain;">-->
</div> </div>
<div style="display: flex;justify-content: space-between;"> <div style="display: flex;justify-content: space-between;">
@ -139,8 +139,8 @@ export default {
message: this.$t('language.name'), message: this.$t('language.name'),
languageList: [], languageList: [],
pageLanguage: { pageLanguage: {
XjSysManage: 'Checkpoint',
abbreviation: 'Checkpoint',
XjSysManage: 'Xujie',
abbreviation: 'Xujie',
setting: '设置', setting: '设置',
languageSetting: '语言设置', languageSetting: '语言设置',
userSetting: '用户设置', userSetting: '用户设置',
@ -458,8 +458,9 @@ export default {
}, },
}, },
created() { created() {
this.getLanguageList()
this.getFunctionButtonList()
//
// this.getLanguageList()
// this.getFunctionButtonList()
this.favoriteIsOk() this.favoriteIsOk()
} }
} }

94
src/views/modules/srmBaseInformation/srmSupplierAddress.vue

@ -0,0 +1,94 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -10px;">
<el-button @click="getData()" type="primary" style="margin-left: 2px;margin-top: 33px">{{buttons.search}}</el-button>
</el-form>
<el-table
:height="height"
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</a>
<a type="text" size="small" @click="deleteHandle(scope.row.id)">删除</a>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
min-width="20%"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import {} from "@/api/sysLanguage.js"
export default {
name: "null",
data() {
return {
height: 200,
dataList:[],
dataListLoading: false,
buttons:{
search:'查询',
},
columnList: [
{
userId: this.$store.state.user.name,
functionId: 9002,
serialNumber: '9002tBlbasedataId',
tableId: "9002Blbasedata",
tableName: "工厂信息表",
columnProp: "id",
headerAlign: "center",
align: "left",
columnLabel: "工厂id",
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50
},
],
}
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 240;
})
},
methods: {},
created() {
}
}
</script>
<style scoped>
</style>

350
src/views/modules/srmBaseInformation/srmSupplierCurrency.vue

@ -0,0 +1,350 @@
<template>
<div class="mod-config">
<!-- 查询条件 -->
<el-form :inline="true" label-position="top" :model="searchData">
<el-form-item label="货币代码">
<el-input v-model="searchData.currency" clearable style="width: 120px" placeholder="货币代码"></el-input>
</el-form-item>
<el-form-item label="货币描述">
<el-input v-model="searchData.currencyDesc" clearable style="width: 160px" placeholder="货币描述"></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="searchData.active" clearable placeholder="状态" style="width: 120px">
<el-option label="启用" value="Y"></el-option>
<el-option label="禁用" value="N"></el-option>
</el-select>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="getDataList()">查询</el-button>
<el-button type="primary" @click="addModal()">新增</el-button>
</el-form-item>
</el-form>
<!-- 主表 -->
<el-table
:height="height"
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
prop="currency"
header-align="center"
align="left"
width="120"
label="货币代码">
</el-table-column>
<el-table-column
prop="currencyDesc"
header-align="center"
align="left"
min-width="150"
label="货币描述"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="site"
header-align="center"
align="center"
width="120"
label="站点">
</el-table-column>
<el-table-column
prop="active"
header-align="center"
align="center"
width="100"
label="状态">
<template slot-scope="scope">
<span>{{ scope.row.active === 'Y' ? '启用' : '禁用' }}</span>
</template>
</el-table-column>
<el-table-column
prop="baseCurrency"
header-align="center"
align="center"
width="120"
label="基础货币">
<template slot-scope="scope">
<span>{{ scope.row.baseCurrency === 'Y' ? '是' : '否' }}</span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="120"
label="操作">
<template slot-scope="scope">
<el-link style="cursor: pointer" @click="updateModal(scope.row)">编辑 |</el-link>
<el-link style="cursor: pointer" @click="deleteHandle(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 新增/修改对话框 -->
<el-dialog :title="modalTitle" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="415px">
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" ref="modalForm" style="margin-left: 7px;">
<el-form-item label="货币代码" prop="currency" :rules="rules.currency">
<el-input v-model="modalData.currency" :disabled="modalDisableFlag" style="width: 100px"></el-input>
</el-form-item>
<el-form-item label="状态" prop="active">
<el-select v-model="modalData.active" style="width: 100px">
<el-option label="启用" value="Y"></el-option>
<el-option label="禁用" value="N"></el-option>
</el-select>
</el-form-item>
<el-form-item label="基础货币" prop="baseCurrency">
<el-select v-model="modalData.baseCurrency" style="width: 100px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;">
<el-form-item label="货币描述" prop="currencyDesc" :rules="rules.currencyDesc">
<el-input v-model="modalData.currencyDesc" style="width: 325px"></el-input>
</el-form-item>
<el-form-item label="站点" prop="site" :rules="rules.site" v-if="modalData.flag === '2'">
<el-input v-model="modalData.site" disabled style="width: 325px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="saveData()">保存</el-button>
<el-button type="primary" @click="modalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>
</template>
<script>
import { srmCurrencyApi } from '@/api/srm/srmCurrency.js'
export default {
name: "srmSupplierCurrency",
data() {
return {
height: 300,
dataList:[],
dataListLoading: false,
pageIndex: 1,
pageSize: 20,
totalPage: 0,
searchData: {
currency: '',
currencyDesc: '',
active: '',
baseCurrency: '',
site: this.$store.state.user.site
},
modalFlag: false,
modalTitle: '',
modalDisableFlag: false,
isEdit: false,
modalData: {
currency: '',
currencyDesc: '',
site: this.$store.state.user.site,
active: 'Y',
baseCurrency: 'N'
},
rules: {
currency: [
{ required: true, message: '请输入货币代码', trigger: 'blur' }
],
currencyDesc: [
{ required: true, message: '请输入货币描述', trigger: 'blur' }
],
site: [
{ required: true, message: '请输入站点', trigger: 'blur' }
],
active: [
{ required: true, message: '请选择状态', trigger: 'change' }
],
baseCurrency: [
{ required: true, message: '请选择是否基础货币', trigger: 'change' }
]
},
}
},
mounted() {
this.$nextTick(() => {
this.height = window.innerHeight - 240;
})
//
this.getDataList()
},
methods: {
//
getDataList() {
this.dataListLoading = true
const params = {
...this.searchData,
page: this.pageIndex,
limit: this.pageSize
}
srmCurrencyApi.getCurrencyListWithPaging(params).then(({data}) => {
if (data && data.code === 0) {
const pageData = data.data || data.page
this.dataList = pageData && pageData.list ? pageData.list : pageData
if(pageData && pageData.currPage) {
this.pageIndex = pageData.currPage
this.pageSize = pageData.pageSize
this.totalPage = pageData.totalCount
} else {
this.totalPage = this.dataList ? this.dataList.length : 0
}
} else {
this.$message.error(data.msg || '获取数据失败')
}
}).catch(error => {
console.error('获取货币列表失败:', error)
this.$message.error('获取数据失败: ' + (error.message || '网络错误'))
}).finally(() => {
this.dataListLoading = false
})
},
//
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
//
addModal() {
this.modalTitle = '新增货币'
this.isEdit = false
this.modalDisableFlag = false
this.modalData = {
currency: '',
currencyDesc: '',
site: this.$store.state.user.site || this.$store.state.user.currentSite || '', //
active: 'Y',
baseCurrency: 'N',
flag: '1'
}
this.$nextTick(() => {
if (this.$refs.modalForm) {
this.$refs.modalForm.clearValidate()
}
})
this.modalFlag = true
},
//
updateModal(row) {
this.modalTitle = '修改货币'
this.isEdit = true
this.modalDisableFlag = true
this.modalData = {
currency: row.currency,
currencyDesc: row.currencyDesc,
site: row.site,
active: row.active,
baseCurrency: row.baseCurrency
}
this.$nextTick(() => {
if (this.$refs.modalForm) {
this.$refs.modalForm.clearValidate()
}
})
this.modalFlag = true
},
//
saveData() {
this.$refs.modalForm.validate((valid) => {
if (valid) {
const saveData = { ...this.modalData }
let apiCall
if (this.modalData.flag === '1') {
apiCall = srmCurrencyApi.addCurrency(saveData)
} else {
apiCall = srmCurrencyApi.updateCurrency(saveData)
}
apiCall.then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500
})
// onclose
this.modalFlag = false
this.getDataList()
} else {
this.$message.error(data.msg || '操作失败')
}
}).catch(error => {
console.error('保存货币失败:', error)
this.$message.error('保存失败: ' + (error.message || '网络错误'))
})
} else {
return false
}
})
},
//
deleteHandle(row) {
this.$confirm(`确定删除此货币吗?货币代码:${row.currency}`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const params = {
currency: row.currency,
site: row.site
}
srmCurrencyApi.deleteCurrency(params).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500
})
// onclose
this.getDataList()
} else {
this.$message.error(data.msg || '删除失败')
}
}).catch(error => {
console.error('删除货币失败:', error)
this.$message.error('删除失败: ' + (error.message || '网络错误'))
})
}).catch(() => {
this.$message.info('已取消删除')
})
}
}
}
</script>
<style scoped>
.mod-config {
padding: 20px;
}
</style>

489
src/views/modules/srmBaseInformation/srmSupplierGroup.vue

@ -0,0 +1,489 @@
<template>
<div class="mod-config">
<el-form :inline="true" label-position="top" :model="searchData">
<el-form-item label="供应商分组代码">
<el-input v-model="searchData.supplierGroup" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="供应商分组描述">
<el-input v-model="searchData.groupDesc" clearable style="width: 200px"></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="searchData.active" clearable style="width: 120px">
<el-option label="启用" value="Y"></el-option>
<el-option label="禁用" value="N"></el-option>
</el-select>
</el-form-item>
<el-form-item label=" ">
<el-button v-if="authSearch" type="primary" @click="getDataList()">查询</el-button>
<el-button v-if="authSave" type="primary" @click="addModal()">新增</el-button>
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px">导出</el-button>
</el-form-item>
</el-form>
<el-table
:height="height"
:data="dataList"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">
<span v-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span>
<span v-else>
{{ scope.row[item.columnProp] }}
</span>
</span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="120"
label="操作">
<template slot-scope="scope">
<el-link style="cursor: pointer" v-if="authUpdate" @click="updateModal(scope.row)">编辑 |</el-link>
<el-link style="cursor: pointer" v-if="authDelete" @click="deleteSupplierGroup(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
<!-- 分页栏 -->
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<el-dialog title="供应商分组" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="415px">
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;">
<el-form-item label="供应商分组代码" prop="supplierGroup" :rules="rules.supplierGroup">
<el-input v-model="modalData.supplierGroup" :disabled="modalDisableFlag" style="width: 100px"></el-input>
</el-form-item>
<el-form-item label="分组类型" prop="groupType">
<el-select v-model="modalData.groupType" style="width: 100px">
<el-option label="Group1" value="Y"></el-option>
<el-option label="Group2" value="N"></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="active">
<el-select v-model="modalData.active" style="width: 100px">
<el-option label="启用" value="Y"></el-option>
<el-option label="禁用" value="N"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;">
<el-form-item label="供应商分组描述" prop="groupDesc" :rules="rules.groupDesc">
<el-input v-model="modalData.groupDesc" style="width: 325px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="saveData()">保存</el-button>
<el-button type="primary" @click="modalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
</div>
</template>
<script>
import {
getSupplierGroupList,
addSupplierGroup,
updateSupplierGroup,
deleteSupplierGroup
} from "@/api/srm/srmGroup.js"
import excel from "@/utils/excel-util.js";
export default {
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.supplierGroup = this.searchData.supplierGroup.toUpperCase()
}
},
modalData: {
deep: true,
handler: function (newV, oldV) {
this.modalData.supplierGroup = this.modalData.supplierGroup.toUpperCase()
}
}
},
data () {
return {
columnsProp:['createdBy','updateBy','status'],
//
exportName: "供应商分组" + this.dayjs().format('YYYYMMDDHHmmss'),
searchData: {
site: '',
supplierGroup: '',
groupDesc: '',
active: '',
groupType: '',
page: 1,
limit: 10,
},
height: 200,
pageIndex: 1,
pageSize: 20,
totalPage: 0,
dataList: [],
modalFlag: false,
modalDisableFlag: false,
modalData: {
supplierGroup: '',
groupDesc: '',
site: '',
active: '',
groupType: '',
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name
},
//
columnList: [
{
userId: this.$store.state.user.name,
functionId: '812001',
serialNumber: '812001TableSupplierGroup',
tableId: '812001Table',
tableName: "供应商分组表",
columnProp: 'supplierGroup',
headerAlign: "center",
align: "center",
columnLabel: '供应商分组代码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: '812001',
serialNumber: '812001TableGroupDesc',
tableId: "812001Table",
tableName: "供应商分组表",
columnProp: 'groupDesc',
headerAlign: "center",
align: "left",
columnLabel: '供应商分组描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200,
},
{
userId: this.$store.state.user.name,
functionId: '812001',
serialNumber: '812001TableGroupType',
tableId: "812001Table",
tableName: "供应商分组表",
columnProp: 'groupType',
headerAlign: "center",
align: "left",
columnLabel: '分组类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
{
userId: this.$store.state.user.name,
functionId: '812001',
serialNumber: '812001TableActive',
tableId: "812001Table",
tableName: "供应商分组表",
columnProp: 'active',
headerAlign: "center",
align: "center",
columnLabel: '状态',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
}
],
rules: {
supplierGroup: [
{
required: true,
message: '请输入供应商分组代码',
trigger: ['blur','change']
}
],
groupDesc: [
{
required: true,
message: '请输入供应商分组描述',
trigger: ['blur','change']
}
],
site: [
{
required: false,
message: '请输入Site',
trigger: ['blur','change'],
validator: (rule, value, callback) => {
if (this.modalData.flag === '2' && (!value || value === '')) {
callback(new Error('编辑时请输入Site'))
} else {
callback()
}
}
}
]
},
authSearch: false,
authSave: false,
authUpdate: false,
authDelete: false,
menuId: this.$route.meta.menuId || 'srmGroup',
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 180
})
},
created () {
//
this.getButtonAuthData()
//
this.getDataList()
},
methods: {
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
async exportExcel() {
const params = {
...this.searchData,
limit: -1,
page: 1
};
excel.exportTable({
url: "/srmGroup/getSupplierGroupList",
columnMapping: this.columnList,
mergeSetting: [],
params: params,
fileName: this.exportName + ".xlsx",
// rowsexcel
rowFetcher: res => {
if (res && res.data && res.data.code === 0) {
return { rows: res.data.data || [] };
}
return { rows: [] };
},
columnFormatter: [],
dropColumns: [],
});
},
//
getDataList () {
//
const params = {
...this.searchData,
page: this.pageIndex,
limit: this.pageSize
};
getSupplierGroupList(params).then(({data}) => {
if (data && data.code === 0) {
const pageData = data.data || data.page;
this.dataList = pageData && pageData.list ? pageData.list : pageData;
if(pageData && pageData.currPage) {
this.pageIndex = pageData.currPage;
this.pageSize = pageData.pageSize;
this.totalPage = pageData.totalCount;
} else {
//
this.totalPage = this.dataList ? this.dataList.length : 0;
}
} else {
this.$message.error(data.msg || '获取数据失败')
}
}).catch(error => {
console.error('获取供应商分组列表失败:', error)
this.$message.error('获取数据失败: ' + (error.message || '网络错误'))
})
},
addModal () {
this.modalData = {
supplierGroup: '',
groupDesc: '',
site: this.$store.state.user.currentSite || '', // 使
active: 'Y',
groupType: 'Group1',
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
flag: '1'
}
this.modalDisableFlag = false
this.modalFlag = true
},
updateModal (row) {
this.modalData = {
supplierGroup: row.supplierGroup,
groupDesc: row.groupDesc,
site: row.site,
active: row.active,
groupType: row.groupType,
createBy: row.createBy,
updateBy: this.$store.state.user.name,
flag: '2'
}
this.modalDisableFlag = true
this.modalFlag = true
},
//
deleteSupplierGroup (row) {
this.$confirm(`确定删除此供应商分组吗?分组代码:${row.supplierGroup}`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const deleteData = {
supplierGroup: row.supplierGroup,
site: row.site
};
deleteSupplierGroup(deleteData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(error => {
console.error('删除供应商分组失败:', error)
this.$message.error('删除失败: ' + (error.message || '网络错误'))
})
}).catch(() => {
this.$message.info('已取消删除')
})
},
saveData () {
if (this.modalData.supplierGroup === '' || this.modalData.supplierGroup == null) {
this.$message.warning('请输入供应商分组代码!')
return
}
if (this.modalData.groupDesc === '' || this.modalData.groupDesc == null) {
this.$message.warning('请输入供应商分组描述!')
return
}
if (this.modalData.flag === '1') {
addSupplierGroup(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(error => {
console.error('保存供应商分组失败:', error)
this.$message.error('保存失败: ' + (error.message || '网络错误'))
})
} else {
updateSupplierGroup(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(error => {
console.error('更新供应商分组失败:', error)
this.$message.error('更新失败: ' + (error.message || '网络错误'))
})
}
},
//
getButtonAuthData () {
let searchFlag = this.isAuth(this.menuId+":search")
let saveFlag = this.isAuth(this.menuId+":save")
let updateFlag = this.isAuth(this.menuId+":update")
let deleteFlag = this.isAuth(this.menuId+":delete")
//
this.authSearch = !searchFlag
this.authSave = !saveFlag
this.authUpdate = !updateFlag
this.authDelete = !deleteFlag
},
}
}
</script>
<style scoped lang="scss">
.el-table /deep/ .cell{
height: auto;
line-height: 1.5;
}
</style>

1247
src/views/modules/srmSupplier/supplierList.vue
File diff suppressed because it is too large
View File

Loading…
Cancel
Save