<template>
  <view class="handler">
    <view class="head">
      <view class="tab" :class="{active: tab.value === dataInfo.tabActiveValue}" v-for="tab in dataInfo.tabs" :key="tab.id" @click="clickTab(tab.value)">
        {{tab.name}}<text v-if="tab.num !== ''">({{tab.num}})</text>
      </view>
    </view>
    <!-- <scroll-view scroll-y class="body page_padding"> -->
		<view class="body page_padding view-body">
      <!-- 故障处理 -->
      <template v-if="dataInfo.tabActiveValue === 'direct'">
        <view class="form_item column" v-if="HandleData.simpleness != 1">
          <view class="title title-width">
						<text class="required newicon newicon-bitian"></text>
						<view class="title-fl-sb">
							解决方案：
							<view @click="importRep('reissue','direct')" class="import-rep">引入知识库({{dataInfo.introduceCount}})</view>
						</view>	
					</view>
					<uni-easyinput class="value" type="textarea" v-model="dataInfo.handleDescription" placeholder="请输入解决方案" :class="{formRed: isSubmit && !dataInfo.handleDescription.trim()}" />
        </view>
        <view class="form_item" v-if="HandleData.simpleness != 1">
          <view class="title"><text class="required newicon newicon-bitian"></text>故障现象：</view>
          <view class="value category" @click="selectCategory">
            <text class="categoryName ellipsis-multiline">{{dataInfo.category.mutiCategory}}</text>
            <text class="newicon newicon-weibiaoti2010104"></text>
          </view>
        </view>
        <view class="form_item">
          <view class="title select"><text class="required newicon newicon-bitian"></text>处理方式：</view>
          <!-- <uni-data-select class="value" v-model="dataInfo.handleCategory" :localdata="dataInfo.handleCategoryList" :clear="false" placeholder="请选择处理方式" :class="{formRed: isSubmit && !dataInfo.handleCategory}"></uni-data-select> -->
					<uni-data-picker class="value" placeholder="请选择处理方式"
						:localdata="dataInfo.handleCategoryList" v-model="dataInfo.handleCategory" 
						:clear-icon="false" :class="{formRed: isSubmit && !dataInfo.handleCategory}">
					</uni-data-picker>
				</view>
        <view class="form_item" v-if="HandleData.simpleness != 1">
          <view class="title select"><text class="required newicon newicon-bitian"></text>处理结果：</view>
          <!-- <uni-data-select class="value" v-model="dataInfo.closecode" :localdata="dataInfo.closecodeList" :clear="false" placeholder="请选择处理结果" :class="{formRed: isSubmit && !dataInfo.closecode}"></uni-data-select> -->
					<uni-data-picker class="value" placeholder="请选择处理结果"
						:localdata="dataInfo.closecodeList" v-model="dataInfo.closecode" 
						:clear-icon="false" :class="{formRed: isSubmit && !dataInfo.closecode}">
					</uni-data-picker>
				</view>
        <view class="form_item">
          <view class="title"><text class="required newicon newicon-bitian transparent"></text>协同人员：</view>
          <text class="synergeticNames ellipsis">{{ synergeticArr}}</text>
          <button type="primary" plain size="mini" class="primaryPlainButton synergeticAdd" @click="synergeticAdd">+立即添加</button>
        </view>
        <view class="form_item_column">
          <view class="form_item">
            <view class="title"><text class="required newicon newicon-bitian transparent"></text>处理图片：</view>
            <view class="value">
              <uni-file-picker ref="handlerImgRef" v-model="dataInfo.handlerImgList" limit="3" @success="handlerImgSuccess" @fail="handlerImgFail" @select="handlerImgSelect" @delete="handlerImgDelete"></uni-file-picker>
            </view>
          </view>
          <view class="form_item">
            <view class="title transparent"><text class="required newicon newicon-bitian transparent"></text>处理图片：</view>
            <view class="value">
              <text class="imgTips ellipsis">(支持JPG/PNG格式图片，单张大小10M以内)</text>
            </view>
          </view>
        </view>
      </template>
      
      <!-- 补单 -->
      <template v-if="dataInfo.tabActiveValue === 'supplement' && dataInfo.supplementFlag">
        <view class="form_item">
          <view class="title select"><text class="required newicon newicon-bitian"></text>登记时间：</view>
          <uni-datetime-picker class="value" type="datetime" v-model="dataInfo.acceptDate" :class="{formRed: isSubmit && !dataInfo.acceptDate}" />
      	</view>
        <view class="form_item">
          <view class="title select"><text class="required newicon newicon-bitian"></text>接单时间：</view>
          <uni-datetime-picker class="value" type="datetime" v-model="dataInfo.responseHandleTime" :class="{formRed: isSubmit && !dataInfo.responseHandleTime}" />
        </view>
        <view class="form_item">
          <view class="title select"><text class="required newicon newicon-bitian"></text>解决时间：</view>
          <uni-datetime-picker class="value" type="datetime" v-model="dataInfo.handleTime" :class="{formRed: isSubmit && !dataInfo.handleTime}" />
        </view>
        <view class="form_item">
          <view class="title select"><text class="required newicon newicon-bitian"></text>处理人：</view>
        	<uni-data-picker class="value" placeholder="请选择处理人"
        		:localdata="dataInfo.userList" v-model="dataInfo.handlingPersonnelUserId" 
        		:clear-icon="false" :class="{formRed: isSubmit && !dataInfo.handlingPersonnelUserId}">
        	</uni-data-picker>
        </view>
      </template>
      
      <!-- 补单-下一步 -->
      <template v-if="dataInfo.tabActiveValue === 'supplement' && !dataInfo.supplementFlag">
        <view class="form_item column" v-if="HandleData.simpleness != 1">
					<view class="title title-width">
						<text class="required newicon newicon-bitian"></text>
						<view class="title-fl-sb">
							解决方案：
							<view @click="importRep('reissue','reissue')" class="import-rep">引入知识库({{dataInfo.introduceCount}})</view>
						</view>	
					</view>
          <uni-easyinput class="value" type="textarea" v-model="dataInfo.handleDescription" placeholder="请输入解决方案" :class="{formRed: isSubmit && !dataInfo.handleDescription.trim()}" />
        </view>
        <view class="form_item" v-if="HandleData.simpleness != 1">
          <view class="title"><text class="required newicon newicon-bitian"></text>故障现象：</view>
          <view class="value category" @click="selectCategory('assign_supplement')">
            <text class="categoryName ellipsis-multiline">{{dataInfo.category.mutiCategory}}</text>
            <text class="newicon newicon-weibiaoti2010104"></text>
          </view>
        </view>
        <view class="form_item">
          <view class="title select"><text class="required newicon newicon-bitian"></text>处理方式：</view>
        	<uni-data-picker class="value" placeholder="请选择处理方式"
        		:localdata="dataInfo.handleCategoryList" v-model="dataInfo.handleCategory" 
        		:clear-icon="false" :class="{formRed: isSubmit && !dataInfo.handleCategory}">
        	</uni-data-picker>
        </view>
        <view class="form_item" v-if="HandleData.simpleness != 1">
          <view class="title select"><text class="required newicon newicon-bitian"></text>处理结果：</view>
        	<uni-data-picker class="value" placeholder="请选择处理结果"
        		:localdata="dataInfo.closecodeList" v-model="dataInfo.closecode" 
        		:clear-icon="false" :class="{formRed: isSubmit && !dataInfo.closecode}">
        	</uni-data-picker>
        </view>
        <view class="form_item">
          <view class="title"><text class="required newicon newicon-bitian transparent"></text>协同人员：</view>
          <text class="synergeticNames ellipsis">{{synergeticArr}}</text>
          <button type="primary" plain size="mini" class="primaryPlainButton synergeticAdd" @click="synergeticAdd('assign_supplement')">+立即添加</button>
        </view>
        <view class="form_item_column">
          <view class="form_item">
            <view class="title"><text class="required newicon newicon-bitian transparent"></text>处理图片：</view>
            <view class="value">
              <uni-file-picker ref="handlerImgRef" v-model="dataInfo.handlerImgList" limit="3" @success="handlerImgSuccess" @fail="handlerImgFail" @select="handlerImgSelect" @delete="handlerImgDelete"></uni-file-picker>
            </view>
          </view>
          <view class="form_item">
            <view class="title transparent"><text class="required newicon newicon-bitian transparent"></text>处理图片：</view>
            <view class="value">
              <text class="imgTips ellipsis">(支持JPG/PNG格式图片，单张大小10M以内)</text>
            </view>
          </view>
        </view>
      </template>
      
      <!-- 派单 -->
      <template v-if="dataInfo.tabActiveValue === 'assign'">
        <view class="form_item">
          <view class="title select"><text class="required newicon newicon-bitian"></text>工作组：</view>
          <!-- <uni-data-select class="value" v-model="dataInfo.groupId" :localdata="dataInfo.groupList" :clear="false" placeholder="请选择工作组" @change="changeGroup" :class="{formRed: isSubmit && !dataInfo.groupId}"></uni-data-select> -->
					<uni-data-picker class="value" placeholder="请选择工作组"
						:localdata="dataInfo.groupList" v-model="dataInfo.groupId" 
						:clear-icon="false" @change="changeGroup" :class="{formRed: isSubmit && !dataInfo.groupId}">
					</uni-data-picker>
				</view>
        <view class="form_item">
          <view class="title radio"><text class="required newicon newicon-bitian"></text>是否转派到人：</view>
          <uni-data-checkbox class="value" v-model="dataInfo.isAssignUser" :localdata="dataInfo.isAssignUserList" @change="changeIsAssignUser" />
        </view>
        <view class="form_item" v-if="dataInfo.isAssignUser === 1">
          <view class="title select"><text class="required newicon newicon-bitian"></text>转派对象：</view>
          <!-- <uni-data-select class="value" v-model="dataInfo.userId" :localdata="dataInfo.userList" :clear="false" placeholder="请选择转派对象" :class="{formRed: isSubmit && dataInfo.groupId && dataInfo.isAssignUser == 1 && !dataInfo.userId}"></uni-data-select> -->
					<uni-data-picker class="value" placeholder="请选择转派对象"
						:localdata="dataInfo.userList" v-model="dataInfo.userId" 
						:clear-icon="false" :class="{formRed: isSubmit && dataInfo.groupId && dataInfo.isAssignUser == 1 && !dataInfo.userId}">
					</uni-data-picker>
				</view>
        <!-- <view class="form_item_column">
          <view class="form_item">
            <view class="title"><text class="required newicon newicon-bitian transparent"></text>处理图片：</view>
            <view class="value">
              <uni-file-picker ref="handlerImgRef" v-model="dataInfo.handlerImgList" limit="3" @success="handlerImgSuccess" @fail="handlerImgFail" @select="handlerImgSelect" @delete="handlerImgDelete"></uni-file-picker>
            </view>
          </view>
          <view class="form_item">
            <view class="title transparent"><text class="required newicon newicon-bitian transparent"></text>处理图片：</view>
            <view class="value">
              <text class="imgTips ellipsis">(支持JPG/PNG格式图片，单张大小10M以内)</text>
            </view>
          </view>
        </view> -->
      </template>
		</view>
    <!-- </scroll-view> -->
    <view class="foot_common_btns">
      <template v-if="dataInfo.tabActiveValue === 'supplement' && dataInfo.supplementFlag">
        <button @click="goBack" type="default" class="primaryButton btn">上一步</button>
        <button @click="next" type="default" class="primaryButton btn">下一步</button>
      </template>
      <template v-else>
        <button @click="previous" type="default" class="primaryButton btn" v-if="dataInfo.tabActiveValue === 'supplement'">上一步</button>
        <button @click="goBackView" type="default" class="cancelButton btn" v-else>返回</button>
        <button @click="submit" type="default" class="primaryButton btn">提交</button>
      </template>
    </view>
  </view>
