|
@@ -31,13 +31,23 @@
|
|
|
<el-row v-if="id">
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="工种列表">
|
|
|
- <el-table :data="dataForm.proWorkTypeList" border style="width: 100%;">
|
|
|
- <el-table-column prop="workTypeName" label="工种名称" min-width="120" />
|
|
|
- <el-table-column prop="workTypeCode" label="工种编码" min-width="120" />
|
|
|
- <el-table-column prop="description" label="描述" min-width="200" />
|
|
|
- <el-table-column fixed="right" label="操作" width="80">
|
|
|
- <template slot-scope="{ $index }">
|
|
|
- <el-button type="text" size="small" @click="removeWorkType($index)">删除</el-button>
|
|
|
+ <el-table :data="dataForm.proWorkTypeList" border style="width: 100%;margin-top: 10px">
|
|
|
+ <el-table-column label="序号" type="index" width="50" align="center"></el-table-column>
|
|
|
+ <el-table-column prop="name" label="工种名称" wimin-widthdth="150"></el-table-column>
|
|
|
+ <el-table-column prop="levelValue" label="工种级别" min-width="120"></el-table-column>
|
|
|
+ <el-table-column prop="requirement" label="工种要求" min-width="120"></el-table-column>
|
|
|
+ <el-table-column prop="quotedPrice" label="工时单价" min-width="100"></el-table-column>
|
|
|
+ <el-table-column prop="masterNames" label="掌握人" min-width="120"
|
|
|
+ :show-tooltip-when-overflow="true"></el-table-column>
|
|
|
+ <el-table-column prop="workshopManagerName" label="负责人" min-width="120"
|
|
|
+ :show-tooltip-when-overflow="true"></el-table-column>
|
|
|
+ <el-table-column prop="createTime" label="创建时间" min-width="160"></el-table-column>
|
|
|
+ <el-table-column prop="notes" label="备注" min-width="160"
|
|
|
+ :show-tooltip-when-overflow="true"></el-table-column>
|
|
|
+ <el-table-column fixed="right" label="操作" width="50">
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
+ <el-button style="color: red" type="text" size="small"
|
|
|
+ @click="removeWorkType(row.typeId, $index)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -54,6 +64,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { getDetail } from '@/api/workshop'
|
|
|
+import { removeWorkType } from '@/api/worktype'
|
|
|
import UserComponent from '../common/user-component.vue'
|
|
|
export default {
|
|
|
name: 'workshop-add-or-update',
|
|
@@ -125,8 +136,30 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- removeWorkType(index) {
|
|
|
- console.log(index)
|
|
|
+ removeWorkType(typeId, $index) {
|
|
|
+ this.$confirm('确定要删除该工种记录吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.dataListLoading = true
|
|
|
+ let ids = []
|
|
|
+ ids.push(typeId)
|
|
|
+ // 调用删除接口
|
|
|
+ removeWorkType(ids).then(({ data }) => {
|
|
|
+ this.dataListLoading = false
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.$message.success('删除成功')
|
|
|
+ // 删除这一行
|
|
|
+ this.dataForm.proWorkTypeList.splice($index, 1)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$message.error(data && data.msg ? data.msg : '删除失败')
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.dataListLoading = false
|
|
|
+ })
|
|
|
+ }).catch(() => { })
|
|
|
}
|
|
|
}
|
|
|
}
|