| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- <template>
- <div>
- <basicDetails
- ref="details"
- :titleText="mainData.name"
- :oldFormPath="{edit:'HDrpManagement/workBillModule/components'}"
- :editData="mainData"
- :mainAreaData="mainAreaData"
- turnPageId="20221031141102"
- idname="sa_workorder_templateid"
- ownertable="sa_workorder_template"
- :delApiId="20230207140803"
- tags=""
- :tabs="tabs"
- @pageChange="pageChange"
- @onEditSuccess="queryMainData($route.query.id)">
- <div slot="tags">
- </div>
- <div slot="customOperation" >
- <customBtn
- btnName="启用"
- message="确定启用该服务模板吗?"
- idName="20230207140703"
- keyName="sa_workorder_templateid"
- :id="$route.query.id"
- :paramData="[{key:'isused',value:true}]"
- class="inline-16"
- @onSuccess="queryMainData()"
- v-if="!mainData.isused && tool.checkAuth($route.name,'used')"
- />
- <customBtn
- btnName="关闭"
- message="确定关闭该服务模板吗?"
- idName="20230207140703"
- keyName="sa_workorder_templateid"
- :id="$route.query.id"
- :paramData="[{key:'isused',value:false}]"
- class="inline-16"
- @onSuccess="queryMainData() && tool.checkAuth($route.name,'close')"
- v-else
- />
- </div>
- <div slot="slot0" >
- <taskDetail v-if="mainData.actiontype == '工序模板'">
- </taskDetail>
- </div>
- <div :slot="mainData.actiontype == '工序模板' ? 'slot1' : 'slot0'" >
- <detailInfo :more="true" :data="detailInfo"></detailInfo>
- </div>
- </basicDetails>
- </div>
- </template>
- <script>
- import detailInfo from '@/components/detailInfo/index'
- import taskDetail from './taskDetail/index'
- export default {
- name: "detail",
- data() {
- return {
- mainData:{},
- mainAreaData:{},
- detailInfo:'',
- tabs:['详细信息']
- }
- },
- components:{
- detailInfo,
- taskDetail
- },
- provide() {
- return {
- isEdit:() => this.mainData.isused == 1
- }
- },
- methods:{
- async queryMainData(id) {
- const res = await this.$api.requested({
- "id":20230207140503,
- "content": {
- "nocahce":true,
- "sa_workorder_templateid": this.$route.query.id
- }
- })
- this.mainData = res.data
- this.changeDataStructure()
- if (this.mainData.actiontype == '工序模板') this.tabs.unshift('工序明细')
- console.log(this.mainData);
-
- },
- changeDataStructure() {
- this.mainAreaData = [
- {
- label:'模板名称',
- value:this.mainData.name
- },
- {
- label:'服务类型',
- value:this.mainData.type
- },
- {
- label:'是否启用',
- value:this.mainData.isused ? '是' : '否'
- },
- {
- label:'操作类型',
- value:this.mainData.actiontype == '非工序模板' ? '通用模板' : this.mainData.actiontype
- }
-
- ]
- this.detailInfo = [
- {
- title:'基本信息',
- info: [
- {
- label:'模板名称',
- value:this.mainData.name
- },
- {
- label:'服务类型',
- value:this.mainData.type
- },
- {
- label:'是否启用',
- value:this.mainData.isused ? '是' : '否'
- },
- ]
- },
- {
- title:'系统信息',
- info: [
- {label:'创建人',value:this.mainData.createby},
- {label:'创建时间',value:this.mainData.createdate},
- {label:'编辑人',value:this.mainData.changeby},
- {label:'编辑时间',value:this.mainData.changedate},
- ]
- },
- ]
- },
- async handleStatus (status) {
- let res = await this.$api.requested({
- "id": "20230207140703",
- "version":1,
- "content": {
- "sa_workorder_templateid":this.$route.query.id,
- "isused":status == '关闭' ? false : true
- }
- })
- this.tool.showMessage(res,() => {
- this.queryMainData()
- })
- },
- // 监听切换数据,上一页,下一页
- pageChange (id,rowindex,tabIndex) {
- this.flag = false
- tabIndex = this.$route.query.tabIndex
- this.$router.replace({path:'/workBillModuleDetail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
- this.queryMainData(id)
- },
- onSuccess(){
- this.visible = false
- this.queryMainData(this.$route.query.id)
- this.$emit('onSuccess')
- }
- },
- mounted () {
- this.queryMainData(this.$route.query.id)
- },
- created() {
- }
- }
- </script>
- <style scoped>
- </style>
|