Browse Source

部门管理

master
蔡玲玲 4 weeks ago
parent
commit
4e71b99606
  1. 4
      base-vue/package.json
  2. 5
      base-vue/src/main.js
  3. 6
      base-vue/src/views/common/home.vue
  4. 20
      base-vue/src/views/modules/contract/contract.vue
  5. 117
      base-vue/src/views/modules/contract/temp-add.vue
  6. 40
      base-vue/src/views/modules/sys/dept-add-or-update.vue
  7. 16
      base-vue/src/views/modules/sys/dept.vue

4
base-vue/package.json

@ -22,7 +22,7 @@
"bpmn-js-properties-panel": "^0.33.0",
"camunda-bpmn-moddle": "^4.3.0",
"echarts": "^5.4.2",
"element-ui": "2.8.2",
"element-ui": "^2.15.14",
"gulp": "4.0.2",
"gulp-concat": "2.6.1",
"gulp-load-plugins": "2.0.5",
@ -53,7 +53,7 @@
"babel-preset-stage-2": "6.22.0",
"babel-register": "6.22.0",
"chalk": "2.3.0",
"chromedriver": "2.27.2",
"chromedriver": "^2.27.2",
"copy-webpack-plugin": "4.0.1",
"cross-spawn": "5.0.1",
"css-loader": "0.28.0",

5
base-vue/src/main.js

@ -3,9 +3,9 @@ import App from '@/App'
import router from '@/router' // api: https://github.com/vuejs/vue-router
import store from '@/store' // api: https://github.com/vuejs/vuex
import VueCookie from 'vue-cookie' // api: https://github.com/alfhen/vue-cookie
import '@/element-ui' // api: https://github.com/ElemeFE/element
import ElementUI from 'element-ui'
import '@/icons' // api: http://www.iconfont.cn/
import '@/element-ui-theme'
import 'element-ui/lib/theme-chalk/index.css'
import '@/assets/scss/index.scss'
import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
import { isAuth } from '@/utils'
@ -23,6 +23,7 @@ import './style/bpmn-custom-color.css' // 导入自定义的样式文件
Vue.prototype.$echarts = echarts;
Vue.use(VueCookie)
Vue.use(ElementUI)
Vue.config.productionTip = false
// 非生产环境, 适配mockjs模拟数据 // api: https://github.com/nuysoft/Mock

6
base-vue/src/views/common/home.vue

@ -101,6 +101,8 @@ export default {
marker: null,
keyword: "",
local: null,
dataListLoading: false,
dataListSelections: [],
dataList:[]
};
},
@ -115,6 +117,10 @@ export default {
this.dataList = data.notices
}
})
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
}
},
mounted(){

20
base-vue/src/views/modules/contract/contract.vue

@ -98,8 +98,8 @@
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="assignHandle(scope.row.id)">模板生成</el-button>
<el-button type="text" size="small">上传附</el-button>
<el-button type="text" size="small" @click="addTempHandle(scope.row.id)">模板生成</el-button>
<el-button type="text" size="small">上传附</el-button>
</template>
</el-table-column>
</el-table>
@ -114,14 +114,17 @@
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<temp-add v-if="tempVisible" ref="tempAdd"></temp-add>
</div>
</template>
<script>
import AddOrUpdate from './contract-add-or-update'
import TempAdd from './temp-add'
export default {
components: {
AddOrUpdate
AddOrUpdate,
TempAdd
},
data () {
return {
@ -136,7 +139,8 @@ export default {
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
addOrUpdateVisible: false,
tempVisible: false
}
},
activated () {
@ -187,7 +191,13 @@ export default {
this.$refs.addOrUpdate.init(id)
})
},
assignHandle (id) {}
//
addTempHandle (id) {
this.tempVisible = true
this.$nextTick(() => {
this.$refs.tempAdd.init(id)
})
}
}
}
</script>

117
base-vue/src/views/modules/contract/temp-add.vue

@ -0,0 +1,117 @@
<template>
<el-dialog
title="产品供应合同"
:close-on-click-modal="false"
:visible.sync="visible">
<section class="content">
<el-descriptions :column="2">
<el-descriptions-item label="需方">kooriookami</el-descriptions-item>
<el-descriptions-item label="合同编号">18100000000</el-descriptions-item>
<el-descriptions-item label="供方">上海诺力智能科技有限公司</el-descriptions-item>
<el-descriptions-item label="签订时间">2025年1月14日</el-descriptions-item>
</el-descriptions>
<h2>产品明细单</h2>
<el-table
:data="dataList"
border
style="width: 100%;">
<el-table-column
type="index"
width="50"/>
<el-table-column
prop="materialCode"
header-align="center"
align="center"
label="物料编号"/>
<el-table-column
prop="materialName"
header-align="center"
align="center"
label="物料名称"/>
<el-table-column
prop="materialName"
header-align="center"
align="center"
label="型号"/>
<el-table-column
prop="materialName"
header-align="center"
align="center"
label="数量"/>
<el-table-column
prop="materialName"
header-align="center"
align="center"
label="单位"/>
<el-table-column
prop="materialName"
header-align="center"
align="center"
label="单价(元)"/>
<el-table-column
prop="materialName"
header-align="center"
align="center"
label="总价(元)"/>
<el-table-column
prop="materialName"
header-align="center"
align="center"
label="备注"/>
</el-table>
<el-row>
<el-col :span="12">共计人民币金额大写 XXXXXXX</el-col>
<el-col :span="12">含13%增值税</el-col>
</el-row>
<p class="tip_p">质量要求技术标准供方对质量负责的条件和期限:技术标准符合行业标准</p>
<p class="tip_p">售后服务:保修期6个月人为造成的损坏不在质保范围内</p>
<p class="tip_p">交货时间地点:货期:待定;交货地:待客户通知</p>
<p class="tip_p">运输方式及到达站和费用负担:由供方负担</p>
<p class="tip_p">包装标准:按国内标准包装</p>
<p class="tip_p">结算方式:款到发货付款方式:电汇</p>
<p class="tip_p">违约责任:中华人民共和国民法典执行</p>
<p class="tip_p">解决合同纠纷的方式:买卖双方首先友好协商解决协商不成任何一方均可向有管辖权法院起诉</p>
<p class="tip_p">其它约定事项:合同扫描件有效签字盖章之日起生效</p>
<el-descriptions direction="vertical" :column="2" border>
<el-descriptions-item label="需方">
<div>单位名称:</div>
<div>地址:</div>
<div>委托代理电话:</div>
<div>传真:</div>
<div>开户银行:</div>
<div>帐号:</div>
</el-descriptions-item>
<el-descriptions-item label="供方">
<div>单位名称:上海诺力智能科技有限公司(盖章)</div>
<div>地址:上海青浦区徐泾镇高光路215弄99号4号楼302室</div>
<div>委托代理电话:</div>
<div>传真:</div>
<div>开户银行:招商银行虹桥支行</div>
<div>帐号:12191702501091</div>
</el-descriptions-item>
</el-descriptions>
</section>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataList: []
}
},
methods: {
init (id) {
this.visible = true
},
//
dataFormSubmit () {}
}
}
</script>

