Commit 0c6a1d1e authored by chenzj's avatar chenzj

Merge branch 'dev' of http://git.local.topsunit.com/mes/mes-ui into dev

parents ef3c7be1 6fdc2180
...@@ -234,8 +234,8 @@ ...@@ -234,8 +234,8 @@
<el-tab-pane label="班次"> <el-tab-pane label="班次">
<Shift v-if="open" ref="shiftTab" :planId="form.planId" :shiftType="form.shiftType" :optType="optType"></Shift> <Shift v-if="open" ref="shiftTab" :planId="form.planId" :shiftType="form.shiftType" :optType="optType"></Shift>
</el-tab-pane> </el-tab-pane>
<el-tab-pane v-if="open&&optType !== 'add'" label="工作单元"> <el-tab-pane v-if="open" label="工作单元">
<Team v-if="open&&optType !== 'add'" ref="teamTab" :planId="form.planId" :form="form" :calendarType="form.calendarType" :optType="optType"></Team> <Team v-if="open" ref="teamTab" :planId="form.planId" :form="form" :calendarType="form.calendarType" :optType="optType"></Team>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
...@@ -415,6 +415,7 @@ export default { ...@@ -415,6 +415,7 @@ export default {
} else { } else {
let params = Object.assign({}, this.form) let params = Object.assign({}, this.form)
params.calShifts = this.$refs.shiftTab.shiftList params.calShifts = this.$refs.shiftTab.shiftList
params.calWorkunits = this.$refs.teamTab.teamList
addCalplan(params).then(response => { addCalplan(params).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<span>工作单元</span> <span>工作单元</span>
<el-button style="float: right;" v-if="optType !='view'" @click="handleAdd" type="primary">新增</el-button> <el-button style="float: right;" v-if="optType !='view'" @click="handleAdd" type="primary">新增</el-button>
</div> </div>
<el-table v-loading="loading" :data="teamList"> <el-table v-loading="loading" :data="teamList" max-height="570px">
<el-table-column label="工作单元ID" align="center" prop="workunitId" > <el-table-column label="工作单元ID" align="center" prop="workunitId" >
</el-table-column> </el-table-column>
<el-table-column label="工作单元编码" align="center" prop="workunitCode" /> <el-table-column label="工作单元编码" align="center" prop="workunitCode" />
...@@ -15,20 +15,20 @@ ...@@ -15,20 +15,20 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row, scope.$index)"
v-hasPermi="['mes:cal:calplan:edit']" v-hasPermi="['mes:cal:calplan:edit']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0&&planId"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getTeamList" @pagination="getTeamList"
/> />
<TeamSelect ref="teamSelect" @onSelected="onTeamSelected"></TeamSelect> <TeamSelect ref="teamSelect" @onSelected="onTeamSelected" :planId="planId"></TeamSelect>
</div> </div>
</template> </template>
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
data(){ data(){
return { return {
// 遮罩层 // 遮罩层
loading: true, loading: false,
//班组表格数据 //班组表格数据
teamList:[], teamList:[],
// 班组成员表格数据 // 班组成员表格数据
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
planId: this.planId planId: this.planId || ''
}, },
total: 0 total: 0
} }
...@@ -66,6 +66,9 @@ export default { ...@@ -66,6 +66,9 @@ export default {
}, },
methods:{ methods:{
getTeamList(){ getTeamList(){
if (!this.planId) {
return
}
this.loading = true; this.loading = true;
listPlanteam(this.queryParams).then(response => { listPlanteam(this.queryParams).then(response => {
this.teamList = response.rows; this.teamList = response.rows;
...@@ -87,12 +90,20 @@ export default { ...@@ -87,12 +90,20 @@ export default {
planCode: this.form.planCode, planCode: this.form.planCode,
} }
}); });
if(!this.planId) {
this.teamList.push(...rows)
return
}
addPlanteam(data).then(response => { addPlanteam(data).then(response => {
this.getTeamList(); this.getTeamList();
}); });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row, index) {
if (!this.planId) {
this.teamList.splice(index, 1)
return
}
const recordIds = row.id const recordIds = row.id
this.$modal.confirm('是否确认删除工作单元?').then(function() { this.$modal.confirm('是否确认删除工作单元?').then(function() {
return delPlanteam(recordIds); return delPlanteam(recordIds);
......
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
</el-form> --> </el-form> -->
<el-table v-loading="loading" :data="teamList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="teamList" @selection-change="handleSelectionChange" height="600px">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="工作单元ID" width="80" align="center" prop="workunitId" > <el-table-column label="工作单元ID" width="100" align="center" prop="workunitId" >
</el-table-column> </el-table-column>
<el-table-column label="工作单元编码" align="center" prop="workunitCode" /> <el-table-column label="工作单元编码" align="center" prop="workunitCode" />
<el-table-column label="工作单元名称" align="center" prop="workunitName" /> <el-table-column label="工作单元名称" align="center" prop="workunitName" />
...@@ -85,11 +85,19 @@ export default { ...@@ -85,11 +85,19 @@ export default {
pageSize: 10, pageSize: 10,
teamCode: null, teamCode: null,
teamName: null, teamName: null,
planId: this.$attrs.planId || null
}, },
}; };
}, },
watch: {
showFlag: {
handler() {
this.getList();
}
}
},
created() { created() {
this.getList();
}, },
methods: { methods: {
/** 查询班组列表 */ /** 查询班组列表 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment