|
|
@@ -0,0 +1,199 @@
|
|
|
+<template>
|
|
|
+ <div class="brand">
|
|
|
+ <div style="display: flex; align-items: center; margin-bottom: 16px">
|
|
|
+ <el-input
|
|
|
+ :placeholder="$t('请输入搜索内容')"
|
|
|
+ suffix-icon="el-icon-search"
|
|
|
+ v-model="params.content.where.condition"
|
|
|
+ style="width: 200px"
|
|
|
+ size="mini"
|
|
|
+ class="input-with-select inline-16"
|
|
|
+ @keyup.native.enter="department((params.content.pageNumber = 1))"
|
|
|
+ @clear="department((params.content.pageNumber = 1))"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <addTop :disabled="isEdit()" @onSuccess="department"></addTop>
|
|
|
+ <!-- v-if="tool.checkAuth($route.name, 'terminalWorkBillModuleDetail')" -->
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ stripe
|
|
|
+ border
|
|
|
+ row-key="sc_workorder_template_worksid"
|
|
|
+ size="small"
|
|
|
+ :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
+ >
|
|
|
+ <el-table-column width="120"> </el-table-column>
|
|
|
+ <el-table-column prop="workname" :label="$t(`工序内容`)" show-overflow-tooltip width="160">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="remarks" show-overflow-tooltip :label="$t(`操作说明`)" width="160">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.remarks ? scope.row.remarks : '--' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="fileupload" :label="$t(`上传附件`)" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.fileupload ? (scope.row.fileupload == 1 ? $t('非必填') : $t('必填')) : $t('无') }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="additem" :label="$t(`是否添加物料`)" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.additem ? (scope.row.additem == 1 ? $t('非必填') : $t('必填')) : $t('无') }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="formcheck" :label="$t(`内容是否需验证表单`)" width="160">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.formcheck == 1 ? $t('是') : $t('否') }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="panorama" :label="$t(`上传全景影像`)" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.panorama ? (scope.row.panorama == 1 ? $t('非必填') : $t('必填')) : $t('无') }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="passcheck" :label="$t(`是否确认合格`)" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.passcheck ? (scope.row.passcheck == 1 ? $t('非必填') : $t('必填')) : $t('无') }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="signature" :label="$t(`是否客户签名`)" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.signature ? (scope.row.signature == 1 ? $t('非必填') : $t('必填')) : $t('无') }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="servicenode" :label="$t(`是否必填服务节点`)" width="160">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.servicenode ? (scope.row.servicenode == 1 ? $t('非必填') : $t('必填')) : $t('无') }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('操作')" width="200" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <addTop :disabled="isEdit()" class="inline-16" @onSuccess="department" :data="scope.row"></addTop>
|
|
|
+ <customBtn
|
|
|
+ type="text"
|
|
|
+ btnName="删 除"
|
|
|
+ message="确定删除该工序吗?"
|
|
|
+ idName="2026051514430402"
|
|
|
+ keyName="sc_workorder_template_worksids"
|
|
|
+ :id="scope.row.sc_workorder_template_worksid"
|
|
|
+ class="inline-16"
|
|
|
+ :idIsArr="true"
|
|
|
+ @onSuccess="department"
|
|
|
+ :disabled="isEdit()"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div style="margin-top: 16px; text-align: right">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ small
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="params.content.pageNumber"
|
|
|
+ :page-size="params.content.pageSize"
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
+ :total="total"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import addTop from './components/addTop';
|
|
|
+export default {
|
|
|
+ props: ['data'],
|
|
|
+ components: {
|
|
|
+ addTop,
|
|
|
+ },
|
|
|
+ inject: ['isEdit'],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableData: [],
|
|
|
+ params: {
|
|
|
+ id: 2026051514422702,
|
|
|
+ version: 1,
|
|
|
+ content: {
|
|
|
+ sc_workorder_templateid: this.$route.query.id,
|
|
|
+ parentid: 0,
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ where: {
|
|
|
+ condition: '',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ total: 0,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ async department(callback) {
|
|
|
+ this.params.content.sc_workorder_templateid = this.$route.query.id;
|
|
|
+ const res = await this.$api.requested(this.params);
|
|
|
+ this.tableData = this.createTreeData(res.data);
|
|
|
+ this.total = res.total;
|
|
|
+ console.log('this.tableData', this.tableData);
|
|
|
+ },
|
|
|
+ createTreeData(array) {
|
|
|
+ var that = this;
|
|
|
+ let arr = [];
|
|
|
+ function convertToElementTree(node) {
|
|
|
+ // 新节点
|
|
|
+ var elNode = {
|
|
|
+ addperson: node['addperson'],
|
|
|
+ textedit: node['textedit'],
|
|
|
+ workname: node['workname'],
|
|
|
+ additem: node['additem'],
|
|
|
+ contractupload: node['contractupload'],
|
|
|
+ confirm_options: node['confirm_options'],
|
|
|
+ // sc_workorder_templateid:this.data.sc_workorder_templateid,
|
|
|
+ parentid: node['parentid'],
|
|
|
+ required: node['required'],
|
|
|
+ confirm: node['confirm'],
|
|
|
+ sequence: node['sequence'],
|
|
|
+ sa_workpresetid: node['sa_workpresetid'],
|
|
|
+ fileupload: node['fileupload'],
|
|
|
+ itemtype: node['itemtype'],
|
|
|
+ sc_workorder_template_worksid: node['sc_workorder_template_worksid'],
|
|
|
+ siteid: node['siteid'],
|
|
|
+ rowindex: node['rowindex'],
|
|
|
+ amountpay: node['amountpay'],
|
|
|
+ remarks: node['remarks'],
|
|
|
+ children: [],
|
|
|
+ };
|
|
|
+
|
|
|
+ if (node.subdep && node.subdep.length > 0) {
|
|
|
+ // 如果存在子节点
|
|
|
+ for (var index = 0; index < node.subdep.length; index++) {
|
|
|
+ // 遍历子节点, 把每个子节点看做一颗独立的树, 传入递归构造子树, 并把结果放回到新node的children中
|
|
|
+ elNode.children.push(convertToElementTree(node.subdep[index]));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return elNode;
|
|
|
+ }
|
|
|
+ array.forEach((element) => {
|
|
|
+ arr.push(convertToElementTree(element));
|
|
|
+ });
|
|
|
+ return arr;
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.params.content.pageSize = val;
|
|
|
+ this.department();
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.params.content.pageNumber = val;
|
|
|
+ this.department();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.department();
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped></style>
|