From d1fde042e8ef3805426d09046390bd3fc9d91dd0 Mon Sep 17 00:00:00 2001
From: "271556543@qq.com" <271556543@qq.com>
Date: Mon, 15 Aug 2022 15:51:07 +0800
Subject: [PATCH] =?UTF-8?q?2022.8.15=20=E9=97=AE=E9=A2=98=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 2 +-
src/views/budget/budgetList.vue | 34 +-
.../contract/components/detailContract.vue | 2 +-
.../contract/components/editorContract.vue | 8 +-
.../components/paymentRegistration.vue | 13 +-
.../contract/components/printRegistration.vue | 4 +-
src/views/contract/contractList.vue | 33 +-
vue.config.js | 312 +++++++++---------
8 files changed, 229 insertions(+), 179 deletions(-)
diff --git a/.env.development b/.env.development
index a247152..501c589 100644
--- a/.env.development
+++ b/.env.development
@@ -2,7 +2,7 @@
ENV = 'development'
# base api
-VUE_APP_BASE_API = ''
+VUE_APP_BASE_API = 'http://hdcontract.ali251.langye.net'
#VUE_APP_OUT_URL = http://suzhouhedaooa.langye.net
VUE_APP_OUT_URL = http://192.168.60.18:2021
diff --git a/src/views/budget/budgetList.vue b/src/views/budget/budgetList.vue
index ff7cea7..362cac4 100644
--- a/src/views/budget/budgetList.vue
+++ b/src/views/budget/budgetList.vue
@@ -39,7 +39,9 @@
-
+
+
+
@@ -255,6 +257,7 @@ export default {
]
},
list:[],
+ totalMoney:0,
total:0,
pageIndex:1,
table:[
@@ -329,6 +332,30 @@ export default {
}
},
methods: {
+ //合计
+ summary(param){
+ const { columns, data } = param
+ const sums = []
+ columns.map((column,index) => {
+ if(index === 0){
+ sums[index] = '总计'
+ return
+ }
+ if(column.property === 'money'){
+ sums[index] = this.totalMoney
+ return
+ }
+ // const values = data.map(item => Number(item[column.property]));
+ // if (!values.every(value => isNaN(value)) && (column.property === 'money' || column.property === 'plan_price'|| column.property === 'fund_log_total')) {
+ //
+ // sums[index] = sums[index].toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
+ // } else {
+ // sums[index] = '';
+ // }
+ })
+ return sums
+ },
+
//翻页
pageChange(e){
this.pageIndex = e
@@ -349,8 +376,9 @@ export default {
type:this.select.type,
plan_department_id:this.select.department
}).then(res=>{
- this.list = res.data
- this.total = res.total
+ this.list = res.list.data
+ this.total = res.list.total
+ this.totalMoney = res.total_money
})
},
//新增提交
diff --git a/src/views/contract/components/detailContract.vue b/src/views/contract/components/detailContract.vue
index 4df2a1c..66c9eb2 100644
--- a/src/views/contract/components/detailContract.vue
+++ b/src/views/contract/components/detailContract.vue
@@ -316,7 +316,7 @@ export default {
return "服务"
break;
case 2:
- return "货品"
+ return "货物"
break;
case 3:
return "工程"
diff --git a/src/views/contract/components/editorContract.vue b/src/views/contract/components/editorContract.vue
index 0c71a67..3dbcd71 100644
--- a/src/views/contract/components/editorContract.vue
+++ b/src/views/contract/components/editorContract.vue
@@ -19,7 +19,7 @@
-
+
@@ -64,7 +64,7 @@
*资金渠道
-
+
@@ -279,7 +279,7 @@ export default {
type:res.type,
methods:res.purchase_type_id,
modality:res.purchase_way_id,
- fundingChannels:res.money_way_id,
+ fundingChannels:res.money_way_id.split(',').map(item =>{return Number(item)}),
price:res.plan_price,
isBudget:res.is_plan === 1 ? true : false,
plan:res.plans.map(item=>{
@@ -301,7 +301,7 @@ export default {
is_plan:this.detail.isBudget ? 1 : 0,
purchase_type_id:this.detail.methods,
purchase_way_id:this.detail.modality,
- money_way_id:this.detail.fundingChannels,
+ money_way_id:this.detail.fundingChannels.toString(),
plan_price:this.detail.price,
name:this.detail.name,
contract_plan_links:this.detail.plan.map(item=>{
diff --git a/src/views/contract/components/paymentRegistration.vue b/src/views/contract/components/paymentRegistration.vue
index 61e293c..5f5c41d 100644
--- a/src/views/contract/components/paymentRegistration.vue
+++ b/src/views/contract/components/paymentRegistration.vue
@@ -323,9 +323,16 @@ export default {
}
}
},
- async mounted() {
- await this.getBudgets()
- }
+ watch:{
+ isShowPaymentRegistration(newVal){
+ if(newVal){
+ this.getBudgets()
+ }
+ }
+ },
+ // async mounted() {
+ // await this.getBudgets()
+ // }
}
diff --git a/src/views/contract/components/printRegistration.vue b/src/views/contract/components/printRegistration.vue
index 16cbcb7..e1dcbea 100644
--- a/src/views/contract/components/printRegistration.vue
+++ b/src/views/contract/components/printRegistration.vue
@@ -33,7 +33,7 @@
E
本期应付款
- {{priceFormat(registration.apply_money)}}
+ {{priceFormat(registration.discount_money)}}
✔质保金
-
+
✔ {{registration.type}}
(其他)
diff --git a/src/views/contract/contractList.vue b/src/views/contract/contractList.vue
index d989f79..8bf3662 100644
--- a/src/views/contract/contractList.vue
+++ b/src/views/contract/contractList.vue
@@ -4,6 +4,13 @@
+
+ 关键字
+
+
+
+
+
创建日期
@@ -94,7 +101,7 @@
-
+
@@ -211,7 +218,7 @@
*资金渠道
-
+
@@ -335,6 +342,7 @@ export default {
//搜索
select:{
+ keyword:'',
showDatePicker:'',
pageIndex:1,
startDate:"",
@@ -347,7 +355,7 @@ export default {
priceMax:null,
status:""
},
- type:[{label:'服务',value:1},{label:'货品',value:2},{label:'工程',value:3}],
+ type:[{label:'服务',value:1},{label:'货物',value:2},{label:'工程',value:3}],
purchaseType: [],//购买形式
purchaseWay:[],//购买方式
moneyWay:[],//资金渠道
@@ -378,7 +386,7 @@ export default {
return "服务"
break;
case 2:
- return "货品"
+ return "货物"
break;
case 3:
return "工程"
@@ -396,7 +404,14 @@ export default {
{
label:"资金来源",
width: 120,
- prop:"money_way.value"
+ customFn:(row)=>{
+ {
+ return row.money_way_detail.map(item => {
+ return ({item.value}
)
+ })
+ }
+
+ }
},
{
label:'已付金额',
@@ -612,7 +627,7 @@ export default {
methods:"",
modality:"",
price:"",
- fundingChannels:"",
+ fundingChannels:[],
isBudget:true,
plan:[]
},
@@ -859,6 +874,7 @@ export default {
//获取合同列表
async getContracts(){
const res = await getContract({
+ keyword:this.select.keyword,
page_size:10,
page:this.select.pageIndex,
start_created_at:this.select.startDate,
@@ -908,7 +924,7 @@ export default {
},
//默认选择计划
toggleSelection(plans) {
- if (plans) {
+ if (plans && plans.length > 0) {
this.plans.filter(plan => {
return plans.includes(plan.id)
}).map(row => {
@@ -927,13 +943,12 @@ export default {
},
//提交新建
submit(){
- //console.log(this.form)
addContrant({
type:this.form.type,
is_plan:this.form.isBudget ? 1 : 0,
purchase_type_id:this.form.methods,
purchase_way_id:this.form.modality,
- money_way_id:this.form.fundingChannels,
+ money_way_id:`${this.form.fundingChannels.toString()}`,
plan_price:this.form.price,
name:this.form.name,
contract_plan_links:this.form.plan.map(item=>{
diff --git a/vue.config.js b/vue.config.js
index 6fa7378..19fa249 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,157 +1,157 @@
-'use strict'
-const path = require('path')
-const defaultSettings = require('./src/settings.js')
-
-function resolve(dir) {
- return path.join(__dirname, dir)
-}
-
-const name = defaultSettings.title || '合同业务管理系统' // page title
-
-// If your port is set to 80,
-// use administrator privileges to execute the command line.
-// For example, Mac: sudo npm run
-// You can change the port by the following methods:
-// port = 9528 npm run dev OR npm run dev --port = 9528
-const port = process.env.port || process.env.npm_config_port || 9530 // dev port
-
-// All configuration item explanations can be find in https://cli.vuejs.org/config/
-module.exports = {
- /**
- * You will need to set publicPath if you plan to deploy your site under a sub path,
- * for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
- * then publicPath should be set to "/bar/".
- * In most cases please use '/' !!!
- * Detail: https://cli.vuejs.org/config/#publicpath
- */
- publicPath: '/admin/',
- outputDir: '/Users/liuxiangyu/Work/szhedao/app/contract-business/contract-business-service/public/admin',
- assetsDir: 'static',
- lintOnSave: process.env.NODE_ENV === 'development',
- productionSourceMap: false,
- css: {
- loaderOptions: { // 向 CSS 相关的 loader 传递选项
- less: {
- javascriptEnabled: true
- }
- }
- },
- devServer: {
- port: port,
- open: true,
- overlay: {
- warnings: false,
- errors: true
- },
- //before: require('./mock/mock-server.js')
- proxy: {
- [process.env.VUE_APP_BASE_API]: {
- //target: 'http://hdcontract.ali251.langye.net',
- target: 'http://192.168.60.99:9003/',
- changeOrigin: true, //配置跨域
- pathRewrite: {
- ['^' + process.env.VUE_APP_BASE_API]: ''
- }
- },
- '/oa': {
- //target: 'http://suzhouhedaooa.langye.net',
- target: 'http://192.168.60.18:2021',
- changeOrigin: true, //配置跨域
- pathRewrite: {
- '/oa': '/'
- }
- }
- }
- },
- configureWebpack: {
- // provide the app's title in webpack's name field, so that
- // it can be accessed in index.html to inject the correct title.
- name: name,
- resolve: {
- alias: {
- '@': resolve('src')
- }
- }
- },
- chainWebpack(config) {
- // it can improve the speed of the first screen, it is recommended to turn on preload
- config.plugin('preload').tap(() => [{
- rel: 'preload',
- // to ignore runtime.js
- // https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
- fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
- include: 'initial'
- }])
-
- // when there are many pages, it will cause too many meaningless requests
- config.plugins.delete('prefetch')
-
- // set svg-sprite-loader
- config.module
- .rule('svg')
- .exclude.add(resolve('src/icons'))
- .end()
- config.module
- .rule('icons')
- .test(/\.svg$/)
- .include.add(resolve('src/icons'))
- .end()
- .use('svg-sprite-loader')
- .loader('svg-sprite-loader')
- .options({
- symbolId: 'icon-[name]'
- })
- .end()
-
- // set preserveWhitespace
- config.module
- .rule('vue')
- .use('vue-loader')
- .loader('vue-loader')
- .tap(options => {
- options.compilerOptions.preserveWhitespace = true
- return options
- })
- .end()
-
- config
- .when(process.env.NODE_ENV !== 'development',
- config => {
- config
- .plugin('ScriptExtHtmlWebpackPlugin')
- .after('html')
- .use('script-ext-html-webpack-plugin', [{
- // `runtime` must same as runtimeChunk name. default is `runtime`
- inline: /runtime\..*\.js$/
- }])
- .end()
- config
- .optimization.splitChunks({
- chunks: 'all',
- cacheGroups: {
- libs: {
- name: 'chunk-libs',
- test: /[\\/]node_modules[\\/]/,
- priority: 10,
- chunks: 'initial' // only package third parties that are initially dependent
- },
- elementUI: {
- name: 'chunk-elementUI', // split elementUI into a single package
- priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
- test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
- },
- commons: {
- name: 'chunk-commons',
- test: resolve('src/components'), // can customize your rules
- minChunks: 3, // minimum common number
- priority: 5,
- reuseExistingChunk: true
- }
- }
- })
- // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
- config.optimization.runtimeChunk('single')
- }
- )
- }
+'use strict'
+const path = require('path')
+const defaultSettings = require('./src/settings.js')
+
+function resolve(dir) {
+ return path.join(__dirname, dir)
+}
+
+const name = defaultSettings.title || '合同业务管理系统' // page title
+
+// If your port is set to 80,
+// use administrator privileges to execute the command line.
+// For example, Mac: sudo npm run
+// You can change the port by the following methods:
+// port = 9528 npm run dev OR npm run dev --port = 9528
+const port = process.env.port || process.env.npm_config_port || 9530 // dev port
+
+// All configuration item explanations can be find in https://cli.vuejs.org/config/
+module.exports = {
+ /**
+ * You will need to set publicPath if you plan to deploy your site under a sub path,
+ * for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
+ * then publicPath should be set to "/bar/".
+ * In most cases please use '/' !!!
+ * Detail: https://cli.vuejs.org/config/#publicpath
+ */
+ publicPath: '/admin/',
+ outputDir: '/Users/liuxiangyu/Work/szhedao/app/contract-business/contract-business-service/public/admin',
+ assetsDir: 'static',
+ lintOnSave: process.env.NODE_ENV === 'development',
+ productionSourceMap: false,
+ css: {
+ loaderOptions: { // 向 CSS 相关的 loader 传递选项
+ less: {
+ javascriptEnabled: true
+ }
+ }
+ },
+ devServer: {
+ port: port,
+ open: true,
+ overlay: {
+ warnings: false,
+ errors: true
+ },
+ //before: require('./mock/mock-server.js')
+ proxy: {
+ [process.env.VUE_APP_BASE_API]: {
+ target: 'http://hdcontract.ali251.langye.net',
+ //target: 'http://192.168.60.99:9003/',
+ changeOrigin: true, //配置跨域
+ pathRewrite: {
+ ['^' + process.env.VUE_APP_BASE_API]: ''
+ }
+ },
+ '/oa': {
+ //target: 'http://suzhouhedaooa.langye.net',
+ target: 'http://192.168.60.18:2021',
+ changeOrigin: true, //配置跨域
+ pathRewrite: {
+ '/oa': '/'
+ }
+ }
+ }
+ },
+ configureWebpack: {
+ // provide the app's title in webpack's name field, so that
+ // it can be accessed in index.html to inject the correct title.
+ name: name,
+ resolve: {
+ alias: {
+ '@': resolve('src')
+ }
+ }
+ },
+ chainWebpack(config) {
+ // it can improve the speed of the first screen, it is recommended to turn on preload
+ config.plugin('preload').tap(() => [{
+ rel: 'preload',
+ // to ignore runtime.js
+ // https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
+ fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
+ include: 'initial'
+ }])
+
+ // when there are many pages, it will cause too many meaningless requests
+ config.plugins.delete('prefetch')
+
+ // set svg-sprite-loader
+ config.module
+ .rule('svg')
+ .exclude.add(resolve('src/icons'))
+ .end()
+ config.module
+ .rule('icons')
+ .test(/\.svg$/)
+ .include.add(resolve('src/icons'))
+ .end()
+ .use('svg-sprite-loader')
+ .loader('svg-sprite-loader')
+ .options({
+ symbolId: 'icon-[name]'
+ })
+ .end()
+
+ // set preserveWhitespace
+ config.module
+ .rule('vue')
+ .use('vue-loader')
+ .loader('vue-loader')
+ .tap(options => {
+ options.compilerOptions.preserveWhitespace = true
+ return options
+ })
+ .end()
+
+ config
+ .when(process.env.NODE_ENV !== 'development',
+ config => {
+ config
+ .plugin('ScriptExtHtmlWebpackPlugin')
+ .after('html')
+ .use('script-ext-html-webpack-plugin', [{
+ // `runtime` must same as runtimeChunk name. default is `runtime`
+ inline: /runtime\..*\.js$/
+ }])
+ .end()
+ config
+ .optimization.splitChunks({
+ chunks: 'all',
+ cacheGroups: {
+ libs: {
+ name: 'chunk-libs',
+ test: /[\\/]node_modules[\\/]/,
+ priority: 10,
+ chunks: 'initial' // only package third parties that are initially dependent
+ },
+ elementUI: {
+ name: 'chunk-elementUI', // split elementUI into a single package
+ priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
+ test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
+ },
+ commons: {
+ name: 'chunk-commons',
+ test: resolve('src/components'), // can customize your rules
+ minChunks: 3, // minimum common number
+ priority: 5,
+ reuseExistingChunk: true
+ }
+ }
+ })
+ // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
+ config.optimization.runtimeChunk('single')
+ }
+ )
+ }
}