|
@@ -1,223 +0,0 @@
|
|
|
-<template>
|
|
|
- <div>
|
|
|
- <div class="bottom">
|
|
|
- <div class="file-box">
|
|
|
- <file-item :isDownLoad="false" :isDelete="true" :itemStyle="itemDrawerStyle" :fileData="upload_panl.attinfos"
|
|
|
- @deleteSuccess="deleteSuccess"></file-item>
|
|
|
- </div>
|
|
|
- <upload slot="upload" :folderid="folderid"
|
|
|
- :bindData="{ ownertable: idname.slice(0, idname.length - 2), ownerid: data[idname], usetype: '' }"
|
|
|
- @onSuccess="queryAttments"></upload>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import FileItem from '@/components/file-block/index'
|
|
|
-import upload from '@/components/upload/hw_obs_upload.vue'
|
|
|
-export default {
|
|
|
- props:['data'],
|
|
|
- name: 'SubmiteditItemInfo',
|
|
|
- data() {
|
|
|
- return {
|
|
|
- isFileInfoPanlShow: false,
|
|
|
- itemDrawerStyle: {
|
|
|
- img: {
|
|
|
- width: 53,
|
|
|
- height: 64
|
|
|
- },
|
|
|
- title: 16,
|
|
|
- descript: 12
|
|
|
- },
|
|
|
- };
|
|
|
- },
|
|
|
- components: {
|
|
|
- FileItem,
|
|
|
- upload
|
|
|
- },
|
|
|
- computed: {
|
|
|
- },
|
|
|
- watch: {
|
|
|
-
|
|
|
- },
|
|
|
- methods: {
|
|
|
- actionSubmit() {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- async save() {
|
|
|
- //新增
|
|
|
- if (this.param.content.content == '' && this.detailData.istextrequired == 1) {
|
|
|
- return this.$notify({
|
|
|
- title: '提示',
|
|
|
- message: '请编辑内容',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- }
|
|
|
- if (this.upload_panl.attinfos.length == 0 && this.detailData.isattrequired == 1) {
|
|
|
- return this.$notify({
|
|
|
- title: '提示',
|
|
|
- message: '请上传附件',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- }
|
|
|
- this.param.content.sat_submiteditmodelid = this.upload_panl.sat_submiteditmodelid
|
|
|
- this.param.content.sat_submiteditid = this.editData ? this.editData.sat_submiteditid : this.upload_panl.sat_submiteditid
|
|
|
-
|
|
|
- if (this.editData) {
|
|
|
- let res = await this.$api.requested(this.param).then(res => {
|
|
|
- this.tool.showMessage(res, async () => {
|
|
|
- this.upload_panl = ''
|
|
|
- this.param.content.content = ''
|
|
|
- this.param = {
|
|
|
- "classname": "saletool.submitedit.submitedit",
|
|
|
- "method": "insertorupdate",
|
|
|
- "content": {
|
|
|
- "sat_submiteditmodelid": "",
|
|
|
- "content": "",
|
|
|
- "sat_submiteditid": "0"
|
|
|
- }
|
|
|
- }
|
|
|
- this.$api.requested({
|
|
|
- "classname": "saletool.submitedit.submitedit",
|
|
|
- "method": "sub_submitdetailed",
|
|
|
- "content": {
|
|
|
- "onceonly": this.$route.query.type == 'more' ? 1 : 0,
|
|
|
- "sat_submiteditmodelid": res.data.sat_submiteditmodelid,
|
|
|
- "sat_submiteditid": res.data.sat_submiteditid
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- if (res.code == 1) {
|
|
|
- this.$parent.getDetailData()
|
|
|
- this.isFileInfoPanlShow = false
|
|
|
- if (this.$route.query.type != 'more') {
|
|
|
- this.disabled = true
|
|
|
- window.sessionStorage.setItem('history', 1)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
- } else {
|
|
|
- let res = await this.$api.requested(this.param)
|
|
|
- this.upload_panl.status = '发布'
|
|
|
- this.tool.showMessage(res, async () => {
|
|
|
- //提交提报明细
|
|
|
- let param2 = {
|
|
|
- "classname": "saletool.submitedit.submitedit",
|
|
|
- "method": "sub_submitdetailed",
|
|
|
- "content": {
|
|
|
- "onceonly": this.$route.query.type == 'more' ? 1 : 0,
|
|
|
- "sat_submiteditmodelid": this.detailData.sat_submiteditmodelid,
|
|
|
- "sat_submiteditid": this.upload_panl.sat_submiteditid
|
|
|
- }
|
|
|
- }
|
|
|
- let res = await this.$api.requested(param2)
|
|
|
- if (res.code != 1) return console.log('错误');
|
|
|
- this.upload_panl.status = '发布'
|
|
|
- this.upload_panl.attinfos = null
|
|
|
- this.param = {
|
|
|
- "classname": "saletool.submitedit.submitedit",
|
|
|
- "method": "insertorupdate",
|
|
|
- "content": {
|
|
|
- "sat_submiteditmodelid": "",
|
|
|
- "content": "",
|
|
|
- "sat_submiteditid": "0"
|
|
|
- }
|
|
|
- }
|
|
|
- if (this.$route.query.type != 'more') {
|
|
|
- this.disabled = true
|
|
|
- window.sessionStorage.setItem('history', 1)
|
|
|
- }
|
|
|
- this.isFileInfoPanlShow = false
|
|
|
- this.$parent.getDetailData()
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- async onSuccess(id) {
|
|
|
- this.fileId = id
|
|
|
- let param = {
|
|
|
- "classname": "system.attachment.Attachment",
|
|
|
- "method": "createFileLink",
|
|
|
- "content": {
|
|
|
- "ownertable": "sat_submitedit",
|
|
|
- "ownerid": this.editData ? this.editData.sat_submiteditid : this.upload_panl.sat_submiteditid,
|
|
|
- "usetype": "default",
|
|
|
- "attachmentids": [
|
|
|
- id
|
|
|
- ]
|
|
|
- }
|
|
|
- }
|
|
|
- let res = await this.$api.requested(param)
|
|
|
- this.tool.showMessage(res, () => {
|
|
|
- this.upload_panl.attinfos = this.fileType.fileList(this.upload_panl.attinfos.concat(res.data[0]))
|
|
|
- })
|
|
|
- },
|
|
|
- deleteSuccess(data) {
|
|
|
- this.editData ? this.editData.attinfos.splice(data, 1) : this.upload_panl.attinfos.splice(data, 1)
|
|
|
- }
|
|
|
- },
|
|
|
-};
|
|
|
-</script>
|
|
|
-
|
|
|
-<style scoped>
|
|
|
-* {
|
|
|
- box-sizing: border-box;
|
|
|
-}
|
|
|
-
|
|
|
-/deep/ .el-drawer__header {
|
|
|
- margin-bottom: 0;
|
|
|
-}
|
|
|
-
|
|
|
-/deep/ .el-drawer {
|
|
|
- width: 546px !important;
|
|
|
-}
|
|
|
-
|
|
|
-.el-drawer__body .btn1 {
|
|
|
- margin: 20px 0 20px 20px;
|
|
|
- width: 88px;
|
|
|
- height: 36px;
|
|
|
- background: #fa8c16;
|
|
|
-}
|
|
|
-
|
|
|
-.el-drawer__body .content {
|
|
|
- border-bottom: 10px solid #fafafa;
|
|
|
- padding: 0 0 20px 20px;
|
|
|
-}
|
|
|
-
|
|
|
-.el-drawer__body .content p:first-child {
|
|
|
- font-size: 16px;
|
|
|
- font-weight: bold;
|
|
|
- color: #333333;
|
|
|
- margin-bottom: 20px;
|
|
|
-}
|
|
|
-
|
|
|
-.el-drawer .file-box p {
|
|
|
- margin: 20px 0 20px 0;
|
|
|
- font-size: 16px;
|
|
|
- font-weight: bold;
|
|
|
- color: #333333;
|
|
|
- margin-bottom: 20px;
|
|
|
-}
|
|
|
-
|
|
|
-.el-drawer .file-box .file {
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
-}
|
|
|
-
|
|
|
-.upload {
|
|
|
- display: flex;
|
|
|
- margin-top: 20px;
|
|
|
-}
|
|
|
-
|
|
|
-/deep/.upload .el-button {
|
|
|
- width: 100%;
|
|
|
- border: 1px solid #3874f6;
|
|
|
- color: #3874f6;
|
|
|
-}
|
|
|
-
|
|
|
-.bottom {
|
|
|
- padding: 0 20px;
|
|
|
-}
|
|
|
-</style>
|