人民医院前端

addComDispatch.vue 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. <template>
  2. <page-meta :root-font-size="getFontSizeValue"></page-meta>
  3. <view class="wrapper">
  4. <view class="form">
  5. <!-- 基础表单校验 -->
  6. <uni-forms ref="valiForm" :rules="rules" :modelValue="valiFormData">
  7. <uni-forms-item label="工单类别" required name="WorkOrderCategory">
  8. <order-select :orderType="valiFormData.WorkOrderCategory" @post-select-data="postSelectData"
  9. :typeid="2000" :readonly="readonly"></order-select>
  10. </uni-forms-item>
  11. <uni-forms-item label="申请部门" required name="ApplicationDept">
  12. <uni-data-picker placeholder="请选择申请部门" :localdata="deptDataTree"
  13. v-model="valiFormData.ApplicationDept" @nodeclick="deptNodeclick" :showSearch="showSearch" @popupclosed="popupclosedDept" @searchTrue="departSearchTrue">
  14. </uni-data-picker>
  15. </uni-forms-item>
  16. <uni-forms-item label="科室电话" required name="DeptPhone">
  17. <uni-easyinput v-model="valiFormData.DeptPhone" placeholder="请输入联系电话" />
  18. </uni-forms-item>
  19. <uni-forms-item label="申请人" required name="ApplicantName">
  20. <uni-combox :candidates="candidates" placeholder="输入搜索内容" @input="handleInput" v-model="valiFormData.ApplicantName"></uni-combox>
  21. </uni-forms-item>
  22. <uni-forms-item label="联系电话" required name="Phone">
  23. <uni-easyinput v-model="valiFormData.Phone" placeholder="请输入联系电话" />
  24. </uni-forms-item>
  25. <uni-forms-item label="科室位置" required name="Location">
  26. <uni-easyinput v-model="valiFormData.Location" placeholder="请输入科室位置" />
  27. </uni-forms-item>
  28. <view style="margin: 15px 0;" v-show="valiFormData.WorkOrderCategory && flag[flaginfo]">
  29. <view style="margin-bottom: 15px;">
  30. <text class="infoTittle"><text v-show="flaginfo==='2001' || flaginfo==='2003'|| flaginfo==='127548'|| flaginfo==='10617' || flaginfo==='JC'|| flaginfo==='FJ' || flaginfo==='2007'" style="color: red;">*</text>{{flagName[flaginfo]}}</text>
  31. <uni-icons type="plus" size="30" color="#007aff" @click="plusClck()"></uni-icons>
  32. <uni-icons type="minus" size="30" color="#007aff" @click="minusClck()"></uni-icons>
  33. </view>
  34. <view style="width: 100%;height: 85px;" v-for="(item, index) in dicList">
  35. <view class="dicSelect" v-if="identification==='JC' || identification==='FJ'">
  36. <uni-data-picker class="uni_item" placeholder="请选择标本信息" :localdata="dataOrderType" @nodeclick="(e)=>nodeclickMuter(e,index)">
  37. </uni-data-picker>
  38. </view>
  39. <view style="margin-bottom: 2px;width: 100%;" v-if="identification==='2007'">
  40. <uni-data-picker placeholder="请选择科室" v-model="item.F_ToDept" :showSearch="showSearch" :localdata="deptDataTree" @nodeclick="(e)=>nodeclickDept(e,index)">
  41. </uni-data-picker>
  42. </view>
  43. <view v-if="identification!=='JC' && identification!=='FJ'" class="dicSelect">
  44. <dictionaries-select v-if="identification!=='2007'" :flag="flag[flaginfo]" :valInfo="index" :val="item.F_DicId + ','+ item.F_DicName"
  45. @post-select-dic="postSelectDic"></dictionaries-select>
  46. <luyj-select-lay v-if="identification==='2007'" lay-omit name="name" :options="bloodList" :zindex="1" slabel='text' @selectitem="(e)=>selectitem(e,index)">
  47. </luyj-select-lay>
  48. </view>
  49. <view class="dicNum">
  50. <uni-number-box v-model="item.F_Number" />
  51. </view>
  52. <view style="display: block;width: 100%;text-align: center;" v-if="identification === '2001' || identification === '2003'|| identification === 'YQT'">
  53. <uni-data-checkbox v-model="item.F_IsBorrow" :localdata="F_IsBorrowTypesList" />
  54. </view>
  55. </view>
  56. </view>
  57. <!-- <uni-forms-item label="送达地点" required name="ToPlace">
  58. <dictionaries-select flag="SDKS" @post-select-dic="postSelectDicPlace" v-if="identification === '2006' || identification === 'JC' || identification === 'FJ'"></dictionaries-select>
  59. <uni-easyinput v-model="valiFormData.ToPlace" placeholder="请输入送达地点" v-else/>
  60. </uni-forms-item> -->
  61. <uni-forms-item label="备注" name="Content">
  62. <uni-easyinput type="textarea" v-model="valiFormData.Content" placeholder="请输入备注" />
  63. </uni-forms-item>
  64. <uni-forms-item label="红处方数量" required name="redPrescriptionNum" v-show="flaginfo == '2004' ">
  65. <uni-number-box v-model="redPrescriptionNum" />
  66. </uni-forms-item>
  67. <!-- <uni-forms-item label="紧急程度" name="EmergencyTypes">
  68. <uni-data-checkbox v-model="valiFormData.EmergencyTypes" :localdata="EmergencyTypesList" />
  69. </uni-forms-item> -->
  70. <uni-forms-item label="附件" name="">
  71. <view class="example-body">
  72. <!-- <upload @post-string-data="getImgData" :imgUrlList="imgUrlList"></upload> -->
  73. <l-file ref="lFile" :logo="logo" @up-success="onSuccess"></l-file>
  74. <view class="padding" style="margin-top: 10px;">
  75. <button class="mini-btn" type="primary" size="mini" @tap="onUpload">上传</button>
  76. </view>
  77. <view class="padding">
  78. <uni-file-picker limit="5" file-mediatype="all" :value="fileLists" @delete="deleteFile"></uni-file-picker>
  79. </view>
  80. </view>
  81. </uni-forms-item>
  82. </uni-forms>
  83. <view class="btnClass">
  84. <button type="primary" :disabled="disabledButton" @click="submit('valiForm')">提交工单</button>
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. import orderSelect from "@/pages/components/orderSelect/orderSelect"
  91. import indexConfig from '@/config/index.config';
  92. import {
  93. filterTreeDatas,
  94. filterSelectData
  95. } from '@/utils/dataTreating.js'
  96. import pageData from "@/pages/myTask/repairList/addRepair/pageData.js"
  97. import upload from '@/pages/components/upload/upload.vue' //upload
  98. import uploadFile from '@/pages/components/upload/uploadFile.vue' //upload
  99. import newfile from '@/pages/components/upload-imagesAndvideo/index.vue' //upload
  100. import dictionariesSelect from '@/pages/components/dictionariesSelect/dictionariesSelect.vue' //upload
  101. export default {
  102. components: {
  103. upload,
  104. uploadFile,
  105. newfile,
  106. orderSelect,
  107. dictionariesSelect
  108. },
  109. data() {
  110. return {
  111. bloodList:[],
  112. dataOrderType:[],
  113. identification: '', // 工单标识
  114. getFontSizeValue:'1rem',
  115. showSearch: true,
  116. logo: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fbpic.588ku.com%2Felement_origin_min_pic%2F00%2F00%2F07%2F155788a6d8a5c42.jpg&refer=http%3A%2F%2Fbpic.588ku.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1619847627&t=2da40b583002205c204d980b54b35040',
  117. isShowIsEnd: false,
  118. readonly: false,
  119. disabledButton: false,
  120. // 校验表单数据
  121. valiFormData: {
  122. WorkOrderCategory: '', //工单类别
  123. ApplicationDept: '', //申请部门
  124. Applicant: '', //申请人
  125. ApplicantName: '',
  126. Phone: '', //联系电话
  127. Location: '', // 科室位置
  128. DeptPhone:'',
  129. ToPlace: '', // 送达地点
  130. Content: '', // 工单内容
  131. DealDept: '', // 维修部门
  132. DealMan: '', // 维修人
  133. File: '', // 文件
  134. opt: 2,
  135. EmergencyTypes: '',
  136. },
  137. F_IsBorrowTypesList:[{
  138. text: '借',
  139. value: '1'
  140. },{
  141. text: '还',
  142. value: '2'
  143. }],
  144. EmergencyTypesList: [{
  145. text: '一般',
  146. value: '一般'
  147. },{
  148. text: '紧急',
  149. value: '紧急'
  150. }],
  151. departId:0,
  152. redPrescriptionNum: 0, // 红处方数量
  153. workorderid: '',
  154. stepData: pageData.stepData,
  155. departMain: '',
  156. imgUrlList: [], // 附件数据
  157. imgIdList: [], //上传附件id
  158. clickImgState: 0, // 图片回显的状态
  159. departList: [],
  160. deptDataTree: [], // 科室-部门数据
  161. ApplicantData: [], // 获取人员数据
  162. assignedDepartData: [], //指派部门数据
  163. MaintenancerData: [], //指派人数据
  164. orderApplicantData: [], // 用户人员信息
  165. userListSelect: [],
  166. typeid: 0,
  167. candidates: [],
  168. // 标本信息(BBXX),设备信息(SBXX),物资信息(WZXX),病床信息(BCXX),药品信息(YPXX)
  169. flagid: ["2001","2002","2003","2006","2005","9129","9130",'2007',"127548","10617"],
  170. flaginfo: '',
  171. fileLists: [],
  172. flag: {
  173. "2006": 'BBXX',
  174. "2001": 'SBXX',
  175. "2002": 'WZXX',
  176. "2003": 'BCXX',
  177. "2005": 'YPXX',
  178. "9129": 'BBXX',
  179. "9130": 'BBXX',
  180. "2007": 'XYLX',
  181. "127548": 'YQT',
  182. "10617": 'YQT',
  183. },
  184. flagName: {
  185. "2001": '设备信息',
  186. "2002": '物资信息',
  187. "2003": '病床信息',
  188. "2006": '标本信息',
  189. "2005": '药品信息',
  190. "9129": '标本信息',
  191. "9130": '标本信息',
  192. "2007": '送达科室',
  193. "127548": '设备信息',
  194. "10617": '设备信息',
  195. },
  196. dicList: [{
  197. F_DicId: 0,
  198. F_DicName: '',
  199. F_Number: 1,
  200. F_IsBorrow: '',
  201. F_ToDept: '',
  202. }],
  203. // 校验规则
  204. rules: {
  205. WorkOrderCategory: {
  206. rules: [{
  207. required: true,
  208. errorMessage: '请选择工单类别'
  209. }]
  210. },
  211. ApplicationDept: {
  212. rules: [{
  213. required: true,
  214. errorMessage: '请选择申请科室'
  215. }]
  216. },
  217. ApplicantName: {
  218. rules: [{
  219. required: true,
  220. errorMessage: '请选择申请人'
  221. }]
  222. },
  223. Phone: {
  224. rules: [{
  225. required: true,
  226. errorMessage: '清输入联系电话'
  227. }]
  228. },
  229. // Content: {
  230. // rules: [{
  231. // required: true,
  232. // errorMessage: '清输入工单内容'
  233. // }]
  234. // }
  235. },
  236. }
  237. },
  238. onLoad(option) {
  239. this.getFontSizeValue = uni.getStorageSync('fontSizeValue')+'rem'
  240. this.workorderid = option.wid
  241. // 添加工单,申请人默认当前登录人
  242. if(uni.getStorageSync("deptId")){
  243. this.valiFormData.ApplicationDept = uni.getStorageSync("deptId")
  244. this.getDeptLocation(uni.getStorageSync("deptId"))
  245. pageData.getApplicant(uni.getStorageSync("deptId"), (res, data, candidates) => {
  246. this.candidates = candidates
  247. this.ApplicantData = res
  248. this.orderApplicantData = data
  249. if(uni.getStorageSync("userCode")) {
  250. this.valiFormData.Applicant = uni.getStorageSync("userCode")
  251. this.valiFormData.ApplicantName = this.$mHelper.findUserName(this.ApplicantData, uni.getStorageSync("userCode"))
  252. const user = this.orderApplicantData.find((o) => {
  253. return o.usercode === this.valiFormData.Applicant.toString()
  254. })
  255. if (user) {
  256. this.valiFormData.Phone = user.usertelphone
  257. }
  258. this.getLocation(this.valiFormData.Applicant)
  259. }
  260. })
  261. }
  262. // 部门数据
  263. pageData.getDet((res, data) => {
  264. console.log(res)
  265. this.departList = data
  266. this.deptDataTree = res
  267. this.assignedDepartData = res
  268. })
  269. if(this.workorderid) {
  270. this.readonly = true
  271. this.getDetail()
  272. }
  273. window.scrollTo(0,0)
  274. this.getDicValueList()
  275. },
  276. watch: {
  277. 'departList': function() {
  278. this.valiFormData.ApplicationDept = this.$mHelper.findParents(this.departList,this.valiFormData.ApplicationDept).split('/').length + '_'+ this.valiFormData.ApplicationDept
  279. }
  280. },
  281. methods: {
  282. getDicValueList() {
  283. const params = {
  284. Flag: 'XYLX',
  285. Name: ''
  286. }
  287. this.$http.get("Dictionary/GetDicValueList",params).then((response)=>{
  288. let newData = []
  289. response.rows.forEach((element, index) => {
  290. const obj = {}
  291. obj.value = element.F_DictionaryValueId + ',' + element.F_Name
  292. obj.text = element.F_Name
  293. newData.push(obj)
  294. });
  295. this.bloodList = newData;
  296. // if(this.val) {
  297. // this.id = this.val
  298. // }
  299. })
  300. },
  301. selectitem(val,index) {
  302. var namestr = ''
  303. var idstr = ''
  304. if (val) {
  305. for(var i=0;i<val.length;i++){
  306. namestr += val[i].value.split(',')[1]+','
  307. idstr += val[i].value.split(',')[0]+','
  308. }
  309. this.dicList[index].F_DicId = idstr.slice(0,namestr.length-1)
  310. this.dicList[index].F_DicName = namestr.slice(0,namestr.length-1)
  311. }
  312. },
  313. getBBxx(){
  314. let str
  315. if(this.identification == 'JC'){
  316. str = '急查标本'
  317. }
  318. if(this.identification == 'FJ'){
  319. str = '非急查标本'
  320. }
  321. pageData.getBB(str,(res, data) => {
  322. this.dataOrderType = res
  323. })
  324. },
  325. nodeclickMuter(e,index){
  326. this.dicList[index].F_DicId = e.value
  327. this.dicList[index].F_DicName = e.text
  328. },
  329. nodeclickDept(e,index){
  330. console.log(e,'555555')
  331. this.dicList[index].F_ToDept = e.value
  332. // this.dicList[index].F_ToDeptValue = e.value
  333. },
  334. // 获取科室位置
  335. postSelectDicPlace(res) {
  336. this.valiFormData.ToPlace = res.split(',')[1]
  337. },
  338. // 删除附件
  339. deleteFile(res) {
  340. const num = this.fileLists.findIndex(v => v.url === res.tempFile.path);
  341. this.fileLists.splice(num, 1)
  342. },
  343. /* 附件上传 */
  344. onUpload() {
  345. this.$refs.lFile.upload({
  346. //替换为你的上传接口地址
  347. url: indexConfig.baseUrl + "/FaultRepair/UploadFile",
  348. // 服务端接收附件的key
  349. name: 'file',
  350. //根据你接口需求自定义 (优先不传content-type,安卓端无法收到参数再传)
  351. header: {
  352. Authorization: uni.getStorageSync('Admin-Token')
  353. },
  354. })
  355. },
  356. // 附件上传
  357. onSuccess(res) {
  358. res.data.data.forEach(v => {
  359. this.fileLists.push({
  360. url: indexConfig.baseUrl + v.F_FileUrl,
  361. extname: v.F_FileType,
  362. name: v.F_FileName.substring(19),
  363. id: v.F_FileId
  364. })
  365. })
  366. },
  367. postImgData(res) {
  368. },
  369. // 工单类别
  370. postSelectData(e,id,type,ident) {
  371. console.log(e,ident)
  372. this.identification = ident
  373. this.flaginfo = String(id)
  374. this.valiFormData.WorkOrderCategory = e
  375. if(this.flagid.indexOf(this.flaginfo) > -1) {
  376. this.dicList = [{
  377. F_DicId: 0,
  378. F_DicName: '',
  379. F_Number: 1
  380. }]
  381. }else{
  382. this.dicList = 0
  383. }
  384. this.getBBxx()
  385. },
  386. // 综合调度信息
  387. postSelectDic(e, index) {
  388. console.log(e,'888999')
  389. this.dicList[index].F_DicId = e.split(',')[0]
  390. this.dicList[index].F_DicName = e.split(',')[1]
  391. },
  392. plusClck() {
  393. const params = {
  394. F_DicId: 0,
  395. F_DicName: '',
  396. F_Number: 1
  397. }
  398. this.dicList.push(params)
  399. },
  400. minusClck() {
  401. this.dicList.splice(this.dicList.length - 1, 1)
  402. },
  403. clearTagAdmin(value){
  404. this.userListSelect = this.userListSelect.filter(item => item != value);
  405. },
  406. // 申请部门
  407. deptNodeclick(e) {
  408. if (e) {
  409. this.departId = e.value
  410. pageData.getApplicant(e.value.split('_')[1], (res, data, candidates) => {
  411. this.candidates = candidates
  412. console.log(this.candidates)
  413. this.ApplicantData = res
  414. this.orderApplicantData = data
  415. })
  416. this.candidates = []
  417. this.valiFormData.Applicant = ''
  418. this.valiFormData.ApplicantName = ''
  419. this.valiFormData.Phone = ''
  420. this.valiFormData.Location = ''
  421. this.valiFormData.ToPlace = ''
  422. this.valiFormData.DeptPhone = ''
  423. this.getDeptLocation(e.value.split('_')[1])
  424. }
  425. },
  426. departSearchTrue(e){
  427. this.valiFormData.ApplicationDept = e.value
  428. },
  429. popupclosedDept(e) {
  430. this.valiFormData.ApplicationDept = this.departId
  431. },
  432. //科室位置
  433. getDeptLocation(id){
  434. this.$http.get("Department/GetModel", {deptid:id}).then((response) => {
  435. if (response.state.toLowerCase() === "success") {
  436. this.valiFormData.Location = response.data.F_Location
  437. this.valiFormData.ToPlace = response.data.F_Location
  438. this.valiFormData.DeptPhone = response.data.F_OfficeTelephone
  439. }
  440. })
  441. },
  442. handleInput(res) {
  443. let e = this.$mHelper.getValueByText(res,this.ApplicantData)
  444. this.valiFormData.Applicant = e
  445. this.valiFormData.ApplicantName = res
  446. const user = this.orderApplicantData.find((o) => {
  447. return o.usercode === e.toString()
  448. })
  449. if (user) {
  450. this.valiFormData.Phone = user.usertelphone
  451. }
  452. this.getLocation(this.valiFormData.Applicant)
  453. },
  454. // 地址
  455. getLocation(user) {
  456. this.$http.get("UserAccount/GetModel", {usercode: user}).then((response) => {
  457. if (response.state.toLowerCase() === "success") {
  458. this.valiFormData.Location = response.data.F_Location
  459. this.valiFormData.ToPlace = response.data.F_Location
  460. }
  461. })
  462. },
  463. // 指派部门
  464. maintenanceNodeclick(e) {
  465. if(e) {
  466. this.departMain = e.value
  467. pageData.getApplicant(e.value, (res) => {
  468. this.MaintenancerData = res
  469. })
  470. }
  471. },
  472. maintenanceclosed() {
  473. this.valiFormData.DealDept = this.departMain
  474. },
  475. //指派人
  476. changeMaintenancer(e) {
  477. this.valiFormData.DealMan = e
  478. },
  479. // 工单提交
  480. submit(ref) {
  481. // console.log(this.dicList)
  482. // return
  483. for(var i=0;i<this.dicList.length;i++){
  484. if(this.dicList[i].F_ToDept){
  485. this.dicList[i].F_ToDept = this.dicList[i].F_ToDept.split('_')[1]
  486. }
  487. }
  488. if(this.identification === '2001' || this.identification === '2003' || this.identification === 'YQT'|| this.identification === 'JC' || this.identification === 'FJ' || this.identification === '2007'){
  489. if(this.dicList.length == 0 || (this.dicList.length>0 && !this.dicList[0].F_DicName)){
  490. this.$mHelper.toast('请选择对应物资信息')
  491. return
  492. }
  493. }
  494. if(this.identification === '2001' || this.identification === '2003'|| this.identification === 'YQT'){
  495. if(this.dicList.length > 0 && !this.dicList[0].F_IsBorrow){
  496. this.$mHelper.toast('请选择对应物资信息')
  497. return
  498. }
  499. }
  500. if(this.identification === '2007'){
  501. if(this.dicList.length > 0 && !this.dicList[0].F_ToDept){
  502. this.$mHelper.toast('请选择对应物资信息')
  503. return
  504. }
  505. }
  506. if(this.dicList.length == 0 || (this.dicList.length>0 && !this.dicList[0].F_DicName)){
  507. this.dicList = null
  508. }
  509. this.imgIdList = []
  510. this.disabledButton = true
  511. this.fileLists.forEach(v =>{
  512. this.imgIdList.push(v.id)
  513. })
  514. console.log(this.valiFormData.ApplicationDept)
  515. this.$refs[ref].validate().then(res => {
  516. const params = {
  517. WorkOrderCategory: this.valiFormData.WorkOrderCategory, //工单类别
  518. ApplicationDept: this.valiFormData.ApplicationDept.split('_')[1], //申请部门
  519. Applicant: this.valiFormData.Applicant, //申请人
  520. Phone: this.valiFormData.Phone, //联系电话
  521. Location: this.valiFormData.Location, // 科室位置
  522. DeptPhone:this.valiFormData.DeptPhone,
  523. // ToPlace: this.valiFormData.ToPlace, // 送达地点
  524. Content: this.valiFormData.Content, // 工单内容
  525. DealDept: this.valiFormData.DealDept, // 维修部门
  526. DealMan: this.valiFormData.DealMan, // 维修人
  527. File: this.$mHelper.getImgString(this.imgIdList), // 文件
  528. detailists: this.dicList,
  529. opt: this.valiFormData.opt,
  530. // EmergencyTypes: this.valiFormData.EmergencyTypes,
  531. cfnum: this.redPrescriptionNum
  532. }
  533. if(this.workorderid) {
  534. params.WorkOrderCode = this.workorderid
  535. params.usertype = 1
  536. this.$mHelper.httpPost("Scheduling/UpdateSchedulingWorkOrder", this.serialize(params), 1, res => this.disabledButton = res)
  537. }else{
  538. this.$mHelper.httpPost("Scheduling/AddSchedulingWorkOrder", this.serialize(params), 1, res => this.disabledButton = res)
  539. }
  540. }).catch(err => {
  541. this.disabledButton = false
  542. console.log('err', err);
  543. })
  544. },
  545. serialize(obj, prefix) {
  546. const str = []
  547. let p
  548. if (obj.length === 0) {
  549. // str.push(encodeURIComponent(prefix) + '=1')
  550. } else {
  551. for (p in obj) {
  552. if (obj.hasOwnProperty(p)) {
  553. const k = prefix ? prefix + '[' + p + ']' : p
  554. let v = obj[p]
  555. if (v instanceof Date) {
  556. v = parseTime(v)
  557. }
  558. str.push((v !== null && typeof v === 'object') ? this.serialize(v, k) : encodeURIComponent(k) +'=' + encodeURIComponent(v))
  559. }
  560. }
  561. }
  562. return str.join('&')
  563. },
  564. getDetail() {
  565. const params = {
  566. WorkOrderCode: this.workorderid,
  567. type: 0
  568. }
  569. this.$http.get("Scheduling/GetWorkOrder", params).then((response) => {
  570. if (response.state.toLowerCase() === "success") {
  571. this.valiFormData.WorkOrderCategory = response.data[0].F_WorkOrderCategory // 工单类别
  572. this.valiFormData.Content = response.data[0].F_Content // 工单内容
  573. if(response.data[0].F_ApplicationDept) {
  574. this.valiFormData.ApplicationDept = response.data[0].F_ApplicationDept.trim() // 申请部门
  575. pageData.getApplicant(this.valiFormData.ApplicationDept, (res) => {
  576. this.ApplicantData = res
  577. })
  578. this.valiFormData.ApplicantName = this.$mHelper.findUserName(this.ApplicantData, response.data[0].F_Applicant)
  579. this.valiFormData.Applicant = response.data[0].F_Applicant //申请人
  580. }
  581. this.valiFormData.Phone = response.data[0].F_Phone // 联系电话
  582. this.valiFormData.DeptPhone = response.data[0].F_DeptPhone
  583. this.valiFormData.Location = response.data[0].F_Location
  584. // this.valiFormData.ToPlace = response.data[0].F_ToPlace
  585. this.valiFormData.File = response.data[0].F_File
  586. // this.valiFormData.EmergencyTypes = response.data[0].F_EmergencyTypes
  587. const ps = []
  588. response.data[0].PSInfo.forEach(v => {
  589. ps.push({
  590. F_DicId: v.F_DicId,
  591. F_DicName: v.F_DicName,
  592. F_Number: v.F_Number
  593. })
  594. })
  595. this.dicList = ps
  596. if (response.data[0].FileUrl) {
  597. response.data[0].FileUrl.forEach((v, n) => {
  598. //详情图片回显
  599. this.fileLists.push({
  600. url: v.F_FileUrl,
  601. extname: v.F_FileType,
  602. name: v.F_FileName.substring(19),
  603. id:v.F_FileId
  604. })
  605. })
  606. }
  607. }
  608. }).catch((e) => {
  609. console.log(e);
  610. })
  611. },
  612. // 上传图片
  613. getImgData(data) {
  614. this.clickImgState = 1
  615. this.imgIdList = data
  616. },
  617. }
  618. }
  619. </script>
  620. <style lang="scss" scoped>
  621. @import '@/common/addFormDeep.scss';
  622. .wrapper {
  623. padding: 10px 15px;
  624. background-color: #fff;
  625. .form {
  626. .infoTittle {
  627. align-items: center;
  628. text-align: left;
  629. font-size: 14px;
  630. color: #606266;
  631. height: 36px;
  632. padding: 0 12px 0 0;
  633. vertical-align: middle;
  634. flex-shrink: 0;
  635. // box-sizing: border-box;
  636. margin-right: 10px;
  637. }
  638. .dicSelect {
  639. width: 65%;
  640. display: inline-block;
  641. margin-right: 10px;
  642. margin-bottom: 15px;
  643. }
  644. .dicNum {
  645. width: 30%;
  646. display: inline-block;
  647. }
  648. /deep/.uni-icons[data-v-a2e81f6e] {
  649. vertical-align: middle;
  650. }
  651. .point {
  652. color: #f00;
  653. vertical-align: middle;
  654. margin-right: 2px;
  655. }
  656. }
  657. }
  658. </style>