| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <template>
- <view class="">
- <uni-nav-bar background-color="#157A2C" color="#fff" fixed="true" statusBar="true" left-icon="back"
- :title="title" @clickLeft="back">
- </uni-nav-bar>
- <u-subsection :list="list" :current="current" @change="sectionChange"></u-subsection>
- <DemandInfo :demandForm="demandForm" v-show="current == 0" :itemList="productDetail" />
- <PlanInfo :planForm="planForm" v-show="current == 1" />
- <AfterSales v-show="current == 2" :itemList="productDetail" :type="type" :isReport="isReport" />
- <ContactList ref="contactRef" :type="type" v-show="current == 3" :itemList="contactInfoVOS"
- :isReport="isReport" />
- <SchemeList v-show="current == 4" :type='type' :itemList="costListVOS" />
- <view class="footerButton" v-if="isDisable">
- <u-button type="default" text="返回" @click="back"></u-button>
- <u-button type="primary" @click="save" text="保存"></u-button>
- </view>
- <!-- <ba-tree-picker ref="treePicker" :multiple="false" @select-change="confirm" title="选择部门" :localdata="listData"
- valueKey="id" textKey="name" childrenKey="children" /> -->
- <u-toast ref="uToast"></u-toast>
- </view>
- </template>
- <script>
- import AfterSales from '@/pages/salesServiceManagement/demandList/components/AfterSales.vue'
- import ContactList from '@/pages/salesServiceManagement/demandList/components/contactList.vue'
- import {
- getSalesWorkOrderById
- } from '@/api/salesServiceManagement/workOrder/index.js'
- import PlanInfo from './planInfo.vue'
- import DemandInfo from './demandInfo.vue'
- import SchemeList from './schemeList.vue'
- import {
- getByCode
- } from '@/api/pda/common.js'
- import {
- listOrganizations,
- getUserPage
- } from '@/api/myTicket/index.js'
- export default {
- components: {
- SchemeList,
- PlanInfo,
- DemandInfo,
- AfterSales,
- ContactList
- },
- computed: {
- isDisable() {
- let flag = this.type != 'view'
- return flag;
- },
- isReport() {
- let flag = this.type != 'view' ? true : false
- return flag
- }
- },
- data() {
- return {
- current: 0,
- title: '修改工单',
- type: 'edit',
- Usertype: '',
- list: ['需求信息', '计划信息', '售后对象', '联系人', '方案'],
- listData: [], // 部门数据
- userList: [], // 执行人列表
- demandForm: {}, // 需求基本信息
- planForm: {}, // 计划基本信息
- productDetail: [], // 售后对象
- contactInfoVOS: [], // 联系人
- costListVOS: [], // 方案
- }
- },
- onLoad(params) {
- this.type = params.type;
- this.title = params.type == 'view' ? '工单详情' : '修改工单';
- this.getDetails(params.id);
- },
- onUnload() {},
- created() {},
- methods: {
- async getDetails(id) {
- // await this.getByData();
- // this.getDept();
- const res = await getSalesWorkOrderById(id);
- console.log(res, 'res 1=1')
- this.costListVOS = res.costListVOS;
- this.demandData(res.afterSalesDemandVO);
- this.planData(res.afterSalesPlanVO);
- },
- // 需求数据
- async demandData(data) {
- this.contactInfoVOS = data.contactInfoVOS || [];
- this.productDetail = data.productDetail || [];
- let fault_level = await this.getByData('fault_level', data.faultLevel);
- this.demandForm = {
- code: data.code,
- name: data.name,
- contactName: data.contactName,
- orderCode: data.orderCode,
- contactAddress: data.contactAddress,
- expectedTime: data.expectedTime,
- createUserName: data.createUserName,
- fault_level,
- }
- },
- // 计划信息
- async planData(data) {
- let isSyncBill = data.isSyncBill == '0' ? '否' : data.isSyncBill == '1' ? '是' : ''
- let urgent = await this.getByData('urgent_type', data.urgent);
- this.planForm = {
- code: data.code,
- name: data.name,
- isSyncBill,
- executeGroupName: data.executeGroupName,
- executeUserName: data.executeUserName,
- remark: data.remark,
- duration: data.duration,
- durationUnit: data.durationUnit,
- urgent,
- }
- },
- async getByData(code, value) {
- const codeValue = await getByCode(code);
- let label = '';
- codeValue.forEach((el) => {
- if (el[value]) {
- label = el[value];
- return;
- }
- })
- return label || ''
- },
- getDept() {
- listOrganizations(1).then(data => {
- this.listData = data;
- })
- },
- // confirm(data, name) {
- // this.form.executeGroupName = name
- // this.form.executeGroupId = data[0]
- // this.form.executeUserName = ''
- // this.form.executeUserId = ''
- // this.getUser(data[0])
- // },
- // getUser(deptCode) {
- // getUserPage({
- // pageNum: 1,
- // size: -1,
- // groupId: deptCode
- // }).then(data => {
- // this.userList = data.list.map(item => {
- // item.text = item.name
- // item.value = item.id
- // return item
- // })
- // })
- // },
- sectionChange(index) {
- this.current = index;
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- /deep/.u-subsection__item__text {
- font-size: 28rpx !important;
- }
- /deep/.u-cell__body__content {
- flex: none;
- margin-right: 16rpx;
- }
- /deep/ .time_select .uni-data-tree-input {
- width: 200rpx;
- }
- /deep/ .executor_user {
- background: #fff;
- }
- .footerButton {
- width: 100%;
- height: 84rpx;
- display: flex;
- position: fixed;
- bottom: 0;
- z-index: 10;
- /deep/.u-button {
- height: 100%;
- }
- >view {
- flex: 1;
- }
- }
- </style>
|