40
base-vue/src/views/modules/sys/dept-add-or-update.vue

@ -21,9 +21,9 @@
<el-row>
<el-col :span="12">
<el-form-item label="顶级部门" prop="isTop">
<el-radio-group v-model="dataForm.isTop" style="width: 140px">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
<el-radio-group v-model="dataForm.isTop" style="width: 140px" @change="handleChange">
<el-radio :label="'1'"></el-radio>
<el-radio :label="'0'"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -68,10 +68,8 @@
name: null,
deptSort: 999,
isTop: '1',
isUsed: true
// ext_id: null,
// sub_count: 0,
// pid: null
isUsed: true,
pid: null
},
depts: [],
dataRule: {
@ -88,20 +86,20 @@
Treeselect
},
methods: {
handleChange () {
this.$forceUpdate()
},
init (row) {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (row) {
this.dataForm = {...row}
// if (this.dataForm.pid !== null) {
// this.dataForm.isTop = '0'
// } else {
// this.dataForm.isTop = '1'
// }
if (this.dataForm.pid != null) {
if (this.dataForm.pid !== null) {
this.dataForm.isTop = '0'
this.getSupDepts(this.dataForm.pid)
} else {
this.dataForm.isTop = '1'
this.getDepts()
}
}
@ -124,7 +122,7 @@
if (data.children) {
this.buildDepts(data.children)
}
if (data.has_children && !data.children) {
if (data.hasChildren && !data.children) {
data.children = null
}
})
@ -133,25 +131,33 @@
this.$http({
url: this.$http.adornUrl('/api/dept/vo'),
method: 'get',
params: this.$http.adornParams({is_used: true})
params: this.$http.adornParams({isUsed: true})
}).then(({data}) => {
if (data && data.code === 200) {
this.depts = data.content.map(function(obj) {
if (obj.has_children) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
console.log(this.depts)
}
})
},
normalizer(node) {
return {
id: node.deptId,
label: node.name,
children: node.children
}
},
//
loadDepts({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
this.$http({
url: this.$http.adornUrl('/api/dept/vo'),
method: 'get',
params: this.$http.adornParams({is_used: true, pid: parentNode.dept_id})
params: this.$http.adornParams({isUsed: true, pid: parentNode.deptId})
}).then(({res}) => {
parentNode.children = res.content.map(function(obj) {
obj.children = null

16
base-vue/src/views/modules/sys/dept.vue

@ -19,7 +19,7 @@
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('sys:dept:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('sys:dept:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
<el-button v-if="isAuth('sys:dept:delete')" type="danger" @click="deleteHandle(1)" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
@ -80,7 +80,7 @@
label="操作">
<template slot-scope="scope">
<el-button v-if="isAuth('sys:dept:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row)">修改</el-button>
<el-button v-if="isAuth('sys:dept:delete')" type="text" size="small" @click="deleteHandle(scope.row.deptId)">删除</el-button>
<el-button v-if="isAuth('sys:dept:delete')" type="text" size="small" @click="deleteHandle(2, scope.row.deptId)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -104,8 +104,8 @@ export default {
data () {
return {
dataForm: {
name: '',
isUsed: ''
name: null,
isUsed: null
},
enabledTypeOptions: [
{ key: true, displayName: '启用' },
@ -136,7 +136,7 @@ export default {
params: this.$http.adornParams({
'page': this.pageIndex,
'size': this.pageSize,
'sort': 'id,desc',
'sort': 'create_time',
'name': this.dataForm.name,
'isUsed': this.dataForm.isUsed
})
@ -174,11 +174,11 @@ export default {
})
},
//
deleteHandle (id) {
deleteHandle (type, id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.deptId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
this.$confirm(type === 1 ? `确认删除选中的${this.dataListSelections.length}条数据?` : '确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@ -186,7 +186,7 @@ export default {
this.$http({
url: this.$http.adornUrl('/api/dept'),
method: 'DELETE',
data: this.$http.adornData(ids)
data: ids
}).then(({data}) => {
if (data && data.code === 200) {
this.$message({

Loading…
Cancel
Save