|
|
@@ -1,15 +1,186 @@
|
|
|
<template>
|
|
|
<wt-card title="前期情况" class="mt-10">
|
|
|
- <div v-watermark:[text]="33">info2</div>
|
|
|
+ <div class="flex flex-justify-start full-width mt-15">
|
|
|
+ <avue-crud
|
|
|
+ :option="option"
|
|
|
+ :data="data"
|
|
|
+ ref="crud"
|
|
|
+ v-model="form"
|
|
|
+ :before-open="beforeOpen"
|
|
|
+ @row-del="rowDel"
|
|
|
+ @refresh-change="refreshChange"
|
|
|
+ @row-save="rowSave"
|
|
|
+ @row-update="rowUpdate"
|
|
|
+ >
|
|
|
+ <template #menu-left>
|
|
|
+ <div class="flex flex-center">
|
|
|
+ <filepicker
|
|
|
+ :project-id="info.id"
|
|
|
+ :command="dictList"
|
|
|
+ @submit="selection"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </div>
|
|
|
</wt-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import wtCard from '@/components/wt-card/index.vue'
|
|
|
+import filepicker from '@/components/filepicker/index.vue'
|
|
|
|
|
|
export default {
|
|
|
- components: {
|
|
|
- wtCard
|
|
|
+ components: { wtCard, filepicker },
|
|
|
+ props: {
|
|
|
+ info: {
|
|
|
+ type: Object,
|
|
|
+ default: null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {},
|
|
|
+ data: [],
|
|
|
+ option: {
|
|
|
+ align: 'center',
|
|
|
+ menuAlign: 'center',
|
|
|
+ menuWidth: 180,
|
|
|
+ size: 'mini',
|
|
|
+ addBtn: false,
|
|
|
+ editBtn: false,
|
|
|
+ viewBtn: true,
|
|
|
+ delBtn: true,
|
|
|
+ columnBtn: false,
|
|
|
+ labelWidth: 140,
|
|
|
+ border: true,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: '文件名称',
|
|
|
+ prop: 'title',
|
|
|
+ fixed: true,
|
|
|
+ width: 400
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '文号',
|
|
|
+ prop: 'amount'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '上传人',
|
|
|
+ prop: 'contacts',
|
|
|
+ width: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '上传时间',
|
|
|
+ prop: 'partyB'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ page: {
|
|
|
+ size: 10,
|
|
|
+ current: 1
|
|
|
+ },
|
|
|
+ dictList: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getDic('traffic')
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getDic(code) {
|
|
|
+ this.$api.common.dicList({ code }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ if (code === 'traffic') {
|
|
|
+ this.dictList = res.data.map(e => {
|
|
|
+ return { label: e.dictValue, value: e.dictKey }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ this.loading = true
|
|
|
+ const data = Object.assign({
|
|
|
+ projectId: this.projectId,
|
|
|
+ stageId: this.stageId
|
|
|
+ })
|
|
|
+ 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
|
|
|
+ })
|
|
|
+ },
|
|
|
+ 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, command, extra) {
|
|
|
+ console.log(command, extra)
|
|
|
+ const tmps = list.map(ele => {
|
|
|
+ return {
|
|
|
+ fileId: ele.fileId,
|
|
|
+ projectId: ele.projectId,
|
|
|
+ pid: ele.id,
|
|
|
+ type: command.value
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$api.project.linkFile(tmps).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.refreshChange()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ moreContract() {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/contract',
|
|
|
+ query: { id: this.projectId }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|