暫無描述

editWorkOrder.vue 33KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919
  1. <template>
  2. <view class="wrapper">
  3. <view class="form">
  4. <form @submit="formSubmit" @reset="formReset">
  5. <view class="uni-form-item uni-column">
  6. <view class="title">标题:</view>
  7. <input class="uni-input" name="workOrderTitle" :value="formData.workOrderTitle" placeholder="标题" />
  8. </view>
  9. <view class="uni-form-item uni-column">
  10. <view class="title">来电内容:</view>
  11. <view class="uni-textarea">
  12. <textarea name="callContent" :value="formData.callContent" auto-height />
  13. </view>
  14. </view>
  15. <view class="uni-form-item uni-column">
  16. <view class="title">工单内容:</view>
  17. <view class="uni-textarea">
  18. <textarea name="workOrderContent" :value="formData.workOrderContent" auto-height />
  19. </view>
  20. </view>
  21. <view class="uni-form-item uni-column">
  22. <view class="title">处理方式:</view>
  23. <radio-group name="processingMethod" :value="formData.processingMethod" @change="bindChangeProcessingMethod">
  24. <label> <radio value="1" :checked="!radioChecked.processingMethod" /><text>当即办理</text> </label>
  25. <label> <radio value="0" :checked="radioChecked.processingMethod" /><text>网络转办</text> </label>
  26. </radio-group>
  27. </view>
  28. <view class="uni-form-item uni-column" v-show="isDisplay.result">
  29. <view class="title">办理内容:</view>
  30. <view class="uni-textarea">
  31. <textarea name="result" :value="formData.result" auto-height />
  32. </view>
  33. </view>
  34. <view class="uni-form-item uni-column">
  35. <view class="title">姓名:</view>
  36. <input class="uni-input" name="name" :value="formData.name" placeholder="请输入姓名" />
  37. </view>
  38. <view class="uni-form-item uni-column">
  39. <view class="title">性别:</view>
  40. <radio-group name="gender" :value="formData.gender">
  41. <label> <radio value="0" :checked="radioChecked.gender" /><text>男</text></label>
  42. <label> <radio value="1" :checked="!radioChecked.gender" /><text>女</text></label>
  43. </radio-group>
  44. </view>
  45. <view class="uni-form-item uni-column">
  46. <view class="title">反映类别:</view>
  47. <view>
  48. <bjx-inputs the-style="overflow: auto" :value="formData.responseCategory" item-key="names" placeholder="请输入内容" @list="getReflectCategoryData" @select="selectReflectCategory" overflow="hide"> </bjx-inputs>
  49. </view>
  50. </view>
  51. <view class="uni-form-item uni-column">
  52. <view class="title uni-common-pl">来源:</view>
  53. <view class="uni-list">
  54. <view class="uni-list-cell">
  55. <view class="uni-list-cell-db">
  56. <picker @change="bindPickerChangeSource" :range="sourceListData" :range-key="'F_Value'">
  57. <view name="source" class="uni-input">{{ sourceListData[pickerIndex.indexSource].F_Value }}</view>
  58. </picker>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="uni-form-item uni-column">
  64. <view class="title">来电号码:</view>
  65. <input class="uni-input" name="callerNumber" :value="formData.callerNumber" placeholder="请输入来电号码" />
  66. </view>
  67. <view class="uni-form-item uni-column">
  68. <view class="title uni-common-pl">类型:</view>
  69. <view class="uni-list">
  70. <view class="uni-list-cell">
  71. <view class="uni-list-cell-db">
  72. <picker @change="bindPickerChangeType" value="" :range="typeListData" :range-key="'F_Value'">
  73. <view class="uni-input">{{ typeListData[pickerIndex.indexType].F_Value }}</view>
  74. </picker>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="uni-form-item uni-column">
  80. <view class="title">号码密级:</view>
  81. <radio-group name="numberSecurityLevel" :value="formData.numberSecurityLevel">
  82. <label> <radio value="0" :checked="radioChecked.numberSecurityLevel" /><text>普通</text> </label>
  83. <label> <radio value="1" :checked="!radioChecked.numberSecurityLevel" /><text>保密</text> </label>
  84. </radio-group>
  85. </view>
  86. <view class="uni-form-item uni-column">
  87. <view class="title uni-common-pl">紧急程度:</view>
  88. <view class="uni-list">
  89. <view class="uni-list-cell">
  90. <view class="uni-list-cell-db">
  91. <picker @change="bindPickerChangeEmergencyLevel" :value="pickerIndex.indexEmergencyLevel" :range="emergencyLevelListData" :range-key="'text'">
  92. <view class="uni-input">{{ emergencyLevelListData[pickerIndex.indexEmergencyLevel].text }}</view>
  93. </picker>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. <view class="uni-form-item uni-column" v-show="isDisplay.phoneType">
  99. <view class="title uni-common-pl">电话类别:</view>
  100. <view class="uni-list">
  101. <view class="uni-list-cell">
  102. <view class="uni-list-cell-db">
  103. <picker @change="bindPickerChangePhoneType" :value="formData.phoneType" :range="phoneTypeListData" :range-key="'F_Remark'">
  104. <view class="uni-input">{{ phoneTypeListData[pickerIndex.indexPhoneType].F_Remark }}</view>
  105. </picker>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="uni-form-item uni-column" v-show="isDisplay.leaderCharge">
  111. <view class="title uni-common-pl">分管领导:</view>
  112. <view class="uni-list">
  113. <view class="uni-list-cell">
  114. <view class="uni-list-cell-db">
  115. <picker @change="bindPickerChangeLeaderCharge" :value="formData.leaderCharge" :range="leaderChargeListData" :range-key="'text'">
  116. <view class="uni-input">{{ leaderChargeListData[pickerIndex.indexLeaderCharge].text }}</view>
  117. </picker>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. <view class="uni-form-item uni-column">
  123. <view class="title uni-common-pl">事发区域:</view>
  124. <view class="uni-list">
  125. <view class="uni-list-cell">
  126. <view class="uni-list-cell-db">
  127. <picker @change="bindPickerChangeSourcearea" value="" :range="sourceareaListData" :range-key="'F_AreaName'">
  128. <view class="uni-input">{{ sourceareaListData[pickerIndex.indexSourcearea].F_AreaName }}</view>
  129. </picker>
  130. </view>
  131. </view>
  132. </view>
  133. </view>
  134. <view class="uni-form-item uni-column">
  135. <view class="title uni-common-pl">乡镇:</view>
  136. <view class="uni-list">
  137. <view class="uni-list-cell">
  138. <view class="uni-list-cell-db">
  139. <picker @change="bindPickerChangeTownship" value="" :range="townshipListData" :range-key="'F_AreaName'">
  140. <view class="uni-input">{{ townshipListData[pickerIndex.indexTownship].F_AreaName }}</view>
  141. </picker>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. <view class="uni-form-item uni-column">
  147. <view class="title uni-common-pl">村:</view>
  148. <view class="uni-list">
  149. <view class="uni-list-cell">
  150. <view class="uni-list-cell-db">
  151. <picker @change="bindPickerChangeVillage" value="" :range="villageListData" :range-key="'F_AreaName'">
  152. <view class="uni-input">{{ villageListData[pickerIndex.indexVillage].F_AreaName }}</view>
  153. </picker>
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. <view class="uni-form-item uni-column">
  159. <view class="title">详细地址:</view>
  160. <view class="uni-textarea">
  161. <textarea name="callContent" :value="formData.sourceaddress" auto-height />
  162. </view>
  163. </view>
  164. <!-- <view class="uni-form-item uni-column">
  165. <view class="title">附件:</view>
  166. <view>
  167. <uni-file-picker
  168. v-model="imageValue"
  169. fileMediatype="image"
  170. mode="grid"
  171. @select="select"
  172. @progress="progress"
  173. @success="success"
  174. @fail="fail"
  175. />
  176. </view>
  177. </view> -->
  178. <view class="uni-form-item uni-column">
  179. <view class="title">承办单位:</view>
  180. <view>
  181. <bjx-inputs the-style="" :value="formData.deptName" item-key="F_DeptName" placeholder="请输入内容" @list="getDeptData" @select="selectDept" overflow="hide"> </bjx-inputs>
  182. </view>
  183. </view>
  184. <view class="uni-form-item uni-column" v-if="isDisplay.urgentOrOrdinary">
  185. <view class="title uni-common-pl">办理时限:</view>
  186. <view class="uni-list">
  187. <view class="uni-list-cell">
  188. <view class="uni-list-cell-db">
  189. <picker @change="bindPickerChangeProcessingTimeLimit" :value="pickerIndex.indexProcessingTimeLimit" :range="processingTimeLimitListData" :range-key="'text'">
  190. <view class="uni-input">{{ processingTimeLimitListData[pickerIndex.indexProcessingTimeLimit].text }}</view>
  191. </picker>
  192. </view>
  193. </view>
  194. </view>
  195. </view>
  196. <view class="uni-form-item uni-column" v-if="!isDisplay.urgentOrOrdinary">
  197. <view class="title uni-common-pl">紧急时限:</view>
  198. <view class="uni-list">
  199. <view class="test">
  200. <input class="uni-input" @click="DatePicker('datetime')" name="emergencyTimeFrame" :value="formData.emergencyTimeFrame" placeholder="紧急时限" />
  201. <!-- <text @click="DatePicker('datetime')">{{ formData.emergencyTimeFrame }}</text> -->
  202. </view>
  203. <mx-date-picker :show="showPicker" type="datetime" :value="formData.emergencyTimeFrame" :show-tips="true" :begin-text="'开始'" :end-text="'结束'" :show-seconds="true" @confirm="ed" @cancel="ed" />
  204. </view>
  205. </view>
  206. <view class="uni-btn-v">
  207. <button class="mini-btn" type="default" size="mini" @click="save">保存</button>
  208. <button class="mini-btn" type="default" size="mini" @click="approved">审核通过</button>
  209. <!-- <button >打开弹窗</button> -->
  210. <uni-popup ref="popup" type="dialog">
  211. <uni-popup-dialog mode="base" content="确定转办吗?" message="成功消息" :duration="2000" :before-close="true" @close="close" @confirm="confirm"></uni-popup-dialog>
  212. </uni-popup>
  213. </view>
  214. </form>
  215. </view>
  216. </view>
  217. </template>
  218. <script>
  219. import BjxInputs from "@/components/bjx-inputs/bjx-inputs.vue"
  220. import MxDatePicker from "@/components/mx-datepicker/mx-datepicker.vue"
  221. export default {
  222. components: {
  223. BjxInputs,
  224. MxDatePicker
  225. },
  226. data() {
  227. return {
  228. imageValue: [],
  229. wid: "", // 工单id
  230. title: "picker",
  231. index: 0,
  232. reflectCategoryListData: [], // 反映类别列表数据
  233. // date: currentDate,
  234. formData: {
  235. workOrderTitle: "", // 标题
  236. callContent: "", // 来电内容
  237. workOrderContent: "", // 工单内容
  238. processingMethod: "", // 处理方式
  239. result: "", // 办理内容
  240. name: "", // 姓名
  241. gender: "", // 性别
  242. source: "", // 来源
  243. callerNumber: "", // 来电号码
  244. workOrderType: "", // 工单类型
  245. responseCategory: "", // 反映类别
  246. responseCategoryId: "", // 反映类别id
  247. numberSecurityLevel: "", // 来电号码密级
  248. emergencyLevel: "", // 紧急程度
  249. organizer: "", // 承办单位
  250. processingTimeLimit: "", // 办理时限
  251. emergencyTimeLimit: "", // 积极时限
  252. phoneType: "", // 电话类别
  253. phoneTypeId: "", // 电话类别
  254. leaderCharge: "", // 分管领导
  255. threeWayCall: "", // 三方通话
  256. deptName: "", // 承办单位
  257. deptId: "", // 承办单位id
  258. emergencyTimeFrame: "", // 紧急时限
  259. sourcearea: "", // 事发区域
  260. township: "", // 乡镇
  261. village: "", // 村
  262. sourceaddress: "", // 详细地址
  263. },
  264. radioChecked: {
  265. processingMethod: true,
  266. gender: true,
  267. numberSecurityLevel: true,
  268. },
  269. isDisplay: {
  270. result: false, // 办理内容
  271. phoneType: false, // 电话类别
  272. leaderCharge: false, // 分管领导
  273. urgentOrOrdinary: true, // 紧急时限,办理时限
  274. },
  275. pickerIndex: {
  276. indexSource: 0, // 来源index
  277. indexType: 0, // 类型index
  278. indexEmergencyLevel: 0, // 紧急程度index
  279. indexPhoneType: 0, // 电话类别index
  280. indexLeaderCharge: 0, // 分管领导index
  281. indexProcessingTimeLimit: 0, // 办理时限index
  282. indexSourcearea: 0, // 事发区域index
  283. indexTownship: 0, // 乡镇index
  284. indexVillage: 0, // 村index
  285. },
  286. // 来源数据
  287. sourceListData: [
  288. {
  289. F_Value: "请选择",
  290. }
  291. ],
  292. // 工单类型数据
  293. typeListData: [
  294. {
  295. F_Value: "请选择",
  296. }
  297. ],
  298. // 紧急程度
  299. emergencyLevelListData: [
  300. {
  301. value: "1",
  302. text: "普通",
  303. },
  304. {
  305. value: "2",
  306. text: "紧急",
  307. },
  308. ],
  309. // 电话类别
  310. phoneTypeListData: [
  311. {
  312. F_Value: "请选择",
  313. }
  314. ],
  315. // 分管领导
  316. leaderChargeListData: [
  317. {
  318. value: "0",
  319. text: "省长",
  320. },
  321. {
  322. value: "1",
  323. text: "市长",
  324. }
  325. ],
  326. // 办理时限
  327. processingTimeLimitListData: [
  328. {
  329. value: "1",
  330. text: "一天",
  331. },
  332. {
  333. value: "3",
  334. text: "三天",
  335. },
  336. {
  337. value: "5",
  338. text: "五天",
  339. },
  340. {
  341. value: "7",
  342. text: "七天",
  343. },
  344. ],
  345. // 事发区域
  346. sourceareaListData: [
  347. {
  348. F_AreaName: "请选择",
  349. }
  350. ],
  351. // 乡镇数据
  352. townshipListData: [
  353. {
  354. F_AreaName: "请选择",
  355. }
  356. ],
  357. // 村数据
  358. villageListData: [
  359. {
  360. F_AreaName: "请选择",
  361. }
  362. ],
  363. showPicker: false, // 时间组件
  364. }
  365. },
  366. onLoad(option) {
  367. console.log("option", option);
  368. this.wid = option.wid
  369. // 获取来源数据 dictionaryId=1
  370. this.getDictionaryData(1)
  371. // 获取来源数据 dictionaryId=2
  372. this.getDictionaryData(2)
  373. // 获取电话类别 dictionaryId=2498
  374. this.getDictionaryData(2498)
  375. // 获取反映类别
  376. this.getReflectCategoryList()
  377. //获取部门
  378. this.getDeptList()
  379. // 获取事发区域
  380. this.getSourceareaData()
  381. // 获取详情 type=0
  382. this.getDetail(0)
  383. },
  384. methods: {
  385. formSubmit: function (e) {
  386. console.log("form发生了submit事件,携带数据为:" + JSON.stringify(e.detail.value))
  387. // this.saveData();
  388. },
  389. // 保存
  390. save() {
  391. this.saveData("0");
  392. },
  393. // 保存
  394. // buttonType 0-保存
  395. saveData(buttonType) {
  396. const params = {
  397. workorderid: this.wid,
  398. cusname: this.formData.name, // 姓名
  399. cussex: this.formData.gender, // 性别
  400. cusphone: this.formData.callerNumber, // 电话
  401. title: this.formData.workOrderTitle, // 标题
  402. content: this.formData.callContent, // 来电内容
  403. workcontent: this.formData.workOrderContent, // 工单内容
  404. // files: $("#file").val(), //(多个用英文逗号,隔开)
  405. files: "",
  406. sourcearea: this.formData.sourcearea, // 事发区域
  407. township: this.formData.township, // 乡镇
  408. village: this.formData.village, // 村
  409. sourceaddress: this.formData.sourceaddress, // 详细地址
  410. source: this.formData.source, // 来源
  411. splituser: this.formData.leaderCharge, // 分管领导
  412. phonetype: this.formData.phoneType, // 电话类别
  413. isresult: this.formData.processingMethod, //=(0转办1直办)
  414. // business: this.formData.threeWayCall, // 三方通话
  415. business: "0",
  416. result: this.formData.result, // 办理内容
  417. keys: this.formData.responseCategoryId, // 反映类别
  418. type: this.formData.workOrderType, // 类型
  419. isprotect: this.formData.numberSecurityLevel, //=(0普通1保密)
  420. level: this.formData.emergencyLevel, //=(1普通2紧急)
  421. issubmit: 0, //=(0保存1保存并提交)
  422. token: uni.getStorageSync("token"),
  423. }
  424. this.$http
  425. .post("/WorkOrder/EditWorkOrder", params)
  426. .then((response) => {
  427. if (response.state.toLowerCase() === "success") {
  428. if (String(buttonType) === "0") {
  429. this.returnPage()
  430. }
  431. }
  432. })
  433. .catch((e) => {
  434. console.log(e)
  435. })
  436. },
  437. //获取详情
  438. getDetail(type) {
  439. let params = {
  440. type: type,
  441. workorderid: this.wid,
  442. token: uni.getStorageSync("token"),
  443. }
  444. this.$http.get("/WorkOrder/GetWorkOrderNew", params).then((response) => {
  445. if (response.state.toLowerCase() === "success") {
  446. let data = response.data.data[0];
  447. this.formData.name = data.F_CusName; // 姓名
  448. this.formData.gender = data.F_CusSex; // 性别
  449. this.formData.callerNumber = data.F_CusPhone; // 电话
  450. this.formData.workOrderTitle = data.F_ComTitle; // 标题
  451. this.formData.callContent = data.F_ComContent; // 来电内容
  452. this.formData.workOrderContent = data.F_Content == null ? data.F_ComContent : data.F_Content; // 工单内容
  453. // files: $("#file").val(), //(多个用英文逗号,隔开)
  454. // this.formData.threeWayCall = data.F_Business, // 三方通话
  455. this.formData.sourceaddress = data.F_SourceAddress, // 详细地址
  456. this.formData.result = data.F_Result; // 办理内容
  457. this.formData.responseCategoryId = data.F_Key; // 反映类别
  458. this.formData.responseCategory = data.KeyName; // 反映类别名称
  459. this.isDisplay.urgentOrOrdinary = String(data.F_Level) === "2" ? false : true // 是否显示紧急办理时间
  460. // 处理方式(0转办1直办)
  461. if (String(data.F_IsResult) === "0") {
  462. this.radioChecked.processingMethod = true;
  463. this.formData.processingMethod = 0;
  464. } else if (Sting(data.F_IsResult) === "1") {
  465. this.radioChecked.processingMethod = false;
  466. this.formData.processingMethod = 1;
  467. }
  468. // 性别(0男1女)
  469. if (String(data.F_CusSex) === "0") {
  470. this.radioChecked.gender = true;
  471. this.formData.gender = 0;
  472. } else if (String(data.F_CusSex) === "1") {
  473. this.formData.gender = 1;
  474. }
  475. // 号码密级(0普通1保密)
  476. if (String(data.F_IsProtect) === "0") {
  477. this.radioChecked.numberSecurityLevel = true;
  478. this.formData.numberSecurityLevel = 0;
  479. } else if (String(data.F_IsProtect) === "1") {
  480. this.radioChecked.numberSecurityLevel = false;
  481. this.formData.numberSecurityLevel = 1;
  482. }
  483. // 来源
  484. this.sourceListData.forEach((e,i) => {
  485. if (String(e.F_ValueId) === String(data.F_InfoSource)) {
  486. this.pickerIndex.indexSource = i;
  487. this.formData.source = data.F_InfoSource;
  488. }
  489. });
  490. // 咨询
  491. this.typeListData.forEach((e,i) => {
  492. if (String(e.F_ValueId) === String(data.F_InfoType)) {
  493. this.pickerIndex.indexType = i;
  494. this.formData.workOrderType = data.F_InfoType;
  495. }
  496. });
  497. // 紧急程度
  498. this.emergencyLevelListData.forEach((e,i) => {
  499. if (String(e.value) === String(data.F_Level)) {
  500. this.pickerIndex.indexEmergencyLevel = i;
  501. this.formData.emergencyLevel = data.F_Level;
  502. }
  503. });
  504. // 电话类别
  505. this.phoneTypeListData.forEach((e,i) => {
  506. if (String(e.text) === String(data.F_PhoneType)) {
  507. this.pickerIndex.indexPhoneType = i;
  508. this.formData.phoneType = data.F_PhoneType;
  509. }
  510. });
  511. // 分管领导
  512. this.leaderChargeListData.forEach((e,i) => {
  513. if (String(e.text) === String(data.F_SplitUser)) {
  514. this.pickerIndex.indexLeaderCharge = i;
  515. this.formData.leaderCharge = data.F_SplitUser;
  516. }
  517. });
  518. // 事发区域
  519. this.sourceareaListData.forEach((e,i) => {
  520. if (String(e.F_AreaId) === String(data.F_SourceArea)) {
  521. this.pickerIndex.indexSourcearea = i;
  522. this.formData.sourcearea = data.F_SourceArea;
  523. }
  524. });
  525. // 乡镇
  526. this.townshipListData.forEach((e,i) => {
  527. if (String(e.F_AreaId) === String(data.F_Township)) {
  528. this.pickerIndex.indexTownship = i;
  529. this.formData.township = data.F_Township;
  530. }
  531. });
  532. // 村
  533. this.villageListData.forEach((e,i) => {
  534. if (String(e.F_AreaId) === String(data.F_Village)) {
  535. this.pickerIndex.indexVillage = i;
  536. this.formData.village = data.F_Village;
  537. }
  538. });
  539. // visittype: $("#visittype").val(), // 回访方式
  540. }
  541. }).catch((e) => {
  542. console.log(e);
  543. })
  544. },
  545. // 获取数据字典
  546. getDictionaryData(dictionaryId) {
  547. const params = {
  548. id: dictionaryId,
  549. token: uni.getStorageSync("token"),
  550. }
  551. this.$http
  552. .get("/Dictionary/GetDicValueListById", params)
  553. .then((response) => {
  554. if (response.state.toLowerCase() === "success") {
  555. let data = response.data;
  556. if (String(dictionaryId) === "1") {
  557. // 来源数据
  558. this.sourceListData = data;
  559. } else if (String(dictionaryId) === "2") {
  560. // 类型数据
  561. this.typeListData = data;
  562. } else if (String(dictionaryId) === "2498") {
  563. // 电话类别
  564. this.phoneTypeListData = data;
  565. }
  566. }
  567. })
  568. .catch((e) => {
  569. console.log(e)
  570. })
  571. },
  572. // 获取事发区域
  573. getSourceareaData() {
  574. let params = {
  575. token: uni.getStorageSync("token"),
  576. }
  577. this.$http
  578. .get("Area/GetAreaListById", params)
  579. .then((response) => {
  580. if (response.state.toLowerCase() === "success") {
  581. let data = response.data
  582. data.forEach((element, index) => {
  583. if (element.F_AreaName === "市区") {
  584. data.splice(index, 1)
  585. }
  586. })
  587. this.sourceareaListData = data
  588. }
  589. })
  590. .catch((e) => {
  591. console.log(e)
  592. })
  593. },
  594. /**
  595. * 获取乡镇/村
  596. * @param {Number} parentid 父id
  597. * @param {String} type "1"-乡镇,"2"-村
  598. */
  599. getTownshipVillageData(parentid, type) {
  600. let params = {
  601. token: uni.getStorageSync("token"),
  602. parentid: parentid,
  603. }
  604. this.$http
  605. .get("Area/GetAreaChildren", params)
  606. .then((response) => {
  607. if (response.state.toLowerCase() === "success") {
  608. let data = response.data
  609. if (type === "1") {
  610. this.townshipListData = data;
  611. } else if (type === "2") {
  612. this.villageListData = data;
  613. }
  614. }
  615. })
  616. .catch((e) => {
  617. console.log(e)
  618. })
  619. },
  620. // 获取反映类别
  621. getReflectCategoryList() {
  622. let params = {
  623. token: uni.getStorageSync("token"),
  624. }
  625. this.$http
  626. .get("Dictionary/GetKeyListNew", params)
  627. .then((response) => {
  628. if (response.state.toLowerCase() === "success") {
  629. let data = response.data
  630. this.reflectCategoryListData = data
  631. }
  632. })
  633. .catch((e) => {
  634. console.log(e)
  635. })
  636. },
  637. // 远程加载数据 返回一个对象,{value: 输入框值, callback: 回调函数}
  638. getReflectCategoryData(e) {
  639. console.log("e", e)
  640. this.formData.responseCategory = e.value
  641. if (!e.value) {
  642. e.callback(this.reflectCategoryListData)
  643. } else {
  644. let data = []
  645. this.reflectCategoryListData.forEach((item) => {
  646. if (item.names.indexOf(e.value) > -1) {
  647. data.push(item)
  648. }
  649. })
  650. e.callback(data)
  651. }
  652. },
  653. selectReflectCategory(value) {
  654. this.formData.responseCategory = value.name
  655. this.formData.responseCategoryId = value.id
  656. },
  657. bindPickerChange: function (e) {
  658. console.log("picker发送选择改变,携带值为", e.target.value)
  659. this.index = e.target.value
  660. },
  661. bindPickerChangeSource: function (e) {
  662. this.pickerIndex.indexSource = e.target.value;
  663. this.formData.source = this.sourceListData[e.target.value].F_ValueId;
  664. if (String(this.formData.source) === "4") {
  665. this.isDisplay.leaderCharge = true
  666. this.isDisplay.phoneType = false
  667. } else if (String(this.formData.source) === "1") {
  668. this.isDisplay.phoneType = true
  669. this.isDisplay.leaderCharge = false
  670. } else {
  671. this.isDisplay.phoneType = false
  672. this.isDisplay.leaderCharge = false
  673. }
  674. },
  675. bindPickerChangeType: function (e) {
  676. this.pickerIndex.indexType = e.target.value;
  677. this.formData.workOrderType = this.typeListData[e.target.value].F_ValueId
  678. },
  679. bindPickerChangeEmergencyLevel: function (e) {
  680. this.pickerIndex.indexEmergencyLevel = e.target.value;
  681. this.formData.emergencyLevel = this.emergencyLevelListData[e.target.value].value
  682. },
  683. bindPickerChangePhoneType: function (e) {
  684. this.pickerIndex.indexPhoneType = e.target.value;
  685. this.formData.phoneType = this.phoneTypeListData[e.target.value].F_ValueId
  686. },
  687. bindPickerChangeLeaderCharge: function (e) {
  688. this.pickerIndex.indexLeaderCharge = e.target.value;
  689. this.formData.leaderCharge = this.leaderChargeListData[e.target.value].text
  690. },
  691. bindPickerChangeSourcearea: function (e) {
  692. this.pickerIndex.indexSourcearea = e.target.value;
  693. this.formData.sourcearea = this.sourceareaListData[e.target.value].F_AreaId
  694. this.getTownshipVillageData(this.formData.sourcearea, "1")
  695. },
  696. bindPickerChangeTownship: function (e) {
  697. this.pickerIndex.indexTownship = e.target.value;
  698. this.formData.township = this.townshipListData[e.target.value].F_AreaId
  699. this.getTownshipVillageData(this.formData.township, "2")
  700. },
  701. bindPickerChangeVillage: function (e) {
  702. this.pickerIndex.indexVillage = e.target.value;
  703. this.formData.village = this.villageListData[e.target.value].F_AreaId
  704. },
  705. bindChangeProcessingMethod: function (e) {
  706. if (String(e.detail.value) === "0") {
  707. this.isDisplay.result = false;
  708. } else if (String(e.detail.value) === "1") {
  709. this.isDisplay.result = true;
  710. }
  711. },
  712. //办理时限change
  713. bindPickerChangeProcessingTimeLimit: function (e) {
  714. this.pickerIndex.indexProcessingTimeLimit = e.target.value
  715. this.formData.processingTimeLimit = this.processingTimeLimitListData[e.target.value].value
  716. },
  717. // 审核通过
  718. approved() {
  719. this.saveData();
  720. this.$refs.popup.open()
  721. },
  722. /**
  723. * 点击取消按钮触发
  724. * @param {Object} done
  725. */
  726. close() {
  727. // TODO 做一些其他的事情,before-close 为true的情况下,手动执行 close 才会关闭对话框
  728. // ...
  729. this.$refs.popup.close()
  730. },
  731. /**
  732. * 点击确认按钮触发
  733. * @param {Object} done
  734. * @param {Object} value
  735. */
  736. confirm() {
  737. this.assign()
  738. // TODO 做一些其他的事情,手动执行 close 才会关闭对话框
  739. // ...
  740. this.$refs.popup.close()
  741. },
  742. // 获取单位
  743. getDeptList() {
  744. let params = {
  745. iscbdw: 2,
  746. token: uni.getStorageSync("token"),
  747. }
  748. this.$http
  749. .get("/Department/GetDeptList", params)
  750. .then((response) => {
  751. if (response.state.toLowerCase() === "success") {
  752. let data = response.data
  753. this.deptListData = data
  754. }
  755. })
  756. .catch((e) => {
  757. console.log(e)
  758. })
  759. },
  760. // 远程加载数据 返回一个对象,{value: 输入框值, callback: 回调函数}
  761. getDeptData(e) {
  762. console.log("e", e)
  763. this.formData.deptName = e.value
  764. if (!e.value) {
  765. e.callback(this.deptListData)
  766. } else {
  767. let data = []
  768. this.deptListData.forEach((item) => {
  769. if (item.F_DeptName.indexOf(e.value) > -1) {
  770. data.push(item)
  771. }
  772. })
  773. e.callback(data)
  774. }
  775. },
  776. selectDept(value) {
  777. this.formData.deptName = value.F_DeptName
  778. this.formData.deptId = value.F_DeptId
  779. },
  780. DatePicker(type) {
  781. //显示
  782. this.type = type
  783. this.showPicker = true
  784. this.formData.emergencyTimeFrame = this[type]
  785. },
  786. ed(e) {
  787. //选择
  788. this.showPicker = false
  789. if (e) {
  790. //选择的值
  791. console.log("value => " + e.value)
  792. //原始的Date对象
  793. console.log("date => " + e.date)
  794. this.timeFormat(e.date)
  795. }
  796. },
  797. timeFormat(date) {
  798. let year = date.getFullYear()
  799. let month = date.getMonth() + 1
  800. month = month < 10 ? "0" + month : month
  801. let day = date.getDate()
  802. day = day < 10 ? "0" + day : day
  803. let hours = date.getHours()
  804. hours = hours < 10 ? "0" + hours : hours
  805. let minute = date.getMinutes()
  806. minute = minute < 10 ? "0" + minute : minute
  807. let seconds = date.getSeconds()
  808. seconds = seconds < 10 ? "0" + seconds : seconds
  809. let time = `${year}-${month}-${day} ${hours}:${minute}:${seconds}`
  810. this.formData.emergencyTimeFrame = time
  811. },
  812. // 转派
  813. assign() {
  814. if (String(this.formData.numberSecurityLevel) === "1") {
  815. this.formData.schedulingOpinions = `请于1小时内与来电人取得联系(匿名除外),并于${this.formData.processingTimeLimit}个工作日内内将办理情况反馈来电人,并将办理结果报市长便民公开电话受理中心,同时做好来电人信息保密工作。(若超期将进行通报;若无故不回复,将转交市委市政府督查局。)`
  816. } else if (String(this.formData.numberSecurityLevel) === "2" ) {
  817. this.formData.schedulingOpinions = `请于1小时内与来电人取得联系(匿名除外),并于${this.formData.emergencyTimeFrame}个工作日内内将办理情况反馈来电人,并将办理结果报市长便民公开电话受理中心,同时做好来电人信息保密工作。(若超期将进行通报;若无故不回复,将转交市委市政府督查局。)`
  818. }
  819. const params = {
  820. workorderid: this.wid,
  821. state: 1, // 保存并交办
  822. maindeptid: this.formData.deptId, // 承办单位
  823. limittime: this.formData.processingTimeLimit, // 办理时限
  824. limittimes: this.formData.emergencyTimeFrame, // 紧急办理时限
  825. assignedopinion: this.formData.schedulingOpinions, //调度意见
  826. token: uni.getStorageSync("token"),
  827. }
  828. this.$http
  829. .post("/WorkOrder/AssignWorkOrderNew", params)
  830. .then((response) => {
  831. if (response.state.toLowerCase() === "success") {
  832. this.returnPage()
  833. }
  834. })
  835. .catch((e) => {
  836. console.log(e)
  837. })
  838. },
  839. // 返回列表页
  840. returnPage() {
  841. uni.$emit("updateList",{});
  842. uni.navigateBack({
  843. delta: 2,
  844. })
  845. },
  846. },
  847. }
  848. </script>
  849. <style lang="scss">
  850. .wrapper {
  851. padding: 10px 15px;
  852. .form {
  853. .uni-form-item {
  854. margin: 10px 0 0 0;
  855. padding: 0 0 5px 0;
  856. border-bottom: 1px solid #bfbfbf;
  857. color: #525252;
  858. radio-group label radio {
  859. transform: scale(0.7);
  860. }
  861. .title {
  862. font-weight: 700;
  863. color: #000;
  864. }
  865. .bjx-inputs {
  866. .bjx-select {
  867. .data {
  868. .item-hide {
  869. .item-text {
  870. white-space: normal
  871. }
  872. }
  873. }
  874. }
  875. }
  876. }
  877. .uni-btn-v {
  878. margin: 15px 0 0 0;
  879. text-align: center;
  880. .mini-btn {
  881. margin-right: 3px;
  882. color: #fff;
  883. background: #1e90ff;
  884. }
  885. }
  886. }
  887. }
  888. </style>