</template>

<script setup>
  import { ref, reactive, computed } from 'vue'
  import { onLoad } from '@dcloudio/uni-app'
  import { generateNumberArray } from '@/utils/index.js'
  import { api_group, getFetchDataList, api_incidentDetail, api_getSolution, api_user, api_incidentTask, api_branch, api_dutyDepartment, api_getDictionary, api_querySummaryDoc, api_addSummaryDoc, api_systemConfiguration, api_sj } from "@/http/api.js"
  import { defaultColor } from '@/static/js/theme.js'
  import { useSetTitle } from '@/share/useSetTitle.js'
  import { useMakePhoneCall } from '@/share/useMakePhoneCall.js'
  import { useUploadFile } from '@/share/useUploadFile.js'
  import { useGoBack } from '@/share/useGoBack.js'
  import { useLoginUserStore } from '@/stores/loginUser'
  import { useHandlerStore } from '@/stores/handler'
  import { useIncidentBuildStore } from '@/stores/incidentBuild'
  
  useSetTitle();
  const loginUserStore = useLoginUserStore();
  const handlerStore = useHandlerStore();
  const incidentBuildStore = useIncidentBuildStore();
  const { makePhoneCall }  = useMakePhoneCall();
  const { uploadFile }  = useUploadFile();
  const { goBack }  = useGoBack();
  
  // 主题颜色
  const primaryColor = ref(defaultColor)
  
	// 知识库id
	const solutionId = ref(null)
	
	// 楼层id
	const floorId = ref(null)
	
	// 是否简单处理
	const HandleData = reactive({
		simpleness:null
	})
	
	// 协同人员
	const synergeticArr = ref(null)
	
	const dicData = ref(null)
	
	const dutyList = ref(null)
	
	const userTypes = ref(null)
	
  // 数据
  const dataInfo = reactive({
    tabs: [
      {id: 5, name: '直接处理', value: 'direct', num: ''},
      // {id: 7, name: '补单', value: 'supplement', num: ''},
      {id: 6, name: '派单', value: 'assign', num: ''},
    ],
    tabActiveValue: 0,//当前选择的tab
    incidentId: undefined,//事件ID
    incidentData: {},//事件对象
    groupList: [], //工作组列表
    groupId: undefined, //工作组ID
    userIdList: [], //延期天数列表
    userIdId: undefined, //延期天数ID
    deferralRemark: '',//延期说明
    summaryObj: {
      consumableList: [],//耗材列表
      workHourManagementList: [],//工时列表
    },//汇总单信息
    summaryId: undefined,//汇总单Id
    isNumber: false,//修改数量弹窗
    evtNumber: 1,//弹窗返回的数量
    selectData: {},//选择的对象
    selectType: {},//选择的对象类型
    handleDescription: '',//解决方案
    handleCategory: undefined,//处理方式
    handleCategoryList: [],//处理方式列表
    closecode: undefined,//处理结果
    closecodeList: [],//处理结果列表
    handlerImgList: [],//处理图片列表
    category: {},//故障现象
    synergetic: null,//协同人员
    isAssignUser: 1, //工作组是否转派到人
    isAssignUserList: [
      { text: '是', value: 1 },
      { text: '否', value: 0 },
    ], //工作组是否转派到人选项
    supplementFlag: true,//补单是否有下一步
    acceptDate: undefined,//补单-登记时间
    responseHandleTime: undefined,//补单-接单时间
    handleTime: undefined,//补单-解决时间
    handlingPersonnelUserId: undefined,//补单-处理人
		// introduceCount :0 //引入次数
  })
  
  // 是否提交
  const isSubmit = ref(false)
  
  // 处理图片
  const handlerImgRef = ref(null)
  
  // 上传报修图片
  function handlerImgSuccessNew(){
    let requestList = [];
    
    // 报修图片
    dataInfo.incidentData.repairImgList.forEach(v => {
      let repairOrderImg$ = repairOrderImg(v);
      requestList.push(repairOrderImg$);
    })
    
    Promise.all(requestList).then(resList => {
      uni.hideLoading();
      console.log(resList);
      incidentBuildStore.clearIncidentBuildData();
      uni.showToast({
      	icon: 'none',
        title: '建单成功',
        mask: true,
      });
      setTimeout(() => {
        uni.reLaunch({
          url: '/pages/incidentList/incidentList',
        })
      }, 1500)
    })
  }
  
	// 返回引用知识库
	function goBackView(){
		handlerStore.setHandlerData(dataInfo, 'assign', 'assign');
		goBack()
	}
	
  // 上传处理图片成功
  function handlerImgSuccess(e){
    dataInfo.handlerImgList.forEach(v => {
      v.url = v.path;
    })
    console.log(dataInfo.handlerImgList);
    let requestList = [];
    
    // 处理图片
    dataInfo.handlerImgList.forEach(v => {
      let handlerOrderImg$ = handlerOrderImg(v);
      requestList.push(handlerOrderImg$);
    })
    
    // 报修图片
    dataInfo.incidentData.repairImgList.forEach(v => {
      let repairOrderImg$ = repairOrderImg(v);
      requestList.push(repairOrderImg$);
    })
    
    Promise.all(requestList).then(resList => {
      uni.hideLoading();
      console.log(resList);
      incidentBuildStore.clearIncidentBuildData();
      uni.showToast({
      	icon: 'none',
        title: '建单成功',
        mask: true,
      });
      setTimeout(() => {
        uni.reLaunch({
          url: '/pages/incidentList/incidentList',
        })
      }, 1500)
    })
  }
  
  // 上传处理图片失败
  function handlerImgFail(e){
    dataInfo.handlerImgList.forEach(v => {
      v.url = v.path;
    })
    console.log(dataInfo.handlerImgList);
  }
  
  // 选择上传图片
  function handlerImgSelect(e){
    dataInfo.handlerImgList = dataInfo.handlerImgList.concat(e.tempFiles);
    console.log(dataInfo.handlerImgList);
  }
  
  // 删除上传图片
  function handlerImgDelete(e){
    dataInfo.handlerImgList = dataInfo.handlerImgList.filter(v => e.tempFile.uuid != v.uuid);
    console.log(dataInfo.handlerImgList);
  }
  
  // 添加协同人员
  function synergeticAdd(sign = 'assign'){
    handlerStore.setHandlerData(dataInfo, 'assign', sign);
    uni.navigateTo({
      url: `/pages/synergeticAdd/synergeticAdd?incidentId=${dataInfo.incidentId}`
    })
  }
  
  // 选择故障现象
  function selectCategory(sign = 'assign'){
    handlerStore.setHandlerData(dataInfo, 'assign', sign);
    uni.navigateTo({
      url: `/pages/categoryOne/categoryOne?incidentId=${dataInfo.incidentId}`
    })
  }
  
  // 点击修改数量
  function numberClick(data, type){
    if(type === 'editConsumable'){
      dataInfo.evtNumber = data.consumablesNum;
    }else if(type === 'editWorkHourManagement'){
      dataInfo.evtNumber = data.workHourNum2;
    }
    
    dataInfo.isNumber = true;
    dataInfo.selectData = data;
    dataInfo.selectType = type;
  }
  
  // 确认修改数量
  function conformNumber(evtNumber){
    dataInfo.evtNumber = evtNumber;
    dataInfo.isNumber = false;
    addSummaryDoc();
  }
  
  // 移除数量
  function removeNumber(evtNumber){
    dataInfo.evtNumber = evtNumber;
    dataInfo.isNumber = false;
    removeSummaryDoc();
  }
  
  // 关闭修改数量
  function cancelNumber(){
    dataInfo.isNumber = false;
  }
  
  // 修改耗材/工时
  function addSummaryDoc(){
    uni.showLoading({
      title: "加载中",
      mask: true,
    });
    let postData = {
      "summaryId": dataInfo.summaryId,
      "modifyNum": 'edit',
    };
    if(dataInfo.selectType === 'editConsumable'){
      postData.consumableList = [
        {
          "consumablesId": dataInfo.selectData.consumableId,
          "consumablesNum": dataInfo.evtNumber,
        }
      ];
    }else if(dataInfo.selectType === 'editWorkHourManagement'){
      postData.workHourManagementList = [
        {
          "workHourId": dataInfo.selectData.id,
          "workHourNum": dataInfo.evtNumber,
        }
      ];
    }
    api_addSummaryDoc(postData).then(res => {
      uni.hideLoading();
      if(res.status == 200){
        uni.showToast({
        	icon: 'none',
          title: '修改数量成功',
          mask: true,
        });
        getSummaryList();
      }else{
        uni.showToast({
          icon: 'none',
          title: res.msg || '请求数据失败！'
        });
      }
    })
  }
  
  // 移除耗材/工时
  function removeSummaryDoc(){
    uni.showLoading({
      title: "加载中",
      mask: true,
    });
    let postData = {
      "summaryId": dataInfo.summaryId,
      "remove": 'remove',
    };
    if(dataInfo.selectType === 'editConsumable'){
      postData.consumableList = [
        {
          "consumablesId": dataInfo.selectData.consumableId,
          "consumablesNum": dataInfo.evtNumber,
        }
      ];
    }else if(dataInfo.selectType === 'editWorkHourManagement'){
      postData.workHourManagementList = [
        {
          "workHourId": dataInfo.selectData.id,
          "workHourNum": dataInfo.evtNumber,
        }
      ];
    }
    api_addSummaryDoc(postData).then(res => {
      uni.hideLoading();
      if(res.status == 200){
        uni.showToast({
        	icon: 'none',
          title: '移除成功',
          mask: true,
        });
        getSummaryList();
      }else{
        uni.showToast({
          icon: 'none',
          title: res.msg || '请求数据失败！'
        });
      }
    })
  }
  
  // 重置
  function reset(){
    dataInfo.userList = [];//处理人列表
    dataInfo.repairTypeList = []; //延期原因列表
    dataInfo.groupId = undefined; //延期原因ID
    dataInfo.userIdList = []; //延期天数列表
    dataInfo.userIdId = undefined; //延期天数ID
    dataInfo.deferralRemark = '';//延期说明
    dataInfo.summaryObj = {
      consumableList: [],//耗材列表
      workHourManagementList: [],//工时列表
    };//汇总单信息
    dataInfo.summaryId = undefined;//汇总单Id
    dataInfo.isNumber = false;//修改数量弹窗
    dataInfo.evtNumber = 1;//弹窗返回的数量
    dataInfo.selectData = {};//选择的对象
    dataInfo.selectType = {};//选择的对象类型
    dataInfo.handleDescription = '';//解决方案
		solutionId.value = null;//引用知识库id
    dataInfo.handleCategory = undefined;//处理方式
    dataInfo.handleCategoryList = [];//处理方式列表
    dataInfo.closecode = undefined;//处理结果
    dataInfo.closecodeList = [];//处理结果列表
    dataInfo.handlerImgList = [];//处理图片列表
    dataInfo.category = {};//故障现象
    dataInfo.synergetic = [];//协同人员
  }
  
  // 初始化表单
  function initForm(){
    if(dataInfo.tabActiveValue === 'direct'){
      getHandleCategorys();
      getClosecodes();
    }else if(dataInfo.tabActiveValue === 'supplement'){
			getDicGu();
      getHandleCategorys();
      getClosecodes();
    }else if(dataInfo.tabActiveValue === 'assign'){
      getGroups();
    }
  }
  
  // 点击tab
  function clickTab(tabValue){
    if(dataInfo.tabActiveValue == tabValue){
      return;
    }
    dataInfo.tabActiveValue = tabValue;
    isSubmit.value = false;
    reset();
    dataInfo.category = dataInfo.incidentData.category || {};
		if(dataInfo.incidentData.synergetic&&dataInfo.incidentData.synergetic.length>0){
			synergeticArr.value = dataInfo.incidentData.synergetic.map(v => v.name).join('，');
		}
    initForm();
  }
  
  // 选择工作组
  function changeGroup(){
    dataInfo.userId = undefined;
    dataInfo.userList = [];
		let postData = {
			"key": 'usertype',
			"type": "list",
		};
		api_getDictionary(postData).then((data) => {
			userTypes.value = data;
			getUsers('');
		});
  }
	
  function getDicGu(){
		let postData = {
			"key": 'usertype',
			"type": "list",
		};
		api_getDictionary(postData).then((data) => {
			userTypes.value = data;
			getUsers('har');
		});
	}
	
  // 选择是否转派到人
  function changeIsAssignUser(){
    dataInfo.userId = undefined;
  }
  
  // 获取工作组列表
  function getGroups(){
    uni.showLoading({
      title: "加载中",
      mask: true,
    });
    
    let postData = {
      "idx": 0,
      "sum": 9999,
      "group2": {
        "hospitals": dutyList.value.id,
      }
    };
    api_group(postData).then(res => {
      uni.hideLoading();
      if(res.status == 200){
        res.list = res.list || [];
				let arr = res.list.filter(i=>i.type==3)
        dataInfo.groupList = arr.map(v => ({
          text: v.groupName,
          value: v.id,
        }));
      }else{
        uni.showToast({
          icon: 'none',
          title: res.msg || '请求数据失败！'
        });
      }
    })
  }
  
  /**
   * 获取用户列表
   * @param {boolean} noGroup 是否查询组里的用户
   */
  function getUsers(type,noGroup = false){
    uni.showLoading({
      title: "加载中",
      mask: true,
    });
    let postData = {
      "idx": 0,
      "sum": 9999,
      "user": {
				roledata:{
					rolecode:'',
				},
				roleCodes:'',
        "hospital": dutyList.value.id,
        "groupdata": (dataInfo.groupId && !noGroup) ? { "id": dataInfo.groupId } : undefined,
        userTypeIds:String(userTypes.value.map(v => v.id)),
      }
    };
		if(type=='har'){
			postData.user.roledata.rolecode = 'first-line support'
			delete postData.user.roleCodes
		}else{
			postData.user.roleCodes = 'first-line support,second-line support'
			delete postData.user.roledata.rolecode
		}
    api_user(postData).then(res => {
      uni.hideLoading();
      if(res.status == 200){
        res.list = res.list || [];
        dataInfo.userList = res.list.map(v => ({
          text: v.name,
          value: v.id,
        }));
      }else{
        uni.showToast({
          icon: 'none',
          title: res.msg || '请求数据失败！'
        });
      }
    })
  }
  
  // 获取处理方式列表
  function getHandleCategorys(){
    uni.showLoading({
      title: "加载中",
      mask: true,
    });
    let postData = {
      "key": 'incident_handle_type',
      "type": "list",
    };
    api_getDictionary(postData).then(res => {
      uni.hideLoading();
      res = res || [];
      dataInfo.handleCategoryList = res.map(v => ({
        text: v.name,
        value: v.id,
        key: v.value,
      }));
      if(!dataInfo.handleCategory){
        let handleCategory = dataInfo.handleCategoryList.find(v => v.key == 'SUPPORT');
        dataInfo.handleCategory = handleCategory ? handleCategory.value : undefined;
      }
    })
  }
  
  // 获取处理结果列表
  function getClosecodes(){
    uni.showLoading({
      title: "加载中",
      mask: true,
    });
    let postData = {
      "key": 'incident_closecode',
      "type": "list",
    };
    api_getDictionary(postData).then(res => {
      uni.hideLoading();
      res = res || [];
      dataInfo.closecodeList = res.map(v => ({
        text: v.name,
        value: v.id,
        key: v.value,
      }));
      if(!dataInfo.closecode){
        let closecode = dataInfo.closecodeList.find(v => v.key == '060');
        dataInfo.closecode = closecode ? closecode.value : undefined;
      }
    })
  }
  
  // 添加耗材
  function addConsumable(){
    uni.navigateTo({
      url: `/pages/consumableList/consumableList?incidentId=${dataInfo.incidentId}&summaryId=${dataInfo.summaryId}`
    })
  }
  
  // 添加工时
  function addWorkHourManagement(){
    uni.navigateTo({
      url: `/pages/workHourManagementOne/workHourManagementOne?incidentId=${dataInfo.incidentId}&summaryId=${dataInfo.summaryId}`
    })
  }
  
  // 补单-上一步
  function previous(){
    dataInfo.supplementFlag = true;
  }
  
  // 补单-下一步
  function next(){
    console.log(dataInfo)
    isSubmit.value = true;
    if(!dataInfo.acceptDate){
      uni.showToast({
      	icon: 'none',
        title: '请选择登记时间'
      });
      return;
    }
    
    if(!dataInfo.responseHandleTime){
      uni.showToast({
      	icon: 'none',
        title: '请选择接单时间'
      });
      return;
    }
    
    if(!dataInfo.handleTime){
      uni.showToast({
      	icon: 'none',
        title: '请选择解决时间'
      });
      return;
    }
    
    if(!dataInfo.handlingPersonnelUserId){
      uni.showToast({
      	icon: 'none',
        title: '请选择处理人'
      });
      return;
    }
    dataInfo.supplementFlag = false;
    isSubmit.value = false;
  }
  
  // 提交
  function submit(){
    isSubmit.value = true;
		if(dataInfo.incidentData.priority){
		  dataInfo.incidentData.priorityId = dataInfo.incidentData.priority
		}
		// dataInfo.incidentData.duty = dutyList.value.id
		if(loginUserStore.loginUser.user.currentHospital.parent){
			dataInfo.incidentData.hosId = loginUserStore.loginUser.user.currentHospital.parent.id
		}else{
			dataInfo.incidentData.hosId = loginUserStore.loginUser.user.currentHospital.id
		}
    if(dataInfo.tabActiveValue === 'direct'){
      submitHandler();
    }else if(dataInfo.tabActiveValue === 'supplement'){
      submitSupplement();
    }else if(dataInfo.tabActiveValue === 'assign'){
      submitAssign();
    }
  }
  
  // 处理提交事件
  async function handlerOrder(){
    let postData = {
      incident: dataInfo.incidentData,
			solutionId: solutionId.value
    }
    // let result = await beforeBuild();
    // if(result[0].status == 200 && result[1].status == 200){
    //   postData.incident.repairType = result[0].list.length ? result[0].list[0].valueconfig : undefined;
    //   postData.incident.incidentsign = result[1].data || undefined;
    // }else{
    //   uni.showToast({
    //     icon: 'none',
    //     title: '请求数据失败！'
    //   });
    //   return;
    // }
		postData.incident.place = {}
		postData.incident.place.id = floorId.value
    postData.incident.handleDescription = dataInfo.handleDescription;
    postData.incident.handleCategory = {id: dataInfo.handleCategory};
    postData.incident.closecode = {id: dataInfo.closecode};
    postData.incident.category = dataInfo.category;
		if(dataInfo.synergetic && dataInfo.synergetic.length>0){
			postData.incident.synergetic = dataInfo.synergetic
		}else{
			postData.incident.synergetic = null
		}
		console.log(999, postData.incident)
    postData.incident.directProcess = 1;//直接解决
    return api_incidentTask('accept', postData);
  }
  
  // 补单提交事件
  async function supplementOrder(){
    let postData = {
      incident: dataInfo.incidentData,
			solutionId: solutionId.value
    }
    
    // let result = await beforeBuild();
    // if(result[0].status == 200 && result[1].status == 200){
    //   postData.incident.repairType = result[0].list.length ? result[0].list[0].valueconfig : undefined;
    //   postData.incident.incidentsign = result[1].data || undefined;
    // }else{
    //   uni.showToast({
    //     icon: 'none',
    //     title: '请求数据失败！'
    //   });
    //   return;
    // }
    
		postData.incident.place = {}
		postData.incident.place.id = floorId.value
    postData.incident.handleDescription = dataInfo.handleDescription;
    postData.incident.handleCategory = {id: dataInfo.handleCategory};
    postData.incident.closecode = {id: dataInfo.closecode};
    postData.incident.category = dataInfo.category;
		if(dataInfo.synergetic && dataInfo.synergetic.length>0){
			postData.incident.synergetic = dataInfo.synergetic
		}else{
			postData.incident.synergetic = null
		}
    postData.incident.directProcess = 1;//直接解决
    
    postData.incident.acceptDate = dataInfo.acceptDate;
    postData.incident.responseHandleTime = dataInfo.responseHandleTime;
    postData.incident.handleTime = dataInfo.handleTime;
    postData.incident.handlingPersonnelUser = { id: dataInfo.handlingPersonnelUserId };
    return api_incidentTask('patchOrder', postData);
  }
  
  // 建单前的接口
  function beforeBuild(){
    let repairMain$ = api_systemConfiguration({
        "idx": 0,
        "sum": 1,
        "systemConfiguration": {
          "keyconfig": "repairMain"
        }
    })
    
    let sj$ = api_sj();
    return Promise.all([repairMain$, sj$])
  }
  
  // 派单提交事件
  async function assignOrder(){
    let postData = {
      incident: dataInfo.incidentData,
    }
    
    // let result = await beforeBuild();
    // if(result[0].status == 200 && result[1].status == 200){
    //   postData.incident.repairType = result[0].list.length ? result[0].list[0].valueconfig : undefined;
    //   postData.incident.incidentsign = result[1].data || undefined;
    // }else{
    //   uni.showToast({
    //     icon: 'none',
    //     title: '请求数据失败！'
    //   });
    //   return;
    // }
    
		postData.incident.place = {}
		postData.incident.place.id = floorId.value
    if(dataInfo.userId){
      // 派人
      postData.incident.assignee = dataInfo.userId;
    } else {
      // 派组
      postData.incident.candidateGroups = dataInfo.groupId;
    }
    
    return api_incidentTask('accept', postData);
  }
  
  // 处理图片
  function handlerOrderImg(imgObj){
    return uploadFile(imgObj, 'incident', dataInfo.incidentId)
  }
  
  // 报修图片
  function repairOrderImg(imgObj){
    return uploadFile(imgObj, 'wechatRequesterIncident', dataInfo.incidentId)
  }
  
	// 引入知识库
	function importRep(type,tabType){
		dataInfo.operateType = type
		dataInfo.tabType = tabType
		handlerStore.setHandlerData(dataInfo, 'assign', 'assign');
		uni.navigateTo({
		  url: `/pages/repository/repository?incidentId=${dataInfo.incidentId}`
		})
	}
	
  // 处理提交
  function submitHandler(){
    console.log(dataInfo);
    if(!dataInfo.handleDescription.trim() && HandleData.simpleness != 1){
      uni.showToast({
      	icon: 'none',
        title: '请填写解决方案'
      });
      return;
    }
    
    if(!dataInfo.category.id && HandleData.simpleness != 1){
      uni.showToast({
      	icon: 'none',
        title: '请选择故障现象'
      });
      return;
    }
    
    if(!dataInfo.handleCategory){
      uni.showToast({
      	icon: 'none',
        title: '请选择处理方式'
      });
      return;
    }
    
    if(!dataInfo.closecode && HandleData.simpleness != 1){
      uni.showToast({
      	icon: 'none',
        title: '请选择处理结果'
      });
      return;
    }
    
    if(!dutyList.value){
      uni.showToast({
      	icon: 'none',
        title: '您选择的故障现象没有设置责任科室'
      });
      return;
    }
    uni.showLoading({
      title: "加载中",
      mask: true,
    });
    
    if(dataInfo.handlerImgList.length){
      // 有处理图片
      let handlerOrder$ = handlerOrder();
      let requestList = [handlerOrder$];
      Promise.all(requestList).then(resList => {
        console.log(resList);
        if(resList[0].state == 200){
          dataInfo.incidentId = resList[0].data.id;
          handlerImgRef.value.upload();
        }else{
          uni.hideLoading();
          uni.showToast({
            icon: 'none',
            title: resList[0].msg || '请求数据失败！'
          });
        }
      })
    }else if(dataInfo.incidentData.repairImgList.length){
      // 有报修图片,无处理图片
      let handlerOrder$ = handlerOrder();
      let requestList = [handlerOrder$];
      Promise.all(requestList).then(resList => {
        console.log(resList);
        if(resList[0].state == 200){
          dataInfo.incidentId = resList[0].data.id;
          handlerImgSuccessNew();
        }else{
          uni.hideLoading();
          uni.showToast({
            icon: 'none',
            title: resList[0].msg || '请求数据失败！'
          });
        }
      })
    }else{
      // 没有图片
      let handlerOrder$ = handlerOrder();
      let requestList = [handlerOrder$];
      Promise.all(requestList).then(resList => {
        uni.hideLoading();
        console.log(resList);
        if(resList[0].state == 200){
          incidentBuildStore.clearIncidentBuildData();
          uni.showToast({
          	icon: 'none',
            title: '建单成功',
            mask: true,
          });
          setTimeout(() => {
            uni.reLaunch({
              url: '/pages/incidentList/incidentList',
            })
          }, 1500)
        }else{
          uni.showToast({
            icon: 'none',
            title: resList[0].msg || '请求数据失败！'
          });
        }
      })
    }
  }
  
  // 派单提交
  function submitAssign(){
		console.log(444,dutyList.value)
    if(!dataInfo.groupId){
      uni.showToast({
      	icon: 'none',
        title: '请选择工作组'
      });
      return;
    }
    
    if(dataInfo.isAssignUser == 1 && !dataInfo.userId){
      uni.showToast({
      	icon: 'none',
        title: '请选择指派对象'
      });
      return;
    }
    
    if(!dutyList.value){
      uni.showToast({
      	icon: 'none',
        title: '您选择的故障现象没有设置责任科室'
      });
      return;
    }
    
    uni.showLoading({
      title: "加载中",
      mask: true,
    });
    
    if(dataInfo.incidentData.repairImgList.length){
      // 有图片
      let assignOrder$ = assignOrder();
      let requestList = [assignOrder$];
      Promise.all(requestList).then(resList => {
        console.log(resList);
        if(resList[0].state == 200){
          dataInfo.incidentId = resList[0].data.id;
          // handlerImgRef.value.upload();
          handlerImgSuccessNew();
        }else{
          uni.hideLoading();
          uni.showToast({
            icon: 'none',
            title: resList[0].msg || '请求数据失败！'
          });
        }
      })
    }else{
      // 没有图片
      let assignOrder$ = assignOrder();
      let requestList = [assignOrder$];
      Promise.all(requestList).then(resList => {
        uni.hideLoading();
        console.log(resList);
        if(resList[0].state == 200){
          incidentBuildStore.clearIncidentBuildData();
          uni.showToast({
          	icon: 'none',
            title: '建单成功',
            mask: true,
          });
          setTimeout(() => {
            uni.reLaunch({
              url: '/pages/incidentList/incidentList',
            })
          }, 1500)
        }else{
          uni.showToast({
            icon: 'none',
            title: resList[0].msg || '请求数据失败！'
          });
        }
      })
    }
   
  }
  
  // 补单提交
  function submitSupplement(){
    console.log(dataInfo);
    if(!dataInfo.handleDescription.trim() && HandleData.simpleness != 1){
      uni.showToast({
      	icon: 'none',
        title: '请填写解决方案'
      });
      return;
    }
    
    if(!dataInfo.category.id && HandleData.simpleness != 1){
      uni.showToast({
      	icon: 'none',
        title: '请选择故障现象'
      });
      return;
    }
    
    if(!dataInfo.handleCategory){
      uni.showToast({
      	icon: 'none',
        title: '请选择处理方式'
      });
      return;
    }
    
    if(!dataInfo.closecode && HandleData.simpleness != 1){
      uni.showToast({
      	icon: 'none',
        title: '请选择处理结果'
      });
      return;
    }
    
    if(!dutyList.value){
      uni.showToast({
      	icon: 'none',
        title: '您选择的故障现象没有设置责任科室'
      });
      return;
    }
    console.log(dataInfo)
    console.log(dataInfo.handlerImgList)
    console.log(dataInfo.incidentData.repairImgList)
    
    uni.showLoading({
      title: "加载中",
      mask: true,
    });
    
    if(dataInfo.handlerImgList.length){
      // 有处理图片
      let supplementOrder$ = supplementOrder();
      let requestList = [supplementOrder$];
      Promise.all(requestList).then(resList => {
        console.log(resList);
        if(resList[0].state == 200){
          dataInfo.incidentId = resList[0].data.id;
          handlerImgRef.value.upload();
        }else{
          uni.hideLoading();
          uni.showToast({
            icon: 'none',
            title: resList[0].msg || '请求数据失败！'
          });
        }
      })
    }else if(dataInfo.incidentData.repairImgList.length){
      // 有报修图片,无处理图片
      let supplementOrder$ = supplementOrder();
      let requestList = [supplementOrder$];
      Promise.all(requestList).then(resList => {
        console.log(resList);
        if(resList[0].state == 200){
          dataInfo.incidentId = resList[0].data.id;
          handlerImgSuccessNew();
        }else{
          uni.hideLoading();
          uni.showToast({
            icon: 'none',
            title: resList[0].msg || '请求数据失败！'
          });
        }
      })
    }else{
      // 没有图片
      let supplementOrder$ = supplementOrder();
      let requestList = [supplementOrder$];
      Promise.all(requestList).then(resList => {
        uni.hideLoading();
        console.log(resList);
        if(resList[0].state == 200){
          incidentBuildStore.clearIncidentBuildData();
          uni.showToast({
          	icon: 'none',
            title: '建单成功',
            mask: true,
          });
          setTimeout(() => {
            uni.reLaunch({
              url: '/pages/incidentList/incidentList',
            })
          }, 1500)
        }else{
          uni.showToast({
            icon: 'none',
            title: resList[0].msg || '请求数据失败！'
          });
        }
      })
    }
  }
  
  // 菜单权限
  function menuAuthHandle(){
    let shijianliebiao_supplement = false;//故障处理权限
    for (let i = 0; i < loginUserStore.loginUser.menu.length; i++) {
        if (loginUserStore.loginUser.menu[i].link == "replenishment") {
          shijianliebiao_supplement = true
        }
    }
    
    // 补单
    if(shijianliebiao_supplement){
      let index = dataInfo.tabs.findIndex(v => v.value === 'assign');
      dataInfo.tabs.splice(index, 0, {id: 7, name: '补单', value: 'supplement', num: ''});
    }
  }
  
	// 获取知识库数量
	function getIntroduceCount(categoryId){
	  uni.showLoading({
	    title: "加载中",
	    mask: true,
	  });
	  let postData = {
	    idx: 0,
	    sum: 9999,
	    solution: {
				deleteFlag:0,
				hosId: loginUserStore.loginUser.user.currentHospital.id,
				categoryId: categoryId,
				status:{id:dicData.value?.id},
	    }
	  }
	  
	  api_getSolution(postData).then(res => {
	    uni.hideLoading();
	    if(res.status == 200){
				dataInfo.introduceCount = res.totalNum
	    }else{
	      uni.showToast({
	        icon: 'none',
	        title: res.msg || '请求数据失败！'
	      });
	    }
	  })
	}
	
	// 获取文本内容
	function getHtml(html) {
	  const tempDiv = document.createElement('div');
	  tempDiv.innerHTML = html;
	  return tempDiv.textContent || tempDiv.innerText || '';
	}
	
	// 获取字典
	function getDic(){
		let postData = {
		  "key": 'solution_status',
		  "type": "list",
		};
		api_getDictionary(postData).then(res => {
		  dicData.value = res.find(v => v.value == '3');
			// 跳转页面选择了选项
			if(handlerStore.handler.data){
			  Object.assign(dataInfo, handlerStore.handler.data);
				if(dataInfo.synergetic){
					synergeticArr.value = dataInfo.synergetic.map(v => v.name).join('，')
				}
			  if(handlerStore.handler.sign === 'assign'){
			    dataInfo.tabActiveValue = 'direct';
			  }else if(handlerStore.handler.sign === 'assign_supplement'){
			    dataInfo.tabActiveValue = 'supplement';
			    next();
			  }
				
				let storeData = handlerStore.handler.data
				if(storeData.type == 'rep'){
					dataInfo.handleDescription = null;
					if(storeData.handleDescription){
						dataInfo.handleDescription = storeData.handleDescription;
						solutionId.value = storeData.solutionId
					}
					if(storeData.tabType == 'direct'){
						dataInfo.tabActiveValue = 'direct'
					}else{
						dataInfo.tabActiveValue = 'supplement'
						dataInfo.supplementFlag = false
					}
				}
				
			  handlerStore.clearHandlerData();
			  
			  if(dataInfo.category){
			     dataInfo.incidentData.category = dataInfo.category;
					 if(dataInfo.incidentData.place.floor){
					 	floorId.value = JSON.parse(JSON.stringify(dataInfo.incidentData.place.floor.id))
					 }else{
						floorId.value = JSON.parse(JSON.stringify(dataInfo.incidentData.place.id))
					 }
					 console.log(111)
					 getIntroduceCount(dataInfo.category.id)
			    // 处理责任科室
			  //   if(dataInfo.category.branchType == 1){
			  //     // 分院区
			  //     if(dataInfo.incidentData.branch){
			  //       let dutyConfig = dataInfo.category.branchUserGroups.find(v=>v.branchId == dataInfo.incidentData.branch);
			  //       if(dutyConfig && dutyConfig.dutyId && dutyConfig.dutyName){
			  //         dataInfo.incidentData.duty = {id:dutyConfig.dutyId,dept:dutyConfig.dutyName};
			  //       }else{
			  //         dataInfo.incidentData.duty = undefined;
			  //       }
			  //     }else{
			  //       dataInfo.incidentData.duty = undefined;
			  //     }
			  //   }else{
			  //     // 不分院区
					// 	// dataInfo.incidentData.hosId = loginUserStore.loginUser.user.currentHospital.id;
						
					// }
					getDuty()
			  }
			}else if(incidentBuildStore.incidentBuild.data){
				console.log(222)
			  // 初始化
			  Object.assign(dataInfo.incidentData, incidentBuildStore.incidentBuild.data);
				if(dataInfo.incidentData.category){
					if(dataInfo.incidentData.synergetic){
						synergeticArr.value = dataInfo.incidentData.synergetic.map(v => v.name).join('，')
					}
			    dataInfo.category = dataInfo.incidentData.category;
			    getIntroduceCount(dataInfo.category.id)
			    // 处理责任科室
			    // if(dataInfo.category.branchType == 1){
			    //   // 分院区
			    //   if(dataInfo.incidentData.branch){
			    //     let dutyConfig = dataInfo.category.branchUserGroups.find(v=>v.branchId == dataInfo.incidentData.branch);
			    //     if(dutyConfig && dutyConfig.dutyId && dutyConfig.dutyName){
			    //       dataInfo.incidentData.duty = {id:dutyConfig.dutyId,dept:dutyConfig.dutyName};
			    //     }else{
			    //       dataInfo.incidentData.duty = undefined;
			    //     }
			    //   }else{
			    //     dataInfo.incidentData.duty = undefined;
			    //   }
			    // }else{
			    //   // 不分院区
			    //   dataInfo.incidentData.hosId = loginUserStore.loginUser.user.currentHospital.id;
			    // }
			  }
				if(dataInfo.incidentData.place.floor){
					floorId.value = JSON.parse(JSON.stringify(dataInfo.incidentData.place.floor.id))
				}else{
					floorId.value = JSON.parse(JSON.stringify(dataInfo.incidentData.place.id))
				 }
				getDuty()
			  if(dataInfo.incidentData.source){
			    dataInfo.incidentData.source = { id: dataInfo.incidentData.source };
			  }
			  if(dataInfo.incidentData.requester){
			    dataInfo.incidentData.requester = dataInfo.incidentData.requester
			  }
			}
		})
	}
	
	// 获取故障现象绑定的科室
	function getDuty(){
		let postData = {
		  idx: 0,
		  sum: 9999,
		  incidentCategoryConfig: {
		    categoryId: dataInfo.incidentData.category.id,
		    dutyId: loginUserStore.loginUser.user.currentHospital.id,
		  },
		};
		getFetchDataList("simple/data", "incidentCategoryConfig", postData).then(res => {
			let item = res.list.find(i=>i.categoryId == dataInfo.incidentData.category.id) 
			dutyList.value = item.dutyDTO
			dataInfo.incidentData.duty = dutyList.value.id
			initForm()
			console.log(1111,dutyList.value)
		})
	}
	
	// 获取是否开启汇总单
	function getHosConfig(){
		let postData = {
			idx: 0,
			sum: 9999,
			hospitalConfig:{
				hosId: loginUserStore.loginUser.user.currentHospital.id,
				model: "itsm"
			}
		};
		getFetchDataList("simple/data", "hospitalConfig", postData)
			.then((res) => {
				// SummaryData.value = res.list.find(i=>i.key=='itsmSummarySheet')
				HandleData.simpleness = res.list.find(i=>i.key=='itsmSimpleHandle').value
			});
	}
		
  onLoad((option) => {
		getHosConfig()
    menuAuthHandle()
		getDic()
    if(!dataInfo.tabActiveValue){
      dataInfo.tabActiveValue = dataInfo.tabs[0].value;
    }
  })
