Преглед изворни кода

Merge branch 'orangeUrgent' into testToMerge

qymljy пре 1 година
родитељ
комит
a54f28614f

+ 1 - 1
src/HDrpManagement/projectChange/modules/modules/contract/components/add.vue

@@ -399,7 +399,7 @@ export default {
         "rec_contactsid":'',//收货联系人
         'phonenumber':'',
         'paytype':'',
-        'reminddays':'',
+        'reminddays':'7',
         "source":1
       },
       rules: {

+ 90 - 5
src/HManagement/task/modules/add.vue

@@ -96,12 +96,29 @@
                 </el-popover>
               </el-form-item>
             </el-col>
+            <el-col :span="24">
+              <el-form-item  :label="$t(`上传附件`)+':'">
+                <uploadFile
+                    @uploadGet="loading = true"
+                    ref="uploadRef"
+                    class="inline-16"
+                    :folderid="folderid"
+                    :bindData="{
+                    ownertable: 'sys_task',
+                    ownerid: ownerid,
+                    usetype: 'default',
+                  }"
+                    :ownerid="ownerid"
+                    @onSuccess="uploadSuccess"
+                ></uploadFile>
+              </el-form-item>
+            </el-col>
           </el-form>
         </el-row>
       </div>
       <div class="fixed__btn__panel">
-        <el-button size="small" style="width:120px" @click="onClose">{{$t('取 消')}}</el-button>
-        <el-button type="primary" size="small" style="width:120px" @click="validateInput">{{$t('确 定')}}</el-button>
+        <el-button size="small" style="width:120px" @click="dialogTableVisible = false" :disabled="loading">{{$t('取 消')}}</el-button>
+        <el-button type="primary" size="small" style="width:120px" @click="validateInput" :loading="loading">{{$t('确 定')}}</el-button>
       </div>
     </el-drawer>
     <applicationData ref="applicationRef" @selectApplication="selectApplication"></applicationData>
@@ -114,13 +131,15 @@ import member from '@/template/menber/index.vue'
 import upload from '@/components/upload/preview_upload.vue';
 import applicationData from "@/HManagement/task/components/applicationData";
 import followData from "@/HManagement/task/components/followData";
+import uploadFile from "@/template/upload/index";
 export default {
 	props:['ownertable'],
 	components:{
 		upload,
 		member,
     applicationData,
-    followData
+    followData,
+    uploadFile
 	},
 	data () {
 		return {
@@ -181,7 +200,12 @@ export default {
           "ownertable": "",
           "ownerid": ""
         },
-      }
+      },
+      attachmentids:[],
+      loading:false,
+      ownerid: "000001",
+      listFile:[],
+      linksids:[]
 		}
 	},
 	methods:{
@@ -224,6 +248,7 @@ export default {
           "usetype": 'default',
         }
         this.$refs['upload'].toUpload()*/
+        this.batchBinding(res.data.sys_taskid)
         this.$emit('onSuccess')
 				this.dialogTableVisible = false
 				this.onClose()
@@ -273,7 +298,13 @@ export default {
       this.assist = []
       this.leaderShow = false
       this.assistShow = false
+      this.$refs.uploadRef.listFile = []
+      this.$refs.uploadRef.filelist = []
+      this.$refs.uploadRef.count = 0
+      this.$refs.uploadRef.oldCount = 0
+      this.$refs.uploadRef.$refs.uploadMy.clearFiles()
       this.$refs.form.resetFields()
+      this.batchDeletion()
     },
     selectApplication(ownerid,ownertable,data){
       this.followParam.content.ownertable = ownertable
@@ -301,7 +332,61 @@ export default {
         this.form.remarks = '跟进类型:'+ data.followupmode+'\n'+ content
       }
 
-    }
+    },
+    async uploadSuccess(res1){
+      this.listFile = []
+      this.attachmentids = res1.data.attachmentids
+      const res = await this.$api.requested({
+        classname: "system.attachment.Attachment",
+        method: "queryFileLink",
+        content: {
+          ownertable: "sys_task",
+          ownerid: this.ownerid,
+          usetype: "",
+        },
+      });
+      this.$refs.uploadRef.listFile = res.data.map((item) => {
+        return {
+          name: item.document,
+          url: item.url,
+          linksid: item.linksid,
+          attachmentid:item.attachmentid
+        };
+      });
+      this.listFile = this.$refs.uploadRef.listFile
+      this.loading = false;
+    },
+    /*批量绑定*/
+    async batchBinding(id){
+      this.attachmentids = []
+      this.listFile.forEach((item,index)=>{
+        this.attachmentids[index] = item.attachmentid
+      })
+      const res = await this.$api.requested({
+        "classname": "system.attachment.Attachment",
+        "method": "createFileLink",
+        "content": {
+          "ownertable": "sys_task",
+          "ownerid": id,
+          "usetype": "default",
+          "attachmentids": this.attachmentids
+        }
+      })
+    },
+    /*批量删除*/
+    async batchDeletion(){
+      this.linksids = []
+      this.listFile.forEach((item,index)=>{
+        this.linksids[index] = item.linksid
+      })
+      const res = await this.$api.requested({
+        "classname": "system.attachment.Attachment",
+        "method": "deleteFileLink",
+        "content": {
+          "linksids": this.linksids
+        }
+      })
+    },
 	}
 }
 

