|
@@ -113,7 +113,7 @@
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="bookingworkticketList" :span-method="mergeMethod" @selection-change="handleSelectionChange" :height="clientHeight" border>
|
|
<el-table v-loading="loading" :data="bookingworkticketList" :span-method="mergeMethod" @selection-change="handleSelectionChange" :height="clientHeight" border>
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
|
+
|
|
<el-table-column label="作业单位" align="center" prop="bookingworkticket.workUnit" :formatter="workUnitFormat"/>
|
|
<el-table-column label="作业单位" align="center" prop="bookingworkticket.workUnit" :formatter="workUnitFormat"/>
|
|
<el-table-column label="作业区域单元" align="center" prop="bookingworkticket.workArea" :formatter="workAreaFormat"/>
|
|
<el-table-column label="作业区域单元" align="center" prop="bookingworkticket.workArea" :formatter="workAreaFormat"/>
|
|
<el-table-column label="楼层位置" align="center" prop="bookingworkticket.floorLocation" :formatter="floorLocationFormat"/>
|
|
<el-table-column label="楼层位置" align="center" prop="bookingworkticket.floorLocation" :formatter="floorLocationFormat"/>
|
|
@@ -152,13 +152,6 @@
|
|
icon="el-icon-edit"
|
|
icon="el-icon-edit"
|
|
@click="handleDelete(scope.row)"
|
|
@click="handleDelete(scope.row)"
|
|
>删除</el-button>
|
|
>删除</el-button>
|
|
- <el-button
|
|
|
|
- size="mini"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-s-claim"
|
|
|
|
- @click="signature(scope.row)"
|
|
|
|
- v-hasPermi="['invoice:bookingworkticket:signature']"
|
|
|
|
- >签字</el-button>
|
|
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="text"
|
|
type="text"
|
|
@@ -166,12 +159,12 @@
|
|
@click="association(scope.row)"
|
|
@click="association(scope.row)"
|
|
v-hasRole="['dbbz','admin']"
|
|
v-hasRole="['dbbz','admin']"
|
|
>关联票号</el-button>
|
|
>关联票号</el-button>
|
|
- <el-button
|
|
|
|
- size="mini"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-share"
|
|
|
|
- @click="billSee(scope.row)"
|
|
|
|
- >票据预览</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-view"
|
|
|
|
+ @click="billSee(scope.row)"
|
|
|
|
+ > {{ $t('票据预览') }}</el-button>
|
|
<el-button
|
|
<el-button
|
|
type="text"
|
|
type="text"
|
|
size="mini"
|
|
size="mini"
|
|
@@ -331,14 +324,27 @@
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
<el-button @click="resetForm1()">重置</el-button>
|
|
<el-button @click="resetForm1()">重置</el-button>
|
|
- <el-button @click="add">+</el-button>
|
|
|
|
- <el-button @click="reduce" :disabled="flag">-</el-button>
|
|
|
|
|
|
+ <el-button @click="add">新增一条</el-button>
|
|
|
|
+ <el-button @click="reduce" :disabled="flag">移除一条</el-button>
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <!-- 报告附件对话框 -->
|
|
|
|
+
|
|
|
|
+ <el-dialog v-loading="loadingFlash" element-loading-background="rgba(0,0,0,0.2)" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px" height="800px" :center="true" append-to-body >
|
|
|
|
+ <div style="margin-top: -60px;float: right;margin-right: 40px;">
|
|
|
|
+ <el-button size="mini" type="text" @click="openPdf">{{$t('新页面打开PDF')}}</el-button></div>
|
|
|
|
+ <div style="margin-top: -30px" >
|
|
|
|
+ <iframe id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px" v-if="ppt"></iframe>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+
|
|
<!-- 用户导入对话框 -->
|
|
<!-- 用户导入对话框 -->
|
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
<el-upload
|
|
<el-upload
|
|
@@ -374,7 +380,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { listBookingworkticket, getBookingworkticket, delBookingworkticket, addBookingworkticket, updateBookingworkticket, exportBookingworkticket, importTemplate} from "@/api/invoice/bookingworkticket";
|
|
|
|
|
|
+import { listBookingworkticket, getBookingworkticket, delBookingworkticket, addBookingworkticket, updateBookingworkticket, exportBookingworkticket, importTemplate, seeBookingworkticket} from "@/api/invoice/bookingworkticket";
|
|
import { listWorkcontent, getWorkcontent, delWorkcontent, addWorkcontent, updateWorkcontent, exportWorkcontent,getWorkcontentBybookingticketId} from "@/api/invoice/workcontent";
|
|
import { listWorkcontent, getWorkcontent, delWorkcontent, addWorkcontent, updateWorkcontent, exportWorkcontent,getWorkcontentBybookingticketId} from "@/api/invoice/workcontent";
|
|
import { treeselect } from "@/api/system/dept";
|
|
import { treeselect } from "@/api/system/dept";
|
|
import { getToken } from "@/utils/auth";
|
|
import { getToken } from "@/utils/auth";
|
|
@@ -387,6 +393,8 @@ export default {
|
|
components: { Treeselect,AddApprove},
|
|
components: { Treeselect,AddApprove},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ ppt:false,
|
|
|
|
+ pptView:false,
|
|
tInvoiceWorkcontentList:[],
|
|
tInvoiceWorkcontentList:[],
|
|
//作业内容表头
|
|
//作业内容表头
|
|
tabletou:['作业类型','风险等级','作业内容描述','作业人员数','作业预计时间','监护人单位'],
|
|
tabletou:['作业类型','风险等级','作业内容描述','作业人员数','作业预计时间','监护人单位'],
|
|
@@ -398,6 +406,7 @@ export default {
|
|
btid:"",
|
|
btid:"",
|
|
// 遮罩层
|
|
// 遮罩层
|
|
loading: true,
|
|
loading: true,
|
|
|
|
+ loadingFlash: false,
|
|
// 选中数组
|
|
// 选中数组
|
|
ids: [],
|
|
ids: [],
|
|
// 非单个禁用
|
|
// 非单个禁用
|
|
@@ -453,6 +462,15 @@ export default {
|
|
// 上传的地址
|
|
// 上传的地址
|
|
url: process.env.VUE_APP_BASE_API + "/invoice/bookingworkticket/importData"
|
|
url: process.env.VUE_APP_BASE_API + "/invoice/bookingworkticket/importData"
|
|
},
|
|
},
|
|
|
|
+ pdf : {
|
|
|
|
+ title: '',
|
|
|
|
+ pdfUrl: '',
|
|
|
|
+ numPages: null,
|
|
|
|
+ open: false,
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageTotalNum: 1,
|
|
|
|
+ loadedRatio: 0,
|
|
|
|
+ },
|
|
// 查询参数
|
|
// 查询参数
|
|
queryParams: {
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
@@ -560,16 +578,18 @@ export default {
|
|
},
|
|
},
|
|
// 表单减少一行
|
|
// 表单减少一行
|
|
reduce() {
|
|
reduce() {
|
|
|
|
+ this.flags()
|
|
this.ruleForm.length = this.ruleForm.length - 1
|
|
this.ruleForm.length = this.ruleForm.length - 1
|
|
- this.flags()
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
// 判断数组长度
|
|
// 判断数组长度
|
|
flags() {
|
|
flags() {
|
|
- if (this.ruleForm.length < 2) {
|
|
|
|
|
|
+ console.log(this.ruleForm.length)
|
|
|
|
+ if (this.ruleForm.length <2) {
|
|
this.flag = true
|
|
this.flag = true
|
|
} else {
|
|
} else {
|
|
//先赋值为true再赋为false, 不然会没反应
|
|
//先赋值为true再赋为false, 不然会没反应
|
|
- this.flag = true
|
|
|
|
|
|
+ this.flag=true
|
|
this.flag = false
|
|
this.flag = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -708,6 +728,7 @@ export default {
|
|
this.open = true;
|
|
this.open = true;
|
|
this.title = "修改预约作业票台账";
|
|
this.title = "修改预约作业票台账";
|
|
this.ruleForm=response.data.tInvoiceWorkcontentList
|
|
this.ruleForm=response.data.tInvoiceWorkcontentList
|
|
|
|
+ this.ruleForm.length=response.data.tInvoiceWorkcontentList.length
|
|
});
|
|
});
|
|
},
|
|
},
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
@@ -837,6 +858,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
+ //单元格整理
|
|
setTable(tableData) {
|
|
setTable(tableData) {
|
|
let spanArr = [],
|
|
let spanArr = [],
|
|
concat = 0;
|
|
concat = 0;
|
|
@@ -844,7 +866,6 @@ export default {
|
|
if (index === 0) {
|
|
if (index === 0) {
|
|
spanArr.push(1);
|
|
spanArr.push(1);
|
|
} else {
|
|
} else {
|
|
- console.log(item)
|
|
|
|
if (item.bookingticketId === tableData[index - 1].bookingticketId) {
|
|
if (item.bookingticketId === tableData[index - 1].bookingticketId) {
|
|
//第一列需合并相同内容的判断条件
|
|
//第一列需合并相同内容的判断条件
|
|
spanArr[concat] += 1;
|
|
spanArr[concat] += 1;
|
|
@@ -859,6 +880,99 @@ export default {
|
|
merge: spanArr
|
|
merge: spanArr
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ //票据预览的
|
|
|
|
+ billSee(row){
|
|
|
|
+ //office预览
|
|
|
|
+ console.log(row.bookingworkticket.filename)
|
|
|
|
+ this.loadingFlash=true
|
|
|
|
+ this.pdf.open =true
|
|
|
|
+ this.pdf.title = row.bookingworkticket.filename
|
|
|
|
+ this.pdf.pdfUrl =""
|
|
|
|
+
|
|
|
|
+ this.ppt=true
|
|
|
|
+ //如果是PDF等直接可以打开的就不调接口,否则调用接口
|
|
|
|
+ if(row.bookingworkticket.filename.endsWith('pdf')){
|
|
|
|
+ this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
|
|
|
|
+ this.loadingFlash=false
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ const formatDate =new FormData();
|
|
|
|
+ formatDate.append("filepath",row.bookingworkticket.filename)
|
|
|
|
+
|
|
|
|
+ //调用文件预览api
|
|
|
|
+ let res= this.officeConvert.officeConvertCommon(formatDate)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //查看接受的全局方法的返回结果 console.log(res)
|
|
|
|
+ //利用.then方法接受Promise对象
|
|
|
|
+ res.then((result)=>{
|
|
|
|
+ //关闭加载中
|
|
|
|
+ this.loadingFlash=false
|
|
|
|
+
|
|
|
|
+ if(result.msg.includes("csv")){
|
|
|
|
+ this.pdf.pdfUrl =process.env.VUE_APP_BASE_API+ result.data
|
|
|
|
+ this.$alert(result.msg, this.$t('检查乱码'), { dangerouslyUseHTMLString: true });
|
|
|
|
+ // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
|
|
|
|
+
|
|
|
|
+ }else if(result.msg.includes("不存在")){
|
|
|
|
+ //文件不存在时提示
|
|
|
|
+ this.pdf.pdfUrl =""
|
|
|
|
+ this.$alert(result.msg, this.$t('预览失败'), { dangerouslyUseHTMLString: true });
|
|
|
|
+ // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
|
|
|
|
+ this.pdf.open =false
|
|
|
|
+ }else if(result.msg.includes("不支持此格式")){
|
|
|
|
+
|
|
|
|
+ this.pdf.pdfUrl =""
|
|
|
|
+ this.$alert(result.msg, this.$t('预览失败'), { dangerouslyUseHTMLString: true });
|
|
|
|
+ // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
|
|
|
|
+ this.pdf.open =false
|
|
|
|
+ } else{
|
|
|
|
+ //成功时直接给地址
|
|
|
|
+ this.pdf.pdfUrl =process.env.VUE_APP_BASE_API+ result.data
|
|
|
|
+ console.log( this.pdf.pdfUrl)
|
|
|
|
+ }
|
|
|
|
+ // this.$nextTick(() => {
|
|
|
|
+ // const iframe = window.frames['iFrame']
|
|
|
|
+ // const handleLoad = () => {
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
+ // const Do = (iframe.contentWindow || iframe.contentDocument)
|
|
|
|
+ // console.log(Do.document.getElementsByTagName('table')[0])
|
|
|
|
+ // Do.document.getElementsByTagName('table')[0].style.width = "100%"
|
|
|
|
+ // Do.document.getElementsByTagName('table')[0].setAttribute("class","table")
|
|
|
|
+ // }, 500)
|
|
|
|
+ // }
|
|
|
|
+ // iframe.addEventListener('load', handleLoad, true)
|
|
|
|
+ // })
|
|
|
|
+ }).catch(result => {
|
|
|
|
+
|
|
|
|
+ //请求失败,关闭loading,pdf地址直接为为空,不显示
|
|
|
|
+ this.pdf.pdfUrl =""
|
|
|
|
+ this.loadingFlash = false;
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ //文件预览
|
|
|
|
+ openPdf(){
|
|
|
|
+ //ppt就跳路由预览,office就直接打开文件新页面
|
|
|
|
+ const didi={ imgs:this.imgs}
|
|
|
|
+ if( this.pptView==true&&this.ppt==false){
|
|
|
|
+ let routeUrl = this.$router.resolve({
|
|
|
|
+ path: "/cpms/index.html#/pptyulan",
|
|
|
|
+ query:didi
|
|
|
|
+ });
|
|
|
|
+ window.open("/cpms/index.html#/pptyulan?id=" + this.pdf.pdfUrl, '_blank')
|
|
|
|
+ console.log(this.imgs)
|
|
|
|
+ }else {
|
|
|
|
+ window.open(this.pdf.pdfUrl)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|