|
|
@@ -1,6 +1,8 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <addProject v-if="!isDisabled" ref="addOrder" :param="paramAdd" :tablecols="tablecolsAdd" :title="'添加项目'" class="inline-16" @add="addProject" @adds="addProjects"></addProject>
|
|
|
+ <addProject v-if="!isDisabled" ref="addOrder" :param="paramAdd" :tablecols="tablecolsAdd" :title="'添加项目'" class="inline-16" @add="addProject"
|
|
|
+ @adds="addProjects" @uploadData="uploadData" @onSuccess="onSuccess" :dataType="'项目'"></addProject>
|
|
|
+ <el-button @click="delAll" type="primary" size="small">一键删除</el-button>
|
|
|
<el-button v-if="!isDisabled" :type="items.length > 0?'primary':''" size="small" @click="delProject" class="inline-16" :disabled="items.length === 0">删 除</el-button>
|
|
|
<el-input style="width:200px;" placeholder="搜索" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
|
|
|
</el-input>
|
|
|
@@ -140,6 +142,51 @@ export default {
|
|
|
this.listData()
|
|
|
})
|
|
|
},
|
|
|
+ /*一键全选*/
|
|
|
+ uploadData (uploadApi,data) {
|
|
|
+ uploadApi.id = 20230705145104
|
|
|
+ uploadApi.content = {
|
|
|
+ "sa_salesforecastbillid": this.id, //订单ID
|
|
|
+ "ownertable": "sa_project",
|
|
|
+ "salesforecastproject": data.map(item=>{
|
|
|
+ return {
|
|
|
+ "sa_salesforecastprojectid": 0,
|
|
|
+ "ownerid": item.sa_projectid,
|
|
|
+ "discountrate": 0
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /*一键删除*/
|
|
|
+ delAll(){
|
|
|
+ this.$confirm('此操作将删除全部项目, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async() => {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20230705145304,
|
|
|
+ "content": {
|
|
|
+ "sa_salesforecastbillid":this.id,
|
|
|
+ "sa_salesforecastprojectids":[],
|
|
|
+ "isAll":1,
|
|
|
+ "ownertable":"sa_project"
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ this.items = []
|
|
|
+ /*this.projectParam.content.pageNumber = 1
|
|
|
+ this.listData()*/
|
|
|
+ this.onSuccess()
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
async delProject(val){
|
|
|
console.log(val)
|
|
|
const res = await this.$api.requested({
|