</script>

<style lang="scss" scoped>
.handler{
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  .head{
    height: 88rpx;
    display: flex;
    position: fixed;
    z-index: 99;
    width: 100%;
    background-color: #fff;
    font-size: 30rpx;
    .tab{
      flex: 1;
      display: flex;
      justify-content: center;
      align-items: center;
      border-bottom: 4rpx solid transparent;
      &.active{
        color: $uni-primary;
        border-color: $uni-primary;
      }
    }
  }
  .body{
    margin-top: 88rpx;
    box-sizing: border-box;
    flex: 1;
    min-height: 0;
    &.bg{
      background-color: #F7F7F7;
    }
    .summaryItem{
      &:first-of-type{
        .summaryItem_head{
          border-bottom: 1rpx solid #DDDDDD;
        }
      }
      .summary_total{
        padding: 20rpx 0;
        display: flex;
        justify-content: center;
        align-items: center;
      }
      .summaryItem_head{
        padding: 24rpx;
        font-size: 26rpx;
        color: #3A3A3A;
      }
      .summaryItem_body{
        font-size: 30rpx;
        background-color: #fff;
        .summaryItem_bodyItem{
          padding: 24rpx;
          border-bottom: 1rpx solid #DDDDDD;
          .summaryItem_bodyItem_top{
            display: flex;
            justify-content: space-between;
            align-items: center;
            .value{
              padding-left: 48rpx;
              flex-shrink: 0;
            }
          }
          .summaryItem_bodyItem_bottom{
            margin-top: 24rpx;
            display: flex;
            justify-content: space-between;
            align-items: center;
            .name{
              text-align: right;
              flex: 1;
            }
            .value{
              width: 240rpx;
              text-align: right;
              padding-left: 48rpx;
              flex-shrink: 0;
            }
          }
        }
      }
      .summaryItem_foot{
        font-size: 30rpx;
        background-color: #fff;
        &.total{
          margin-top: 24rpx;
        }
        .summaryItem_foot_total{
          padding: 24rpx 0;
          display: flex;
          justify-content: center;
          align-items: center;
        }
        .summaryItem_foot_add{
          border-top: 1rpx solid #DDDDDD;
          padding: 24rpx 0;
          display: flex;
          justify-content: center;
          align-items: center;
          .newicon-icon-test{
            font-size: 30rpx;
            font-weight: bold;
          }
        }
      }
    }
    .form_item_column{
      padding-top: 24rpx;
      min-height: 86rpx;
      .form_item{
        padding-top: 0;
        min-height: auto;
      }
    }
    .form_item{
      display: flex;
      align-items: center;
      padding-top: 24rpx;
      min-height: 86rpx;
      &.column{
        height: auto;
        flex-direction: column;
        align-items: flex-start;
				.import-rep{
					padding: 5rpx 10rpx;
					border-radius: 50rpx;
					background: #d1fcd5;
					color: #49b856;
					font-size: 24rpx;
				}
        .title{
          margin-right: 0;
        }
				.title-width{
					width: 100%;
				}
				.title-fl-sb{
					display: flex;
					justify-content: space-between;
					width: 100%;
				}
        .value{
          margin-top: 10rpx;
          padding-left: 20rpx;
          box-sizing: border-box;
        }
        .tips{
          padding: 24rpx;
          text-align: center;
          font-size: 22rpx;
          color: #909399;
          width: 100%;
          box-sizing: border-box;
        }
      }
      .title{
        font-size: 26rpx;
        display: flex;
        align-items: center;
        margin-right: 12rpx;
        flex-shrink: 0;
        &.select{
          width: calc(5em + 20rpx);
        }
      }
      .value{
        width: 100%;
        &.category{
          width: 100%;
          display: flex;
          justify-content: space-between;
          align-items: center;
          .categoryName{
            font-size: 26rpx;
            color: #555;
            flex: 1;
          }
          .newicon-weibiaoti2010104{
            color: $uni-primary;
            margin-left: 24rpx;
          }
        }
        .imgTips{
          color: #909399;
          font-size: 22rpx;
        }
      }
      .synergeticNames{
        font-size: 26rpx;
        margin-right: 24rpx;
      }
      .synergeticAdd{
        flex-shrink: 0;
      }
    }
  }
}
</style>
