| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- <template>
- <el-card shadow="hover">
- <el-form v-model="params" class="full-width" label-width="120px">
- <div class="flex flex-center">
- <div class="flex flex-center mt-15 mr-10">
- <el-form-item label="关键字" class="full-width">
- <el-input
- v-model="params.name"
- placeholder="输入合同关键字"
- prefix-icon="Search"
- clearable
- />
- </el-form-item>
- <el-form-item label="业务联系人" class="full-width">
- <el-input
- v-model="params.contacts"
- placeholder="输入业务联系人"
- prefix-icon="Search"
- clearable
- />
- </el-form-item>
- <el-form-item class="full-width" label="合同状态">
- <el-select v-model="params.status" clearable>
- <el-option
- v-for="item in dicList"
- :key="item.dictKey"
- :label="item.dictValue"
- :value="item.dictKey"
- />
- </el-select>
- </el-form-item>
- </div>
- <div class="flex flex-justify-end ml-20">
- <base-button type="0" title="重置" icon="Refresh" @click="clearUp" />
- <base-button class="ml-20" @click="onLoad" />
- </div>
- </div>
- </el-form>
- <avue-crud
- :option="option"
- :data="data"
- ref="crud"
- v-model="form"
- v-model:page="page"
- :before-open="beforeOpen"
- @row-del="rowDel"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- >
- <template #title="{ row }">
- <div>{{ row.fileFolder.title }}</div>
- </template>
- <template #menu-left>
- <div class="flex flex-center">
- <div class="main-color ml-10 mr-20 bold font-15">金额单位:万元</div>
- <filepicker
- btn-text="新增合同"
- :project-id="projectId"
- @submit="selection"
- />
- </div>
- </template>
- </avue-crud>
- </el-card>
- </template>
- <route>
- {
- name: '合同管理',
- meta: { layout: 'empty','path':'/resource','title':'资料管理','showMsg' :
- "请先通过资料管理,在对应的相关合同类别下上传合同文件,系统将自动识别所有相关文件并展示在以下列表中。"}
- }
- </route>
- <script>
- import BaseButton from '@/components/base-button.vue'
- import filepicker from '@/components/filepicker/index.vue'
- export default {
- components: { BaseButton, filepicker },
- data() {
- return {
- projectId: '',
- form: {},
- data: [],
- option: {
- align: 'center',
- menuAlign: 'center',
- menuWidth: 100,
- size: 'mini',
- addBtn: false,
- editBtn: false,
- viewBtn: true,
- delBtn: true,
- columnBtn: false,
- labelWidth: 140,
- border: true,
- column: [
- {
- label: '合同名称',
- prop: 'title',
- slot: true,
- width: 180,
- fixed: true
- },
- {
- label: '合同编号',
- prop: 'number'
- },
- {
- label: '合同金额',
- prop: 'amount'
- },
- {
- label: '已付金额',
- prop: 'paymentAmount'
- },
- {
- label: '未付金额',
- prop: 'notPaymentAmount'
- },
- {
- label: '业务联系人',
- prop: 'contacts',
- width: 100
- },
- {
- label: '签订乙方',
- prop: 'partyB',
- width: 180
- },
- {
- label: '签订日期',
- prop: 'signTime',
- width: 110
- },
- {
- label: '合同状态',
- prop: 'contractsStatus',
- width: 90,
- dicUrl:
- '/api/blade-system/dict-biz/dictionary?code=contract-status',
- props: {
- label: 'dictValue',
- value: 'dictKey'
- }
- },
- {
- label: '到期日期',
- prop: 'expireTime',
- width: 110
- }
- ]
- },
- page: {
- size: 10,
- current: 1
- },
- dicList: [],
- typelist: [],
- params: {
- name: '',
- status: '',
- type: ''
- }
- }
- },
- created() {
- this.projectId = this.$route.query.id
- this.getDic('contract-status')
- this.getDic('contract-type')
- this.onLoad()
- },
- methods: {
- getDic(code) {
- this.$api.common.dicList({ code }).then(res => {
- if (res.code === 200) {
- if (code === 'contract-status') {
- this.dicList = res.data
- } else if (code === 'contract-type') {
- this.typelist = res.data
- }
- }
- })
- },
- onLoad() {
- this.loading = true
- const data = Object.assign(this.params, { projectId: this.projectId })
- this.$api.contract
- .contractList(Object.assign(this.page, data))
- .then(res => {
- this.data = res.data.records.map(ele => {
- if (ele.contractsStatus === -1) {
- ele.contractsStatus = ''
- }
- if (ele.type === -1) {
- ele.type = ''
- }
- return ele
- })
- this.page.total = res.data.total
- })
- .finally(() => {
- this.loading = false
- })
- },
- clearUp() {
- this.params.name = ''
- this.params.status = ''
- this.params.type = ''
- this.onLoad()
- },
- beforeOpen(done, type) {
- if (type === 'view') {
- const data = this.$router.resolve({
- path: '/contract/detail',
- query: { id: this.form.id }
- })
- window.open(data.href, '_blank')
- }
- },
- rowDel(row, index, done) {
- this.$confirm('确定将选择数据删除?', {
- type: 'warning'
- }).then(res => {
- console.log(res)
- if (res === 'confirm') {
- this.$api.contract.contractRemove({ ids: row.id }).then(res => {
- if (res.code === 200) {
- this.$message.success(res.msg)
- this.onLoad()
- } else {
- this.$message.error(res.msg)
- }
- })
- }
- })
- },
- currentChange(currentPage) {
- this.page.current = currentPage
- },
- sizeChange(pageSize) {
- this.page.size = pageSize
- },
- refreshChange() {
- this.onLoad()
- },
- selection(list) {
- const tmps = list.map(ele => {
- return {
- fileId: ele.id,
- projectId: ele.projectId,
- title: ele.title
- }
- })
- this.$api.contract.linkContract(tmps).then(res => {
- if (res.code === 200) {
- this.refreshChange()
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped></style>
|