|
@@ -3,7 +3,7 @@
|
|
|
<avue-crud :option="option" :data="dataList" ref="crud" v-model="form" :page.sync="page" :search.sync="search"
|
|
|
:table-loading="loading" @search-change="searchChange" @search-reset="searchReset"
|
|
|
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
|
|
|
- @refresh-change="refreshChange" @on-load="onLoad">
|
|
|
+ @refresh-change="refreshChange" @saveColumn="saveColumn" @resetColumn="resetColumn" @on-load="onLoad">
|
|
|
<template slot="cornIdSearch">
|
|
|
<select-component v-model="search.cornId" :configuration="configuration"></select-component>
|
|
|
</template>
|
|
@@ -14,11 +14,9 @@
|
|
|
<el-button icon="el-icon-printer" size="small" type="primary" :loading="exportLoading" @click.stop="downFile">导出
|
|
|
</el-button>
|
|
|
</template>
|
|
|
- <template slot="userNameSearch">
|
|
|
- <el-select v-model="search.userName" remote filterable clearable :remote-method="remoteMethod">
|
|
|
- <el-option v-for="item in options" :key="item.value" :label="item.realName" :value="item.realName">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <template slot="useridSearch">
|
|
|
+ <user-select v-model="search.userName" :configuration="UConfiguration">
|
|
|
+ </user-select>
|
|
|
</template>
|
|
|
<template slot="deptid" slot-scope="{row,index}">
|
|
|
<span>{{ row.deptName }}</span>
|
|
@@ -29,15 +27,22 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
+ <template slot="userid" slot-scope="{row,index}">
|
|
|
+ <user-select v-if="row.$cellEdit" v-model="row.userName" @value="(values) => value(values, row)"
|
|
|
+ :configuration="UConfiguration">
|
|
|
+ </user-select>
|
|
|
+ <span v-else>{{ row.userName }}</span>
|
|
|
+ </template>
|
|
|
<template slot-scope="{row,index}" slot="menu">
|
|
|
<el-button type="text" icon="el-icon-view" size="small" @click.stop="copyTo">发送
|
|
|
</el-button>
|
|
|
<el-button type="text" icon="el-icon-edit" :disabled="row.status != 5 || row.taskStatus == 30" size="small"
|
|
|
@click.stop="completion(row)">完工
|
|
|
</el-button>
|
|
|
- <el-button type="text" icon="el-icon-edit" size="small" @click.stop="rowCell(row)">{{ row.$cellEdit ? "保存" :
|
|
|
- "修改"
|
|
|
- }}
|
|
|
+ <el-button type="text" icon="el-icon-edit" size="small" @click.stop="rowCell(row)" :disabled="row.taskStatus == 30"
|
|
|
+ >{{ row.$cellEdit ? "保存" :
|
|
|
+ "修改"
|
|
|
+ }}
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
@@ -62,7 +67,7 @@
|
|
|
|
|
|
<script>
|
|
|
import option from "./configuration/mainList.json";
|
|
|
-import { getFlowList } from "@/api/workManagement/mainProject";
|
|
|
+import { getFlowList, updateProjectItem } from "@/api/workManagement/mainProject";
|
|
|
import { updateItemStatus } from "@/api/workManagement/mainProject";
|
|
|
import { getUserList } from "@/api/workManagement/mainProject";
|
|
|
import { saveMessage } from "@/api/logs";
|
|
@@ -88,7 +93,7 @@ export default {
|
|
|
placeholder: '请点击右边按钮选择',
|
|
|
dicData: []
|
|
|
},
|
|
|
- option: option,
|
|
|
+ option: {},
|
|
|
parentId: 0,
|
|
|
dataList: [],
|
|
|
page: {
|
|
@@ -157,8 +162,11 @@ export default {
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
-
|
|
|
+ async created() {
|
|
|
+ this.option = await this.getColumnData(this.getColumnName(186), option);
|
|
|
+ this.getWorkDicts("frequency").then(res => {
|
|
|
+ this.findObject(this.option.column, "frequency").dicData = res.data.data
|
|
|
+ });
|
|
|
},
|
|
|
mounted() {
|
|
|
getUserList().then(res => {
|
|
@@ -183,7 +191,19 @@ export default {
|
|
|
},
|
|
|
rowCell(row, index) {
|
|
|
if (row.$cellEdit == true) {
|
|
|
- this.$set(row, "$cellEdit", false);
|
|
|
+ if(!row.userid){
|
|
|
+ return this.$message.error('承做人不能为空!');
|
|
|
+ }
|
|
|
+ this.$confirm("确认修改?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ updateProjectItem(row).then(res => {
|
|
|
+ this.$message.success("修改成功!")
|
|
|
+ this.$set(row, "$cellEdit", false);
|
|
|
+ })
|
|
|
+ });
|
|
|
} else {
|
|
|
this.$set(row, "$cellEdit", true);
|
|
|
}
|
|
@@ -286,12 +306,6 @@ export default {
|
|
|
this.onLoad(this.page)
|
|
|
},
|
|
|
paramsAdjustment(params) {
|
|
|
- // params = Object.assign({}, this.search);
|
|
|
- // if (params.beginTime && params.beginTime.length != 0) { //发货
|
|
|
- // params.beginStartTime = params.beginTime[0] + " " + "00:00:00";
|
|
|
- // params.beginEndTime = params.beginTime[1] + " " + "23:59:59";
|
|
|
- // this.$delete(params, 'beginTime')
|
|
|
- // }
|
|
|
let data = this.deepClone(Object.assign({}, params, this.search));
|
|
|
if (data.createdTime) {
|
|
|
data.beginStartTime = data.createdTime[0]
|
|
@@ -308,6 +322,30 @@ export default {
|
|
|
}
|
|
|
return data
|
|
|
},
|
|
|
+ //列保存触发
|
|
|
+ async saveColumn() {
|
|
|
+ const inSave = await this.saveColumnData(
|
|
|
+ this.getColumnName(186),
|
|
|
+ this.option
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async resetColumn() {
|
|
|
+ const inSave = await this.delColumnData(
|
|
|
+ this.getColumnName(186),
|
|
|
+ option
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.option = option;
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
onLoad(page, params) {
|
|
|
let data = this.paramsAdjustment(params)
|
|
|
data.branch = 'Y';
|