|
@@ -102,14 +102,18 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="单据状态" prop="documentStatus">
|
|
|
- <el-select v-model="queryParams.documentStatus" placeholder="请选择">
|
|
|
+ <el-form-item label="单据状态" prop="status">
|
|
|
+ <el-select
|
|
|
+ size="mini"
|
|
|
+ v-model="queryParams.status"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
<el-option
|
|
|
- v-for="item in [{value: '未提交', label: '未提交'}, {value: '审核中', label: '审核中'}, {value: '已审核', label: '已审核'}]"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
+ v-for="dict in dict.type.sys_status"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -155,42 +159,49 @@
|
|
|
<el-table-column label="部门" align="center" prop="dept" width="180"/>
|
|
|
<el-table-column label="目标合计" align="center" prop="goalTotal"/>
|
|
|
<el-table-column label="备注" align="center" prop="notes" width="180"/>
|
|
|
- <el-table-column label="单据状态" align="center" prop="documentStatus"/>
|
|
|
+ <el-table-column show-overflow-tooltip label="状态" align="center" width="200" prop="status">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag
|
|
|
+ :options="dict.type.sys_status"
|
|
|
+ :value="scope.row.status"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
+ <div v-if="scope.row.status == '0' || scope.row.status == '3'">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleSubmit(scope.row)"
|
|
|
+ >提交</el-button>
|
|
|
+ </div>
|
|
|
+ <div v-if="scope.row.status == '1'">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleReback(scope.row)"
|
|
|
+ >收回</el-button>
|
|
|
+ </div>
|
|
|
+ <!-- <el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-document-copy"
|
|
|
@click="handleCopy(scope.row.id)"
|
|
|
>复制
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
- >修改
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
- >删除
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleSubmit(scope.row)"
|
|
|
- >提交</el-button>
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleReback(scope.row)"
|
|
|
- >收回</el-button>
|
|
|
+ </el-button> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -279,8 +290,15 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="单据状态" prop="documentStatus">
|
|
|
- <el-input v-model="form.documentStatus" placeholder="未提交" clearable disabled/>
|
|
|
+ <el-form-item label="单据状态" prop="type">
|
|
|
+ <el-select v-model="form.status" placeholder="" disabled>
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.sys_status"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -288,7 +306,12 @@
|
|
|
<div id="addDetails">
|
|
|
<el-row :gutter="10" class="mb8" style="margin-left: 80%">
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport">导入明细</el-button>
|
|
|
+ <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleTemplateDownload">模板下载</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-upload ref="upload" action="" :http-request="handleImport">
|
|
|
+ <el-button size="mini" type="primary">导入明细</el-button>
|
|
|
+ </el-upload>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddDetails">增行</el-button>
|
|
@@ -447,36 +470,6 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-drawer>
|
|
|
-
|
|
|
- <!-- 用户导入对话框 -->
|
|
|
- <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
- <el-upload
|
|
|
- ref="upload"
|
|
|
- :limit="1"
|
|
|
- accept=".xlsx, .xls"
|
|
|
- :headers="upload.headers"
|
|
|
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
|
|
|
- :disabled="upload.isUploading"
|
|
|
- :on-progress="handleFileUploadProgress"
|
|
|
- :on-success="handleFileSuccess"
|
|
|
- :auto-upload="false"
|
|
|
- drag
|
|
|
- >
|
|
|
- <i class="el-icon-upload"></i>
|
|
|
- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
- <div class="el-upload__tip text-center" slot="tip">
|
|
|
- <div class="el-upload__tip" slot="tip">
|
|
|
- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
|
|
|
- </div>
|
|
|
- <span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
|
|
- </div>
|
|
|
- </el-upload>
|
|
|
- <div slot="footer">
|
|
|
- <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
- <el-button @click="upload.open = false">取 消</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
<!-- 批量修改对话框-->
|
|
|
<el-dialog title="批量修改" width="30%" :visible.sync="dialogUpdateMore.dialogFormVisible" append-to-body @closed="resetDialogUpdateMore">
|
|
|
<el-form>
|
|
@@ -526,11 +519,13 @@ import {
|
|
|
getAnnualSaleGoal,
|
|
|
delAnnualSaleGoal,
|
|
|
addAnnualSaleGoal,
|
|
|
- updateAnnualSaleGoal
|
|
|
+ updateAnnualSaleGoal,
|
|
|
+ submit,
|
|
|
} from "@/api/business/spd/goal_management/annualSaleGoal";
|
|
|
import {
|
|
|
delAnnualSaleGoalDetails,
|
|
|
- getAnnualSaleGoalDetails
|
|
|
+ getAnnualSaleGoalDetails,
|
|
|
+ importData
|
|
|
} from "@/api/business/spd/goal_management/annualSaleGoalDetails"
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import { getSummary } from "@/api/business/spd/goal_management/commonWays";
|
|
@@ -541,6 +536,7 @@ import ElPopoverSelectV2 from "@/components/popover-select-v2"
|
|
|
|
|
|
export default {
|
|
|
name: "AnnualSaleGoal",
|
|
|
+ dicts: ["sys_status"],
|
|
|
components: {
|
|
|
TreeRefers, ElPopoverSelectV2
|
|
|
},
|
|
@@ -582,7 +578,7 @@ export default {
|
|
|
dept: null,
|
|
|
goalTotal: null,
|
|
|
notes: null,
|
|
|
- documentStatus: null,
|
|
|
+ status: null,
|
|
|
delFlag: null,
|
|
|
documentDateRange: null
|
|
|
},
|
|
@@ -630,7 +626,7 @@ export default {
|
|
|
dept: null,
|
|
|
goalTotal: null,
|
|
|
notes: null,
|
|
|
- documentStatus: '开立态',
|
|
|
+ status: '开立态',
|
|
|
deleteStatus: 0,
|
|
|
annualGoalMergeDetails: []
|
|
|
},
|
|
@@ -744,7 +740,7 @@ export default {
|
|
|
dept: null,
|
|
|
goalTotal: null,
|
|
|
notes: null,
|
|
|
- documentStatus: null,
|
|
|
+ status: null,
|
|
|
deleteStatus: null
|
|
|
};
|
|
|
this.resetForm("form");
|
|
@@ -773,7 +769,7 @@ export default {
|
|
|
dept: null,
|
|
|
goalTotal: null,
|
|
|
notes: null,
|
|
|
- documentStatus: null,
|
|
|
+ status: null,
|
|
|
delFlag: null,
|
|
|
documentDateRange: null
|
|
|
}
|
|
@@ -885,7 +881,7 @@ export default {
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
- this.form.documentStatus = '未提交'
|
|
|
+ this.form.status = '0'
|
|
|
this.form.annualGoalMergeDetails = JSON.parse(JSON.stringify(this.annualSaleGoalDetailsList))
|
|
|
console.log(this.form);
|
|
|
addAnnualSaleGoal(this.form).then(response => {
|
|
@@ -1037,53 +1033,6 @@ export default {
|
|
|
this.handleExportDetails()
|
|
|
}
|
|
|
},
|
|
|
- /** 导入按钮操作 */
|
|
|
- handleImport() {
|
|
|
- this.upload.open = true;
|
|
|
- if (this.open) {
|
|
|
- this.upload.title = "年销售目标填报明细导入"
|
|
|
- this.upload.url = process.env.VUE_APP_BASE_API + "goal_management/annualSaleGoalDetails/importData/" + this.form.id
|
|
|
- } else {
|
|
|
- this.upload.title = "年销售目标填报导入";
|
|
|
- this.upload.url = process.env.VUE_APP_BASE_API + "goal_management/annualSaleGoal/importData"
|
|
|
- }
|
|
|
- },
|
|
|
- /** 下载模板操作 */
|
|
|
- importTemplate() {
|
|
|
- if (this.open) {
|
|
|
- this.download('goal_management/annualSaleGoalDetails/importTemplate', {
|
|
|
- }, `annualSaleGoalDetails_${new Date().getTime()}.xlsx`)
|
|
|
- } else {
|
|
|
- this.download('goal_management/annualSaleGoal/importTemplate', {
|
|
|
- }, `annualSaleGoal_${new Date().getTime()}.xlsx`)
|
|
|
- }
|
|
|
- },
|
|
|
- // 文件上传中处理
|
|
|
- handleFileUploadProgress(event, file, fileList) {
|
|
|
- this.upload.isUploading = true;
|
|
|
- },
|
|
|
- // 文件上传成功处理
|
|
|
- handleFileSuccess(response, file, fileList) {
|
|
|
- console.log(response);
|
|
|
- this.upload.open = false;
|
|
|
- this.upload.isUploading = false;
|
|
|
- this.$refs.upload.clearFiles();
|
|
|
- this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
- if (this.open) {
|
|
|
- const array = response.data
|
|
|
- for (const arrayElement of array) {
|
|
|
- arrayElement.id = null
|
|
|
- this.annualSaleGoalDetailsList.push(arrayElement)
|
|
|
- }
|
|
|
- this.computeTotal()
|
|
|
- } else {
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- },
|
|
|
- // 提交上传文件
|
|
|
- submitFileForm() {
|
|
|
- this.$refs.upload.submit();
|
|
|
- },
|
|
|
// 选择物料后,给一级分类和二级分类复赋值
|
|
|
setClassify(one, two, obj) {
|
|
|
const oneArray = one.split("&")
|
|
@@ -1126,7 +1075,54 @@ export default {
|
|
|
resetDialogUpdateMore() {
|
|
|
this.dialogUpdateMore.updateName = null
|
|
|
this.dialogUpdateMore.updateData = null
|
|
|
- }
|
|
|
+ },
|
|
|
+ //提交
|
|
|
+ async handleSubmit(row){
|
|
|
+ this.$modal.loading("提交中...");
|
|
|
+ try {
|
|
|
+ const {msg, code} = await submit(row.id);
|
|
|
+ if (code === 200) {
|
|
|
+ this.$modal.notifySuccess("提交成功");
|
|
|
+ this.$modal.closeLoading();
|
|
|
+ row.status = '1'
|
|
|
+ // this.getList(this.queryParams)
|
|
|
+ }
|
|
|
+ }catch (err) {
|
|
|
+ console.error(err);
|
|
|
+ this.$modal.closeLoading();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //收回
|
|
|
+ handleReback(){
|
|
|
+
|
|
|
+ },
|
|
|
+ //模板下载
|
|
|
+ handleTemplateDownload(){
|
|
|
+ this.download('/goal_management/annualSaleGoalDetails/importTemplate', {
|
|
|
+ }, `AnnualSaleGoal_${new Date().getTime()}.xlsx`)
|
|
|
+ },
|
|
|
+ //导入
|
|
|
+ handleImport(file){
|
|
|
+ this.loading = true;
|
|
|
+ let formData = new FormData()
|
|
|
+ formData.append('file',file.file)
|
|
|
+ importData(formData).then((res) => {
|
|
|
+ console.log('res',res);
|
|
|
+ if(res.code == '200'){
|
|
|
+ this.form.annualGoalMergeDetails.push.apply(this.form.annualGoalMergeDetails,res.data);
|
|
|
+ this.$message.success(res.msg);
|
|
|
+ }else{
|
|
|
+ this.$message.success(res.msg);
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ }).catch((e) => {
|
|
|
+ this.$message.error(e.message)
|
|
|
+ }).finally((e) => {
|
|
|
+ this.$refs['upload'].clearFiles();
|
|
|
+ this.resetList();
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|