+ 12 - 11
src/components/marketingExpenses/index.vue

@@ -27,7 +27,7 @@
         type="primary"
         size="small"
         @click="addClick"
-        v-if="tool.checkAuth($route.name,'marketingExpenses')"
+        v-if="tool.checkAuth($route.name,'marketingExpenses') && userid == useridLogin"
       >{{$t(`新增费用明细`)}}</el-button>
       <el-table
         :data="list"
@@ -37,55 +37,55 @@
         :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}"
         height="calc(100vh - 600px)"
       >
-        <el-table-column width="200" :label="$t(`单号`)">
+        <el-table-column min-width="200" :label="$t(`单号`)">
           <template slot-scope="scope">
             <span style="margin-left: 10px">{{ scope.row.billno?scope.row.billno:'--' }}</span>
           </template>
         </el-table-column>
-        <el-table-column width="150" :label="$t(`业务员`)">
+        <el-table-column min-width="150" :label="$t(`业务员`)">
           <template slot-scope="scope">
             <span style="margin-left: 10px">{{ scope.row.name?scope.row.name:'--' }}</span>
           </template>
         </el-table-column>
-        <el-table-column width="150" :label="$t(`部门`)">
+        <el-table-column min-width="150" :label="$t(`部门`)">
           <template slot-scope="scope">
             <span style="margin-left: 10px">{{ scope.row.depname?scope.row.depname:'--' }}</span>
           </template>
         </el-table-column>
-        <el-table-column width="200" :label="$t(`客户名称`)">
+        <el-table-column min-width="200" :label="$t(`客户名称`)">
           <template slot-scope="scope">
             <span
               style="margin-left: 10px"
             >{{ scope.row.enterprisename?scope.row.enterprisename:'--' }}</span>
           </template>
         </el-table-column>
-        <el-table-column width="200" :label="$t(`项目名称`)">
+        <el-table-column min-width="200" :label="$t(`项目名称`)">
           <template slot-scope="scope">
             <span style="margin-left: 10px">{{ scope.row.projectname?scope.row.projectname:'--' }}</span>
           </template>
         </el-table-column>
-        <el-table-column width="150" :label="$t(`联系人`)">
+        <el-table-column min-width="150" :label="$t(`联系人`)">
           <template slot-scope="scope">
             <span style="margin-left: 10px">{{ scope.row.names?scope.row.names:'--' }}</span>
           </template>
         </el-table-column>
-        <el-table-column width="200" :label="$t(`费用类型`)">
+        <el-table-column min-width="200" :label="$t(`费用类型`)">
           <template slot-scope="scope">
             <span
               style="margin-left: 10px"
             >{{ scope.row.feestypefullname?scope.row.feestypefullname:'--' }}</span>
           </template>
         </el-table-column>
-        <el-table-column width="200" :label="$t(`营销费用(元)`)">
+        <el-table-column min-width="200" :label="$t(`营销费用(元)`)">
           <template slot-scope="scope">
             <span style="margin-left: 10px">{{ scope.row.amount?scope.row.amount:'--' }}</span>
           </template>
         </el-table-column>
         <el-table-column
-          width="120"
+          min-width="120"
           :label="$t(`操作`)"
           fixed="right"
-          v-if="tool.checkAuth($route.name,'marketingExpenses')"
+          v-if="tool.checkAuth($route.name,'marketingExpenses') && userid == useridLogin"
         >
           <template slot-scope="scope">
             <el-button type="text" class="inline-16" @click="editClick(scope.row)">{{$t(`编辑`)}}</el-button>
