| | |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | |
| | | <el-dialog title="日结果" :visible.sync="updateRealityDialogFormVisible" style="width: 1800px"> |
| | | <el-form :model="formReality" style="width: 100%"> |
| | | <el-form-item label="日期" :label-width="formLabelWidth"> |
| | | <el-select v-model="formReality.name"> |
| | | <el-option |
| | | v-for="item in addWeekPlanDataWeeklySignReality" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="周计划" :label-width="formLabelWidth"> |
| | | <el-button type="primary" @click="addWeekPlan">添加日计划</el-button> |
| | | <el-table :data="weeklyFormDataReality" border style="width: 100%"> |
| | | <el-table-column fixed :data="addWeekPlanData" prop="weeklyDay" label="星期" width="150"> |
| | | </el-table-column> |
| | | <el-table-column prop="cstmrId" label="甲方单位" width="180"> |
| | | <div class="item" slot-scope="scope"> |
| | | <el-select v-model="scope.row.cstmrId" placeholder="甲方单位"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.name" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </el-table-column> |
| | | <el-table-column prop="workContent" label="工作内容及目的" width="180"> |
| | | <div class="item" slot-scope="scope"> |
| | | <el-input v-model="scope.row.workContent" placeholder="工作内容及目的"></el-input> |
| | | </div> |
| | | </el-table-column> |
| | | <el-table-column prop="weeklyMatter" label="需协助事项" width="120"> |
| | | <div class="item" slot-scope="scope"> |
| | | <el-input v-model="scope.row.weeklyMatter" placeholder="需协助事项"></el-input> |
| | | </div> |
| | | </el-table-column> |
| | | <el-table-column prop="addr" label="地址" width="180"> |
| | | <div class="item" slot-scope="scope"> |
| | | <el-input v-model="scope.row.addr" placeholder="地址"></el-input> |
| | | </div> |
| | | </el-table-column> |
| | | <el-table-column prop="memo" label="备注" width="120"> |
| | | <div class="item" slot-scope="scope"> |
| | | <el-input v-model="scope.row.memo" placeholder="备注"></el-input> |
| | | </div> |
| | | </el-table-column> |
| | | <el-table-column :show="false" property="weeklyDay$" label="日期" v-if="false"></el-table-column> |
| | | <el-table-column fixed="right" label="操作" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="delWeeklyRealityUpdate(scope.row)" type="text" size="del-weekly-plan">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="updateRealityDialogFormVisible = false, weeklyFormDataRealityInit()">取消</el-button> |
| | | <el-button type="primary" @click="updateRealityDialogFormVisible = false, updateRealityWeekly(formReality,false)">确定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="星期" |
| | | :visible.sync="addWeekPlanVisible" |
| | |
| | | <template slot-scope="scope"> |
| | | <el-button @click="delWeekly(scope.row)" type="text" size="del-weekly">删除</el-button> |
| | | <el-button @click="showUpdatePlanWeekly(scope.row)" type="text" size="del-weekly">计划</el-button> |
| | | <el-button @click="updateRWeekly(scope.row)" type="text" size="del-weekly">结果</el-button> |
| | | <el-button @click="showUpdateRealityWeekly(scope.row)" type="text" size="del-weekly">结果</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | weeklyDailyRealityData: [], |
| | | dialogFormVisible: false, |
| | | updatePlanDialogFormVisible: false, |
| | | updateRealityDialogFormVisible: false, |
| | | form: {}, |
| | | formPlan: {}, |
| | | formReality: {}, |
| | | formLabelWidth: '120px', |
| | | addWeekPlanVisible: false, |
| | | addWeekRealityVisible: false, |
| | | addWeekPlanDataWeeklySign: [ |
| | | { |
| | | value: '1', |
| | |
| | | } |
| | | ], |
| | | addWeekPlanDataWeeklySignPlan: [], |
| | | addWeekPlanDataWeeklySignReality: [], |
| | | addWeekPlanData: [], |
| | | addWeekPlanValue: [], |
| | | weeklyFormData: [], |
| | | weeklyFormDataPlan: [], |
| | | weeklyFormDataReality: [], |
| | | options: [], |
| | | // 需要编辑的属性 |
| | | editProp: ['cstmrId','workContent','weeklyMatter','memo'] |
| | |
| | | this.formPlan.name = [] |
| | | this.updatePlanDialogFormVisible = false |
| | | }, |
| | | weeklyFormDataRealityInit(){ |
| | | this.weeklyFormDataReality = [] |
| | | this.formReality.name = [] |
| | | this.updateRealityDialogFormVisible = false |
| | | }, |
| | | showWeeklyDailyPlan(id) { |
| | | let that = this; |
| | | // console.log(id) |
| | |
| | | }, |
| | | addWeekPlan() { |
| | | this.addWeekPlanVisible = true; |
| | | }, |
| | | addWeekReality() { |
| | | this.addWeekRealityVisible = true; |
| | | }, |
| | | addWeekly(res,isExpAdd){ |
| | | let that = this; |
| | |
| | | that.updatePlanDialogFormVisible = true |
| | | |
| | | }, |
| | | showUpdateRealityWeekly(res) { |
| | | let that = this; |
| | | that.formReality.name = res.weeklyDayMonth |
| | | that.formReality.weeklyId = res.id |
| | | // that.formPlan.weeklyMonth = res.weeklyMonth |
| | | $.ajax({ |
| | | url: baseUrl + '/weeklyDailyReality/list/auth', |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: "get", |
| | | data: { |
| | | weekly_id: res.id |
| | | }, |
| | | success: (res) => { |
| | | that.weeklyFormDataReality = res.data.records; |
| | | } |
| | | }); |
| | | that.updateRealityDialogFormVisible = true |
| | | }, |
| | | updatePlanWeekly(res,isExpAdd){ |
| | | let that = this; |
| | | that.updatePlanDialogFormVisible = false |
| | |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: (res) => { |
| | | weeklyFormData=[] |
| | | }, |
| | | error: function (jqXHR, textStatus, errorThrown) { |
| | | // 在这里做错误处理: |
| | |
| | | that.formPlan.name = [] |
| | | that.formPlan.weeklyId = 0 |
| | | }, |
| | | updateRealityWeekly(res,isExpAdd){ |
| | | let that = this; |
| | | that.updateRDialogFormVisible = false |
| | | let weeklyFormDataReality = this.weeklyFormDataReality; |
| | | $.ajax({ |
| | | url: baseUrl+"/weekly/from/" + (isExpAdd?"add":"modify") + "/auth2", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | // weeklyType: Number(that.formPlan.weeklyMonth), |
| | | weeklyId: that.formReality.weeklyId, |
| | | // type: Number(data.field.type), |
| | | type: Number(1), |
| | | weeklyDailyRealityList: weeklyFormDataReality |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: (res) => { |
| | | }, |
| | | error: function (jqXHR, textStatus, errorThrown) { |
| | | // 在这里做错误处理: |
| | | console.log('Error occurred: ', textStatus, errorThrown); |
| | | } |
| | | }) |
| | | that.weeklyFormDataPlan = [] |
| | | that.formReality.name = [] |
| | | that.formReality.weeklyId = 0 |
| | | }, |
| | | addWeekPlanConfirm() { |
| | | let list = this.weeklyFormData |
| | | let listPlan = this.weeklyFormDataPlan |
| | | let listReality = this.weeklyFormDataReality |
| | | let value = this.addWeekPlanValue |
| | | if (value.length > 0) { |
| | | value.forEach((item,idx) => { |
| | |
| | | listPlan.push({ |
| | | weeklyDay: item |
| | | }) |
| | | listReality.push({ |
| | | weeklyDay: item |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | this.weeklyFormData = list; |
| | | this.weeklyFormDataPlan = listPlan; |
| | | this.weeklyFormDataReality = listReality; |
| | | console.log(list) |
| | | this.addWeekPlanVisible = false; |
| | | this.addWeekPlanValue = []; |
| | |
| | | this.weeklyFormDataPlan.splice(index, 1); |
| | | } |
| | | }, |
| | | delWeeklyRealityUpdate(row) { |
| | | // 找到要删除的行在数据列表中的索引 |
| | | const index = this.weeklyFormDataReality.findIndex(item => item === row); |
| | | if (index !== -1) { |
| | | // 通过splice方法删除该行 |
| | | this.weeklyFormDataReality.splice(index, 1); |
| | | } |
| | | }, |
| | | delWeekly(row) { |
| | | let that = this; |
| | | // 找到要删除的行在数据列表中的索引 |