Browse Source

备注tab

master
han\hanst 1 day ago
parent
commit
403805d783
  1. 5
      src/api/erf/erf.js
  2. 63
      src/views/modules/erf/expApplyList.vue

5
src/api/erf/erf.js

@ -40,6 +40,11 @@ export const approveExpApply = data => createAPI(`/erf/expApply/approveExpApply`
*/ */
export const getCurrentNodeCode = data => createAPI(`/erf/expApply/getCurrentNodeCode`, 'post', data) export const getCurrentNodeCode = data => createAPI(`/erf/expApply/getCurrentNodeCode`, 'post', data)
/**
* 保存申请单备注
*/
export const saveRemark = data => createAPI(`/erf/expApply/saveRemark`, 'post', data)
/** /**
* 撤回申请单 * 撤回申请单
*/ */

63
src/views/modules/erf/expApplyList.vue

@ -411,6 +411,30 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
<!-- Tab: 备注 -->
<el-tab-pane label="备注" name="remark">
<div v-if="currentRow.applyNo" style="padding: 16px;">
<el-input
type="textarea"
v-model="remarkText"
:rows="10"
placeholder="请输入备注内容"
style="width: 100%"
></el-input>
<div style="margin-top: 12px; text-align: left;">
<el-button
type="primary"
size="small"
:loading="remarkSaving"
@click="saveRemarkHandle">保存备注</el-button>
</div>
</div>
<div v-else class="empty-tip">
<i class="el-icon-edit-outline" style="font-size: 40px; color: #C0C4CC; margin-bottom: 10px"></i>
<p style="font-size: 13px">请选择申请单填写备注</p>
</div>
</el-tab-pane>
</el-tabs> </el-tabs>
<!-- 新增/编辑弹窗 --> <!-- 新增/编辑弹窗 -->
@ -587,7 +611,7 @@
</template> </template>
<script> <script>
import { searchExpApplyList, submitExpApply, deleteExpApply, withdrawExpApply, cancelExpApply, copyExpApply, getSubmitApprovers, getFlowStatus, getTriConfirmList, confirmSample } from '@/api/erf/erf'
import { searchExpApplyList, submitExpApply, deleteExpApply, withdrawExpApply, cancelExpApply, copyExpApply, getSubmitApprovers, getFlowStatus, getTriConfirmList, confirmSample, saveRemark } from '@/api/erf/erf'
import { getBuList } from '@/api/factory/site' import { getBuList } from '@/api/factory/site'
import ExpApplyForm from './components/expApplyForm.vue' import ExpApplyForm from './components/expApplyForm.vue'
import ExpProjectDetail from './components/expProjectDetail.vue' import ExpProjectDetail from './components/expProjectDetail.vue'
@ -640,6 +664,10 @@ export default {
// //
currentRow: {}, currentRow: {},
//
remarkText: '',
remarkSaving: false,
// Tab // Tab
activeName: 'attachment', activeName: 'attachment',
@ -1118,31 +1146,50 @@ export default {
this.getDataList() this.getDataList()
}, },
/**
* 保存备注
*/
saveRemarkHandle() {
if (!this.currentRow.applyNo) {
this.$message.warning('请先选择申请单')
return
}
this.remarkSaving = true
saveRemark({ applyNo: this.currentRow.applyNo, remark: this.remarkText }).then(({data}) => {
this.remarkSaving = false
if (data && data.code === 0) {
this.$message.success('备注保存成功')
this.getDataList('Y')
//this.currentRow.remark = this.remarkText
} else {
this.$message.error(data.msg || '保存失败')
}
}).catch(() => {
this.remarkSaving = false
this.$message.error('保存异常')
})
},
/** /**
* 行点击事件 * 行点击事件
*/ */
handleRowClick(row) { handleRowClick(row) {
this.currentRow = JSON.parse(JSON.stringify(row)) this.currentRow = JSON.parse(JSON.stringify(row))
this.remarkText = row.remark || ''
// //
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.dataTable.setCurrentRow(row) this.$refs.dataTable.setCurrentRow(row)
}) })
// tab
// tabtab
if (this.activeName === 'approvalStatus') { if (this.activeName === 'approvalStatus') {
//
this.loadFlowStatus() this.loadFlowStatus()
} else if (this.activeName === 'triConfirm') { } else if (this.activeName === 'triConfirm') {
//
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.triConfirm && this.$refs.triConfirm.loadProcessList) { if (this.$refs.triConfirm && this.$refs.triConfirm.loadProcessList) {
console.log('🔄 行切换,刷新三方确认数据')
this.$refs.triConfirm.loadProcessList() this.$refs.triConfirm.loadProcessList()
} }
}) })
} else {
// tab
this.activeName = 'attachment'
} }
}, },

Loading…
Cancel
Save