@@ -159,6 +159,7 @@ export default {
   data() {
     return {
       dialogVisible: false,
+      useridLogin:JSON.parse(sessionStorage.getItem('active_account')).userid,
       list: [],
       param: {
         id: 20240629082704,

+ 92 - 7
src/components/normal-basic-layout-new/details/modules/task/addTask.vue

@@ -100,12 +100,29 @@
                 </el-popover>
               </el-form-item>
             </el-col>
+            <el-col :span="24">
+              <el-form-item  :label="$t(`上传附件`)+':'">
+                <uploadFile
+                    @uploadGet="loading = true"
+                    ref="uploadRef"
+                    class="inline-16"
+                    :folderid="folderid"
+                    :bindData="{
+                    ownertable: 'sys_task',
+                    ownerid: ownerid,
+                    usetype: 'default',
+                  }"
+                    :ownerid="ownerid"
+                    @onSuccess="uploadSuccess"
+                ></uploadFile>
+              </el-form-item>
+            </el-col>
           </el-form>
         </el-row>
       </div>
       <div class="fixed__btn__panel">
-        <el-button size="small" style="width:120px" @click="onCancel">{{$t('取 消')}}</el-button>
-        <el-button type="primary" size="small" style="width:120px" @click="validateInput">{{$t('确 定')}}</el-button>
+        <el-button size="small" style="width:120px" @click="onCancel" :disabled="loading">{{$t('取 消')}}</el-button>
+        <el-button type="primary" size="small" style="width:120px" @click="validateInput" :loading="loading">{{$t('确 定')}}</el-button>
       </div>
     </el-drawer>
     <followData v-if="typeTask !== '' && typeTask !== undefined" ref="followRef" :param="followParam" @follow="follow"></followData>
@@ -118,12 +135,14 @@ import member from '@/template/menber/index'
 import upload from '@/components/upload/preview_upload.vue';
 
 import followData from "@/HManagement/task/components/followData";
+import uploadFile from "@/template/upload/index";
 export default {
 	props:['ownertable','status','typeTask','followData','ownerid'],
 	components:{
 		upload,
 		member,
-    followData
+    followData,
+    uploadFile
 	},
 	data () {
 		return {
@@ -196,7 +215,12 @@ export default {
           "ownertable": "",
           "ownerid": ""
         },
-      }
+      },
+      attachmentids:[],
+      loading:false,
+      ownerid: "000001",
+      listFile:[],
+      linksids:[]
 		}
 	},
 	methods:{
@@ -280,6 +304,7 @@ export default {
           "usetype": 'default',
         }
         this.$refs['upload'].toUpload()*/
+        this.batchBinding(res.data.sys_taskid)
         this.$emit('onSuccess',this.ownertable,this.ownerid)
 				this.dialogTableVisible = false
 				this.refresh()
@@ -290,8 +315,8 @@ export default {
 		refresh () {
 			this.form = {
 				"sys_taskid":0,
-        "title":'任务标题',
-        "remarks":'任务说明',
+        "title":'',
+        "remarks":'',
         "starttime":"",
         "remindday":0,
         "ownertable":"",
@@ -327,6 +352,12 @@ export default {
       this.leaderShow = false
       this.dialogTableVisible = false
       this.form.remarks = ''
+      this.$refs.uploadRef.listFile = []
+      this.$refs.uploadRef.filelist = []
+      this.$refs.uploadRef.count = 0
+      this.$refs.uploadRef.oldCount = 0
+      this.$refs.uploadRef.$refs.uploadMy.clearFiles()
+      this.batchDeletion()
     },
     follow(content,type,contacts){
       if (this.typeTask === '我的客户' || this.typeTask === '项目商机' || this.typeTask === '公海客户' || this.ownertable === 'sys_enterprise_contacts' || this.ownertable === 'sa_project_contacts'){
@@ -350,7 +381,61 @@ export default {
         this.form.remarks = content
       }
 
-    }
+    },
+    async uploadSuccess(res1){
+      this.listFile = []
+      this.attachmentids = res1.data.attachmentids
+      const res = await this.$api.requested({
+        classname: "system.attachment.Attachment",
+        method: "queryFileLink",
+        content: {
+          ownertable: "sys_task",
+          ownerid: this.ownerid,
+          usetype: "",
+        },
+      });
+      this.$refs.uploadRef.listFile = res.data.map((item) => {
+        return {
+          name: item.document,
+          url: item.url,
+          linksid: item.linksid,
+          attachmentid:item.attachmentid
+        };
+      });
+      this.listFile = this.$refs.uploadRef.listFile
+      this.loading = false;
+    },
+    /*批量绑定*/
+    async batchBinding(id){
+      this.attachmentids = []
+      this.listFile.forEach((item,index)=>{
+        this.attachmentids[index] = item.attachmentid
+      })
+      const res = await this.$api.requested({
+        "classname": "system.attachment.Attachment",
+        "method": "createFileLink",
+        "content": {
+          "ownertable": "sys_task",
+          "ownerid": id,
+          "usetype": "default",
+          "attachmentids": this.attachmentids
+        }
+      })
+    },
+    /*批量删除*/
+    async batchDeletion(){
+      this.linksids = []
+      this.listFile.forEach((item,index)=>{
+        this.linksids[index] = item.linksid
+      })
+      const res = await this.$api.requested({
+        "classname": "system.attachment.Attachment",
+        "method": "deleteFileLink",
+        "content": {
+          "linksids": this.linksids
+        }
+      })
+    },
 		/*onCancel (done) {
       console.log("关闭")
       this.assistShow = false

+ 1 - 1
src/components/normal-basic-layout/details/index.vue

@@ -89,7 +89,7 @@
           </tabTemp>
           <slot name="custom"></slot>
         </el-col>
-        <el-col v-if="collapse" style="width:400px;" :span="6">
+        <el-col v-if="collapse"  :span="6">
           <taskTemp ref="task" v-if="activeApp.istask" :status="status" :disabled="disabled" :ownertable="ownertable?ownertable:idname.slice(0, this.idname.length - 2)" :typeTask="typeTask" :editData="editData" :idname="idname">
             <el-button slot="collapse" type="text" icon="el-icon-s-unfold" class="inline-16" @click="onCollapse"></el-button>
           </taskTemp>

+ 1 - 1
src/components/normal-basic-layout/details/modules/followUp/followUp.vue

@@ -88,7 +88,7 @@
           </div>
           <div style="padding: 0 10px 10px 10px">
             <div class="flex-align-center flex-between pionter" v-for="img in i.attinfos" :key="img.index" style="padding:10px;margin-bottom:5px;border: 1px solid #ccc">
-              <div class="flex-align-center" style="flex:1;width:100%;">
+              <div class="flex-align-center" style="flex:1;width:90%;">
                 <img width="30" :src="checkFileType(img.postfix) === 'file'?require('@/assets/file_icons/file.svg'):img.url" class="inline-16" alt="">
                 <div class="file__link">
                   <a :href="img.url">{{img.document}}</a>

+ 92 - 7
src/components/normal-basic-layout/details/modules/task/addTask.vue

@@ -100,12 +100,29 @@
                 </el-popover>
               </el-form-item>
             </el-col>
+            <el-col :span="24">
+              <el-form-item  :label="$t(`上传附件`)+':'">
+                <uploadFile
+                    @uploadGet="loading = true"
+                    ref="uploadRef"
+                    class="inline-16"
+                    :folderid="folderid"
+                    :bindData="{
+                    ownertable: 'sys_task',
+                    ownerid: ownerid,
+                    usetype: 'default',
+                  }"
+                    :ownerid="ownerid"
+                    @onSuccess="uploadSuccess"
+                ></uploadFile>
+              </el-form-item>
+            </el-col>
           </el-form>
         </el-row>
       </div>
       <div class="fixed__btn__panel">
-        <el-button size="small" style="width:120px" @click="onCancel">{{$t('取 消')}}</el-button>
-        <el-button type="primary" size="small" style="width:120px" @click="validateInput">{{$t('确 定')}}</el-button>
+        <el-button size="small" style="width:120px" @click="onCancel" :disabled="loading">{{$t('取 消')}}</el-button>
+        <el-button type="primary" size="small" style="width:120px" @click="validateInput" :loading="loading">{{$t('确 定')}}</el-button>
       </div>
     </el-drawer>
     <followData v-if="typeTask !== '' && typeTask !== undefined" ref="followRef" :param="followParam" @follow="follow"></followData>
@@ -118,12 +135,14 @@ import member from '@/template/menber/index'
 import upload from '@/components/upload/preview_upload.vue';
 
 import followData from "@/HManagement/task/components/followData";
+import uploadFile from "@/template/upload/index";
 export default {
 	props:['ownertable','status','typeTask','followData','disabled'],
 	components:{
 		upload,
 		member,
-    followData
+    followData,
+    uploadFile
 	},
 	data () {
 		return {
@@ -196,7 +215,12 @@ export default {
           "ownertable": "",
           "ownerid": ""
         },
-      }
+      },
+      attachmentids:[],
+      loading:false,
+      ownerid: "000001",
+      listFile:[],
+      linksids:[]
 		}
 	},
 	methods:{
@@ -276,6 +300,7 @@ export default {
           "usetype": 'default',
         }
         this.$refs['upload'].toUpload()*/
+        this.batchBinding(res.data.sys_taskid)
         this.$emit('onSuccess')
 				this.dialogTableVisible = false
 				this.refresh()
@@ -286,8 +311,8 @@ export default {
 		refresh () {
 			this.form = {
 				"sys_taskid":0,
-        "title":this.$t('任务标题'),
-        "remarks":this.$t('任务说明'),
+        "title":'',
+        "remarks":'',
         "starttime":"",
         "remindday":0,
         "ownertable":"",
@@ -323,6 +348,12 @@ export default {
       this.leaderShow = false
       this.dialogTableVisible = false
       this.form.remarks = ''
+      this.$refs.uploadRef.listFile = []
+      this.$refs.uploadRef.filelist = []
+      this.$refs.uploadRef.count = 0
+      this.$refs.uploadRef.oldCount = 0
+      this.$refs.uploadRef.$refs.uploadMy.clearFiles()
+      this.batchDeletion()
     },
     follow(content,type,contacts){
       if (this.typeTask === '我的客户' || this.typeTask === '项目商机' || this.typeTask === '公海客户'){
@@ -346,7 +377,61 @@ export default {
         this.form.remarks = content
       }
 
-    }
+    },
+    async uploadSuccess(res1){
+      this.listFile = []
+      this.attachmentids = res1.data.attachmentids
+      const res = await this.$api.requested({
+        classname: "system.attachment.Attachment",
+        method: "queryFileLink",
+        content: {
+          ownertable: "sys_task",
+          ownerid: this.ownerid,
+          usetype: "",
+        },
+      });
+      this.$refs.uploadRef.listFile = res.data.map((item) => {
+        return {
+          name: item.document,
+          url: item.url,
+          linksid: item.linksid,
+          attachmentid:item.attachmentid
+        };
+      });
+      this.listFile = this.$refs.uploadRef.listFile
+      this.loading = false;
+    },
+    /*批量绑定*/
+    async batchBinding(id){
+      this.attachmentids = []
+      this.listFile.forEach((item,index)=>{
+        this.attachmentids[index] = item.attachmentid
+      })
+      const res = await this.$api.requested({
+        "classname": "system.attachment.Attachment",
+        "method": "createFileLink",
+        "content": {
+          "ownertable": "sys_task",
+          "ownerid": id,
+          "usetype": "default",
+          "attachmentids": this.attachmentids
+        }
+      })
+    },
+    /*批量删除*/
+    async batchDeletion(){
+      this.linksids = []
+      this.listFile.forEach((item,index)=>{
+        this.linksids[index] = item.linksid
+      })
+      const res = await this.$api.requested({
+        "classname": "system.attachment.Attachment",
+        "method": "deleteFileLink",
+        "content": {
+          "linksids": this.linksids
+        }
+      })
+    },
 		/*onCancel (done) {
       console.log("关闭")
       this.assistShow = false

+ 2 - 2
src/components/upload/hw_obs_upload_new.vue

@@ -17,7 +17,7 @@
       <el-button icon="el-icon-paperclip" type="text" size="mini" @click="dialogUploadVisible = true" :disabled="status === '已结案' || status === '已失败' || disabled">{{$t('附件上传')}}</el-button>
     </div>
     <!-- 按钮类型 -->
-    <el-button v-else :type="status === '已结案' || status === '已失败' || disabled?'':'primary'" size="small" @click="dialogUploadVisible = true" icon="el-icon-upload" :disabled="status === '已结案' || status === '已失败' || disabled">{{$t(`上 传`)}}</el-button>
+    <el-button v-else :type="status === '已结案' || status === '已失败' || disabled?'':'primary'" size="small" @click="dialogUploadVisible = true" icon="el-icon-upload" :disabled="status === '已结案' || status === '已失败' || disabled">{{$t(title?title:`上 传`)}}</el-button>
     <el-dialog :title="$t(`文件上传`)" :visible.sync="dialogUploadVisible" width="500px" append-to-body :close-on-click-modal="false" :before-close="clearFiles">
       <selectMedia v-if = "!hidemediastock" @onShow="onShow" :accept="accept" :bindData="bindData" @onBindSuccess="onBindSuccess"></selectMedia>
       <el-upload
@@ -67,7 +67,7 @@ export default {
     bindData:附件上传成功后对应需要绑定的数据信息,
     hidemediastock:是否隐藏媒体库选择
   */
-  props:['folderid','btntype','accept','bindData','hidemediastock','status','disabled'],
+  props:['folderid','btntype','accept','bindData','hidemediastock','status','disabled','title'],
   components:{
     selectMedia
   },