|
@@ -139,6 +139,10 @@
|
|
|
<span>{{ parseTime(scope.row.workEndTime, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<el-table-column label="联系人" align="center" prop="contact" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="联系方式" align="center" prop="phonenumber" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="状态" align="center" prop="status" width="100" :formatter="statusFormat" />
|
|
@@ -406,6 +410,9 @@ export default {
|
|
|
components: { Treeselect },
|
|
|
data() {
|
|
|
return {
|
|
|
+ tInvoiceWorkcontentList:[],
|
|
|
+ //作业内容表头
|
|
|
+ tabletou:['作业类型','风险等级','作业内容描述','作业人员数','作业预计时间','监护人单位'],
|
|
|
//用户名和承包商名
|
|
|
username:"",
|
|
|
//bookticked关联ID
|
|
@@ -514,6 +521,7 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.clientHeight = document.body.clientHeight -250
|
|
|
})
|
|
|
+ this.getList();
|
|
|
this.getTreeselect();
|
|
|
this.getDicts("booking_work_status").then(response => {
|
|
|
this.statusOptions = response.data;
|
|
@@ -545,7 +553,7 @@ export default {
|
|
|
this.getDicts("book_guardian_unit").then(response => {
|
|
|
this.guardianUnitOptions = response.data;
|
|
|
});
|
|
|
- this.getList();
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
// 表单添加一行
|
|
@@ -576,37 +584,19 @@ export default {
|
|
|
|
|
|
/** 查询预约作业票台账列表 */
|
|
|
getList() {
|
|
|
- this.getDicts("book_work_unit").then(response => {
|
|
|
- this.workUnitOptions = response.data;
|
|
|
this.loading = true;
|
|
|
- //查到登陆用户的角色和名称
|
|
|
- var name = this.$store.state.user.name;
|
|
|
- var roles =this.$store.state.user.roles
|
|
|
- this.bookingworkticketList=[]
|
|
|
- //先判断用户是否是承包商
|
|
|
- // debugger
|
|
|
- for(var i=0;i<this.workUnitOptions.length;i++ ) {
|
|
|
- if(name==this.workUnitOptions[i].remark){
|
|
|
- this.username =this.workUnitOptions[i].dictValue;
|
|
|
- }
|
|
|
+ listBookingworkticket(this.queryParams).then(response => {
|
|
|
+ this.bookingworkticketList=response.rows;
|
|
|
+ for (let i = 0; i < this.bookingworkticketList.length; i++) {
|
|
|
+ if( this.bookingworkticketList[i].tInvoiceWorkcontentList) {
|
|
|
+ this.tInvoiceWorkcontentList = this.bookingworkticketList[i].tInvoiceWorkcontentList
|
|
|
+ }
|
|
|
}
|
|
|
- //如果是承包商 就循环遍历出这个承包商所预约的
|
|
|
- listBookingworkticket(this.queryParams).then(response => {
|
|
|
- console.log(response)
|
|
|
- let btlist =response.rows;
|
|
|
- for(var i=0;i<btlist.length;i++){
|
|
|
- if(this.username==btlist[i].workUnit){
|
|
|
- this.bookingworkticketList.push(btlist[i]);
|
|
|
- this.total = this.bookingworkticketList.total;
|
|
|
- }else{
|
|
|
- this.bookingworkticketList=response.rows;
|
|
|
- this.total = response.total;
|
|
|
- }
|
|
|
- }
|
|
|
+ this.tInvoiceWorkcontentList.tabletou=this.tabletou;
|
|
|
+ this.total = response.total;
|
|
|
this.loading = false;
|
|
|
+ console.log(this.tInvoiceWorkcontentList)
|
|
|
});
|
|
|
- });
|
|
|
-
|
|
|
},
|
|
|
/** 查询部门下拉树结构 */
|
|
|
getTreeselect() {
|
|
@@ -705,12 +695,10 @@ export default {
|
|
|
this.reset();
|
|
|
this.resetForm1();
|
|
|
var roles =this.$store.state.user.roles
|
|
|
- if(roles=="cbs"){
|
|
|
+
|
|
|
this.open = true;
|
|
|
this.title = "添加预约作业票台账";
|
|
|
- }else{
|
|
|
- this.msgSuccess("承包商用户才可申请预约作业票");
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
@@ -721,10 +709,7 @@ export default {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改预约作业票台账";
|
|
|
- let bookingticketId=this.form.id
|
|
|
- getWorkcontentBybookingticketId(bookingticketId).then(response => {
|
|
|
- this.ruleForm=response.data
|
|
|
- });
|
|
|
+ this.ruleForm=response.data.tInvoiceWorkcontentList
|
|
|
});
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
@@ -732,27 +717,17 @@ export default {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
if (this.form.id != null) {
|
|
|
+ this.form.tInvoiceWorkcontentList=this.ruleForm
|
|
|
updateBookingworkticket(this.form).then(response => {
|
|
|
- //修改的时候先修改作业票台账,在根据关联id修改相关的 作业内容子项
|
|
|
- this.btid=response.data;
|
|
|
- for(var i=0;i<this.ruleForm.length;i++){
|
|
|
- this.ruleForm[i].bookingticketId=this.btid;
|
|
|
- updateWorkcontent(this.ruleForm[i]).then(response => {
|
|
|
- });
|
|
|
- }
|
|
|
+
|
|
|
this.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
+ this.form.tInvoiceWorkcontentList=this.ruleForm
|
|
|
addBookingworkticket(this.form).then(response => {
|
|
|
- //取得返回的关联id,然后多个作业内容数据表单 插入到后台
|
|
|
- this.btid=response.data;
|
|
|
- for(var i=0;i<this.ruleForm.length;i++){
|
|
|
- this.ruleForm[i].bookingticketId=this.btid;
|
|
|
- addWorkcontent(this.ruleForm[i]).then(response => {
|
|
|
- });
|
|
|
- }
|
|
|
+
|
|
|
this.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|