order.vue 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607
  1. <template>
  2. <view>
  3. <cu-custom bgColor="bg-luohu" :isBack="true">
  4. <block slot="backText">返回</block>
  5. <block slot="content">检测委托</block>
  6. <block slot="right" v-if="buttonFlagNum === '1'">
  7. <text @click="getBack">退回原因</text>
  8. </block>
  9. </cu-custom>
  10. <u-form :model="form" ref="form" label-width="220" :error-type="errorType" :disabled="type == 'detail' ? true : false">
  11. <top ref="top" @activeNumClick="activeNumClick"></top>
  12. <view v-show="activeNum == 1">
  13. <uni-group mode="card">
  14. <u-form-item label="委托类型">
  15. <u-input placeholder="请输入委托类型" v-model="form.weiTuoLeiXing" disabled />
  16. </u-form-item>
  17. <u-form-item label="委托编号">
  18. <u-input placeholder="请输入委托编号" v-model="form.weiTuoBianHao" disabled />
  19. </u-form-item>
  20. <u-form-item label="用户选择" required v-if="administrator">
  21. <uni-data-select placeholder="请选择合同选择" v-model="form.baoGaoBianZhiYuan" :localdata="userList" @change="userListChange" v-if="type != 'detail'">
  22. </uni-data-select>
  23. <text v-else>{{getButtChange(form.baoGaoBianZhiYuan,userList)}}</text>
  24. </u-form-item>
  25. <u-form-item label="合同选择" prop="heTongId" required>
  26. <uni-data-select placeholder="请选择合同选择" v-model="form.heTongId" :localdata="hetongList" @change="hetongChange" v-if="type != 'detail'">
  27. </uni-data-select>
  28. <text v-else>{{getButtChange(form.heTongId,hetongList)}}</text>
  29. </u-form-item>
  30. <u-form-item label="委托来源">
  31. <u-input placeholder="请输入委托来源" v-model="form.weiTuoDanLaiYuan" disabled />
  32. </u-form-item>
  33. <u-form-item label="合同类型" prop="weiTuoHeTong">
  34. <u-input placeholder="请输入合同类型" v-model="form.weiTuoHeTong" disabled />
  35. </u-form-item>
  36. <u-form-item label="委托单位">
  37. <u-input placeholder="请输入委托单位" v-model="form.weiTuoDanWei" disabled />
  38. </u-form-item>
  39. <u-form-item label="送检单位" prop="songJianDanWei" required>
  40. <u-input placeholder="请输入送检单位" v-model="form.songJianDanWei" :disabled="type == 'detail' ? true : false" />
  41. </u-form-item>
  42. </uni-group>
  43. <uni-group mode="card">
  44. <u-form-item label="付款方式">
  45. <u-input placeholder="请输入付款方式" v-model="form.fuKuanFangShi" disabled />
  46. </u-form-item>
  47. <u-form-item label="报告类型">
  48. <u-radio-group v-model="form.baoGaoLeiXing" v-if="type != 'detail'">
  49. <u-radio v-for="(item, index) in reportTypeList" :key="index" :name="item.name">
  50. {{item.name}}
  51. </u-radio>
  52. </u-radio-group>
  53. <text v-else>{{getButtChange(form.baoGaoLeiXing,reportTypeList)}}</text>
  54. </u-form-item>
  55. <u-form-item label="出报告要求" prop="chuJuBaoGaoYaoQiu">
  56. <u-radio-group v-model="form.chuJuBaoGaoYaoQiu" v-if="type != 'detail'" @change="getMultiple()">
  57. <u-radio v-for="(item, index) in reportRequireList" :key="index" :name="item.name">
  58. {{item.name}}
  59. </u-radio>
  60. </u-radio-group>
  61. <text v-else>{{getButtChange(form.chuJuBaoGaoYaoQiu,reportRequireList)}}</text>
  62. </u-form-item>
  63. <u-form-item label="报告发放方式" prop="chuBaoGaoShiJian">
  64. <uni-data-checkbox multiple v-model="form.chuBaoGaoShiJianValue" :localdata="chuBaoGaoShiJianList" v-if="type != 'detail'" @change="chuBaoGaoChange"></uni-data-checkbox>
  65. <text v-else>{{form.chuBaoGaoShiJian}}</text>
  66. </u-form-item>
  67. <u-form-item label="样品是否带有传染性疾病" prop="name">
  68. <u-radio-group v-model="form.biaoQianTuPianJudge" v-if="type != 'detail'">
  69. <u-radio v-for=" (item, index) in judgeList" :key="index" :name="item.name">
  70. {{item.name}}
  71. </u-radio>
  72. </u-radio-group>
  73. <text v-else>{{form.biaoQianTuPianJudge}}</text>
  74. </u-form-item>
  75. <view v-if="form.biaoQianTuPianJudge == '是'">
  76. <view class="qingshe">
  77. <view class="qingTitle">
  78. 若样品带有传染性疾病请在此备注
  79. </view>
  80. </view>
  81. <u-form-item label="备注">
  82. <u-input placeholder="请输入备注" v-model="form.biaoQianTuPian" :disabled="type == 'detail'?true :false" />
  83. </u-form-item>
  84. </view>
  85. <u-form-item label="检毕样品处置" prop="yangBenChuLi" required>
  86. <u-input placeholder="请选择检毕样品处置" type="select" v-model="form.yangBenChuLi" @click="sheetClick('disposition')" v-if="type != 'detail'" />
  87. <text v-else>{{form.yangBenChuLi}}</text>
  88. </u-form-item>
  89. <u-form-item class="lineStyle" label="是否需要原始数据" prop="name">
  90. <u-radio-group v-model="form.jianCeKaiShiShiJi" v-if="type != 'detail'">
  91. <u-radio v-for=" (item, index) in judgeListOpposite" :key="index" :name="item.name">
  92. {{item.name}}
  93. </u-radio>
  94. </u-radio-group>
  95. <text class="fontSty" v-if="type != 'detail'">(需提前沟通并加收费用)</text>
  96. <text v-else>{{form.jianCeKaiShiShiJi}}</text>
  97. </u-form-item>
  98. </uni-group>
  99. </view>
  100. <view v-show="activeNum == 2">
  101. <u-button type="success" class="btn green-back-color" @click="getSing()" v-if="type != 'detail'">添加样品
  102. </u-button>
  103. <view class="tagBox" v-if="form.lhypb.length > 1">
  104. <uni-tag class="tagSin" :text="'样品:'+(index+1)" :type="lhypbIndex == index ? 'primary':'warning'" :circle="true" v-for="(item,index) in form.lhypb" :key="index" @click="lhypbIndex = index" />
  105. </view>
  106. <view v-for="(item,index) in form.lhypb" :key="index" v-if="index == lhypbIndex">
  107. <lhypb-com :item="item" :index="index" :type="type" @deleteClick="deletSing" @updateClick="updateClick">
  108. </lhypb-com>
  109. </view>
  110. </view>
  111. <view v-show="activeNum == 3">
  112. <uni-group mode="card">
  113. <u-form-item label="总价">
  114. <u-input placeholder="请输入总价" v-model="form.zongJia" disabled />
  115. </u-form-item>
  116. </uni-group>
  117. <uni-group mode="card">
  118. <u-form-item label="委托方" prop="weiTuoFangMingChe" required>
  119. <u-input placeholder="请输入委托人信息" v-model="form.weiTuoFangMingChe" :disabled="type == 'detail'?true :false" />
  120. </u-form-item>
  121. <u-form-item label="联系人" prop="weiTuoFangLianXiR" required>
  122. <u-input placeholder="请输入联系人" v-model="form.weiTuoFangLianXiR" :disabled="type == 'detail'?true :false" />
  123. </u-form-item>
  124. <u-form-item label="联系电话" prop="weiTuoFangLianXiD" required>
  125. <u-input placeholder="请输入联系电话" v-model="form.weiTuoFangLianXiD" :disabled="type == 'detail'?true :false" />
  126. </u-form-item>
  127. <u-form-item label="委托日期" prop="weiTuoRiQi">
  128. <u-input placeholder="请选择委托日期" type="select" v-model="form.weiTuoRiQi" @click="dateClick('weiTuo')" v-if="type != 'detail'" />
  129. <text v-else>{{form.weiTuoRiQi}}</text>
  130. </u-form-item>
  131. <u-form-item label="委托签名" label-position="top" required>
  132. <view style="width: 100%;">
  133. <view style="text-align: right;width: 100%;">
  134. <view v-if="type != 'detail'">
  135. <u-button type="primary" size="mini" @click="qianming(0)" class="btn-back-color">
  136. 签名</u-button>
  137. <u-button type="error" size="mini" @click="deqianming(0)" style="margin-left: 15rpx;" v-if="form.weiTuoFangQueRen != ''">
  138. 取消</u-button>
  139. </view>
  140. </view>
  141. <view style="width: 100%;" v-if="form.weiTuoFangQueRen != ''">
  142. <image :src="form.weiTuoFangQueRen" style="width: 100%;height: 500rpx;border: 1px #eee solid;">
  143. </image>
  144. </view>
  145. </view>
  146. </u-form-item>
  147. </uni-group>
  148. </view>
  149. <view style="height: 100rpx;"></view>
  150. </u-form>
  151. <order-buttom :type="type" :activeNum="activeNum" :buttonFlagNum="buttonFlagNum" @nextStep="nextStep" @lastStep="lastStep" @onSubmit="onSubmit"></order-buttom>
  152. <u-back-top :scroll-top="scrollTop" :icon-style="iconStyle" bottom="400" top="100"></u-back-top>
  153. <u-calendar v-model="dateShow" :mode="mode" max-date="2050-01-01" @change="dateChange"></u-calendar>
  154. <u-action-sheet :list="list" v-model="sheetShow" @click="actionSheetCallback"></u-action-sheet>
  155. <u-select v-model="selectShow" :list="list" @confirm="selectConfirm"></u-select>
  156. <u-popup mode="center" v-model="popupShow">
  157. <view style="padding: 30rpx;background: #FFFFFF;width: 100%;">
  158. <view class="cu-form-group ">
  159. <view class="title">
  160. 签名
  161. </view>
  162. </view>
  163. <autograph @save="save" @clear="clear" @close="close"></autograph>
  164. </view>
  165. </u-popup>
  166. <u-popup v-model="lhypbShow" mode="bottom" height="80%" border-radius="20">
  167. <view>
  168. <lhypb-message ref="lhypbMessage" :type="lhypbIndexData" :jianCeTypeList="jianCeTypeList" :taoCanShow="taoCanShow" :heTongId="form.heTongId" :itemType="itemType" :chuJuBaoGaoYaoQiu="form.chuJuBaoGaoYaoQiu" @deletClick="deletClick" @sumbitSingClick="sumbitSingClick" @getParentContent="getJianXiangData">
  169. </lhypb-message>
  170. </view>
  171. </u-popup>
  172. <u-modal v-model="meassageShow" :show-cancel-button="true" :show-confirm-button="false" title="检测项目" @cancel="cancel">
  173. <view class="u-update-content">
  174. <rich-text :nodes="content"></rich-text>
  175. </view>
  176. </u-modal>
  177. <u-modal v-model="backShow" :show-cancel-button="true" :show-confirm-button="false" title="退回提示" @cancel="cancel">
  178. <view class="u-update-content">
  179. <rich-text :nodes="content"></rich-text>
  180. </view>
  181. </u-modal>
  182. </view>
  183. </template>
  184. <script>
  185. import appSelect from '@/components/my-componets/appSelect.vue'
  186. import md5 from "@/common/util/md5.js"
  187. import autograph from '@/components/autograph/autograph'
  188. import popup from '@/components/popup/popup.vue'
  189. import order from './order/test.json'
  190. import lhypbMessage from '@/pages/jiance/order/lhypbMessage.vue'
  191. import message from '@/pages/jiance/order/message.vue'
  192. import top from '@/pages/jiance/order/top.vue'
  193. import lhypbCom from '@/pages/jiance/order/lhypbCom.vue'
  194. import orderButtom from '@/pages/jiance/order/orderButtom.vue'
  195. import {
  196. ACCESS_TOKEN,
  197. USER_NAME,
  198. USER_INFO
  199. } from "@/common/util/constants"
  200. import service from './order/meth.js'
  201. import meth from './order/meth.js'
  202. export default {
  203. components: {
  204. lhypbMessage,
  205. message,
  206. top,
  207. lhypbCom,
  208. orderButtom
  209. },
  210. data() {
  211. return {
  212. activeNum: 1,
  213. form: {
  214. baoGaoBianZhiYuan: '',
  215. weiTuoLeiXing: '',
  216. weiTuoDanLaiYuan: '',
  217. weiTuoBianHao: '',
  218. heTongId: '',
  219. heTongBianHao: '',
  220. weiTuoHeTong: '',
  221. weiTuoDanWei: '',
  222. songJianDanWei: '',
  223. qiWangWanChengShi: '',
  224. lhypb: [],
  225. fuKuanFangShi: '',
  226. baoGaoLeiXing: '简易',
  227. chuJuBaoGaoYaoQiu: '常规',
  228. chuBaoGaoShiJian: '电子报告',
  229. chuBaoGaoShiJianValue: ['电子报告'],
  230. yangBenChuLi: '按照检测方样本管理规程处理',
  231. weiTuoFangMingChe: '',
  232. weiTuoFangLianXiR: '',
  233. weiTuoFangLianXiD: '',
  234. weiTuoRiQi: '',
  235. weiTuoFangQueRen: '',
  236. zongJia: 0,
  237. zhanShiBiaoId: this.generateUUID(),
  238. biaoQianTuPianJudge: '否',
  239. jianCeKaiShiShiJi: '否',
  240. biaoQianTuPian: '',
  241. kaiPiaoZhuangTai: '未开票',
  242. },
  243. rules: {
  244. heTongId: [{
  245. required: true,
  246. message: '请选择合同',
  247. trigger: ['change', 'blur'],
  248. }],
  249. songJianDanWei: [{
  250. required: true,
  251. message: '请输入送检单位',
  252. trigger: 'blur',
  253. }],
  254. yangBenChuLi: [{
  255. required: true,
  256. message: '请选择样本处理',
  257. trigger: ['change', 'blur'],
  258. }],
  259. chuBaoGaoShiJian: [{
  260. required: true,
  261. message: '请输入出报告时间',
  262. trigger: 'blur',
  263. }],
  264. weiTuoFangMingChe: [{
  265. required: true,
  266. message: '请输入委托方',
  267. trigger: 'blur',
  268. }],
  269. weiTuoFangLianXiD: [{
  270. required: true,
  271. message: '请输入联系电话',
  272. trigger: 'blur',
  273. }],
  274. weiTuoFangLianXiR: [{
  275. required: true,
  276. message: '请输入联系人',
  277. trigger: 'blur',
  278. }],
  279. weiTuoFangQueRen: [{
  280. required: true,
  281. message: '请委托人签名',
  282. trigger: 'blur',
  283. }],
  284. },
  285. errorType: ['toast'],
  286. //日期
  287. dateType: 'inspect',
  288. dateShow: false,
  289. mode: 'date',
  290. //委托来源
  291. reportSourceList: order.reportSource,
  292. //报告类型
  293. reportTypeList: order.reportType,
  294. //报告要求
  295. reportRequireList: order.reportRequire,
  296. //样本类型
  297. sampleTypeList: order.sampleType,
  298. //样本状态
  299. sampleStateList: order.sampleState,
  300. //样本运输条件
  301. transportTypeList: order.transportType,
  302. //样本规格
  303. specificationList: order.specification,
  304. //样品处理
  305. dispositionList: order.disposition,
  306. chuBaoGaoShiJianList: order.chuBaoGaoShiJianList,
  307. //性别
  308. sexList: order.sex,
  309. //是否判断
  310. judgeList: order.judgeList,
  311. judgeListOpposite: order.judgeListOpposite,
  312. //签名显示
  313. qianshow: false,
  314. qianIndex: 0,
  315. //下拉框
  316. sheetShow: false,
  317. list: [],
  318. listType: '',
  319. listIndex: 0,
  320. //账号id
  321. userid: '',
  322. time: '',
  323. time2: '', //有时分秒
  324. orgId: '',
  325. //合同
  326. hetong: [],
  327. hetongList: [],
  328. heTongShow: false,
  329. //检测项目
  330. jianCeList: [],
  331. //检测类型
  332. jianCeType: '',
  333. jianCeTypeList: [],
  334. type: '', //判断哪个功能
  335. id: '', //委托单id
  336. taskId: '',
  337. total: 0,
  338. popupShow: false,
  339. selectShow: false,
  340. scrollTop: 0,
  341. iconStyle: {
  342. color: '#FFFFFF'
  343. },
  344. lhypbIndex: 0,
  345. lhypbShow: false,
  346. lhypbIndexData: 'add', //判断样品添加还是修改
  347. buttonFlagNum: '',
  348. taoCanList: [],
  349. taoCanShow: true,
  350. taoCanXiangmMuList: [],
  351. meassageShow: false,
  352. content: ``,
  353. itemType: true,
  354. deleteString: '',
  355. backShow: false,
  356. option: '',
  357. userList: [],
  358. administrator: false,
  359. orgid: '',
  360. temporaryForm: null
  361. }
  362. },
  363. onLoad(options) {
  364. //获取账号id
  365. let info = uni.getStorageSync(USER_INFO)
  366. if (info.user.id) {
  367. this.userid = info.user.id || ''
  368. }
  369. if (options.baoGaoBianZhi) {
  370. this.baoGaoBianZhi = options.baoGaoBianZhi
  371. }
  372. let administrator = uni.getStorageSync('administrator')
  373. this.administrator = administrator
  374. this.getInit()
  375. if (administrator) {
  376. this.getAdministrator()
  377. }
  378. if ((administrator && options.id) || !administrator) {
  379. this.getDataHetong(options.id, this.baoGaoBianZhi)
  380. }
  381. //一开始查合同 如果修改或者明细 传option.id
  382. // if (options && options.type != 'detail') {
  383. // this.getDataHetong(options.id)
  384. // } else {
  385. // this.getLiuHenWeiTuoDan(options.id)
  386. // }
  387. if (options.saveId) { //是不是暂存信息
  388. this.buttonFlagNum = '3'
  389. this.saveId = options.saveId
  390. this.getSaveData(options.saveId)
  391. } else if (options.type && options.type != '') { //是不是修改信息
  392. this.type = options.type
  393. } else {
  394. this.getLhwtdh()
  395. }
  396. if (options.id) { //是不是修改信息
  397. this.id = options.id
  398. // this.getDe(options.id)
  399. if (options.type == 'edit') {
  400. this.getTaskId(options.id)
  401. }
  402. }
  403. if (options.buttonFlag) {
  404. this.buttonFlagNum = options.buttonFlag
  405. }
  406. },
  407. onReady() {
  408. this.$refs.form.setRules(this.rules);
  409. },
  410. onPageScroll(e) {
  411. this.scrollTop = e.scrollTop;
  412. },
  413. methods: {
  414. //上一步
  415. lastStep() {
  416. let index = JSON.parse(JSON.stringify(this.activeNum))
  417. this.$refs.top.activeNum = index - 1
  418. this.activeNum = index - 1
  419. },
  420. //下一步
  421. nextStep() {
  422. let index = JSON.parse(JSON.stringify(this.activeNum))
  423. if (index == '1' && !service.getActiveNum1(this.form)) {
  424. return
  425. }
  426. this.$refs.top.activeNum = index + 1
  427. this.activeNum = index + 1
  428. },
  429. //超级用户 获取全部客户信息
  430. getAdministrator() {
  431. let sql =
  432. `select ID_,NAME_,qq_,GROUP_ID_ from ibps_party_employee where STATUS_ = 'actived' and ID_ != '-1' and ID_ != '702117247933480960' and ID_ != '1115242459127873536' and ID_ != '1115242765924433920' and ID_ != '1100468240921919488' order by FIELD(GROUP_ID_, '1041786072788369408') desc,create_time_ desc`
  433. // `select ID_,NAME_ from ibps_party_employee where GROUP_ID_ = '1041786072788369408' and STATUS_ = 'actived'`
  434. let requestData = this.$sig(sql)
  435. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  436. if (res.data.state == 200) {
  437. let result = res.data.variables.data
  438. result.forEach((item, index) => {
  439. if (item.GROUP_ID_ == '1041786072788369408') {
  440. this.$set(item, 'text', `${item.NAME_} (${item.qq_})`)
  441. } else {
  442. this.$set(item, 'text', `${item.NAME_} (内部)`)
  443. }
  444. this.$set(item, 'value', item.ID_)
  445. })
  446. this.userList = result
  447. }
  448. })
  449. },
  450. //根据委托单id查询 taskId
  451. getTaskId(id) {
  452. let sql =
  453. `select TASK_ID_,PROC_INST_ID_ from ibps_bpm_tasks where NAME_ = '编制' and NODE_ID_ = 'Activity_1n1jgcs' and PROC_DEF_KEY_ = 'Process_1589cp3' and EXEC_ID_ = (select PROC_INST_ID_ from act_ru_execution where ACT_ID_ = 'Activity_1n1jgcs' and BUSINESS_KEY_ = '${id}') ORDER BY CREATE_TIME_ desc`
  454. let requestData = this.$sig(sql)
  455. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  456. if (res.data.state == 200) {
  457. let result = res.data.variables.data[0]
  458. this.taskId = result.TASK_ID_
  459. if (this.buttonFlagNum === '1') {
  460. this.getProcInstId(result.PROC_INST_ID_)
  461. }
  462. }
  463. })
  464. },
  465. //根据委托单id查询 taskId
  466. getProcInstId(id) {
  467. let sql =
  468. `select OPTION_ from ibps_bpm_oper_log where PROC_INST_ID_ = '${id}' and OPER_TYPE_ = 'rejectToStart' order by create_time_ desc limit 1`
  469. let requestData = this.$sig(sql)
  470. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  471. if (res.data.state == 200) {
  472. let result = res.data.variables.data[0]
  473. this.option = result.OPTION_
  474. }
  475. })
  476. },
  477. //初始化
  478. getInit() {
  479. let info = uni.getStorageSync(USER_INFO)
  480. this.orgId = info.org?.id || ''
  481. this.time = meth.time(10)
  482. this.time2 = meth.time(19)
  483. this.form.weiTuoLeiXing = '客户委托'
  484. this.form.weiTuoRiQi = this.time
  485. },
  486. //根据暂存id获取暂存详情信息
  487. getSaveData(id) {
  488. uni.showLoading({
  489. mask: true,
  490. title: '加载中'
  491. });
  492. let sql =
  493. `select * from t_mjsjdzcb where id_ = '${id}'`
  494. let requestData = this.$sig(sql)
  495. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  496. if (res.data.state == 200) {
  497. const data = res.data.variables.data[0]
  498. const result = JSON.parse(data.bao_cun_nei_rong_)
  499. this.form = result
  500. this.jianCeTypeList = result.jianCeTypeList
  501. this.total = result.originalTotal
  502. this.hetongList = result.hetongList
  503. this.taoCanShow = result.taoCanShow
  504. this.taoCanList = result.taoCanList
  505. this.jianCeList = result.jianCeList
  506. this.getBeingTimeCount(result.weiTuoBianHao)
  507. this.getJiance(result.heTongId, '')
  508. uni.hideLoading()
  509. }
  510. })
  511. },
  512. //明细
  513. getLiuHenWeiTuoDan(id) {
  514. let sql =
  515. `select b.bao_cun_nei_rong_ as content from t_lhwtsqb a left join t_mjsjdzcb b on a.wei_tuo_bian_hao_ = b.wei_tuo_dan_hao_ and b.dui_ying_shu_ju_b = 't_lhwtblh' where a.id_ = '${id}' order by b.create_time_ desc LIMIT 1`
  516. let requestData = this.$sig(sql)
  517. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  518. if (res.data.state == 200) {
  519. const datas = res.data.variables.data
  520. if (datas.length > 0) {
  521. let data = datas[0].content
  522. let content = JSON.parse(data)
  523. this.taoCanShow = content.taoCanShow
  524. this.hetong = content.hetongList
  525. this.form = content
  526. }
  527. }
  528. })
  529. },
  530. //判断委托单编号是否在委托表上
  531. getBeingTimeCount(bianHao) {
  532. let sql =
  533. `select count(*) as count from t_lhwtsqb where wei_tuo_bian_hao_ = '${bianHao}'`
  534. let requestData = this.$sig(sql)
  535. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  536. if (res.data.state == 200) {
  537. const data = res.data.variables.data[0]
  538. if (data.count > 0) {
  539. this.getLhwtdh()
  540. if (this.form.lhypb.length > 0) {
  541. this.form.lhypb.forEach((item, index) => {
  542. this.getLhypbh(res => {
  543. item.yangPinBianHao = res
  544. })
  545. })
  546. }
  547. }
  548. }
  549. })
  550. },
  551. //获取委托编号
  552. getLhwtdh() {
  553. let this_ = this
  554. this.$http.get("/ibps/platform/v3/identity/getNextIdByAlias?alias=lhwtdh").then(res => {
  555. if (res.data.state == 200) {
  556. const data = res.data.data
  557. this_.form.weiTuoBianHao = data
  558. }
  559. });
  560. },
  561. //获取样品编号
  562. getLhypbh(callback) {
  563. uni.showLoading({
  564. title: '生成样品编号中',
  565. mask: true
  566. })
  567. let this_ = this
  568. this.$http.get("/ibps/platform/v3/identity/getNextIdByAlias?alias=lhypbh").then(res => {
  569. if (res.data.state == 200) {
  570. const data = res.data.data
  571. uni.hideLoading()
  572. callback(data)
  573. }
  574. });
  575. },
  576. //自动获取委托详情数据
  577. getDe(id) {
  578. uni.showLoading({
  579. mask: true,
  580. title: '加载中'
  581. });
  582. let sql =
  583. `select * from t_lhwtsqb where id_ = '${id}'`
  584. let requestData = this.$sig(sql)
  585. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  586. if (res.data.state == 200) {
  587. let result = res.data.variables.data[0]
  588. let form = service.getForm(result)
  589. this.form = form
  590. this.total = parseFloat(result.zong_jia_) / (result.chu_ju_bao_gao_ya === '特急' ? 1.5 : result.chu_ju_bao_gao_ya === '加急' ? 1.2 : 1)
  591. this.getTaoCanXiangMu(result.he_tong_id_)
  592. this.hetongChange(result.he_tong_id_, this.type, id)
  593. this.getZhanShiBiao(result.zhan_shi_biao_id_)
  594. // uni.hideLoading()
  595. } else {
  596. // uni.hideLoading()
  597. }
  598. }).catch(res => {
  599. uni.hideLoading()
  600. })
  601. },
  602. //获取展示表
  603. getZhanShiBiao(shenQingId) {
  604. let sql = `select * from t_lhwtzsb where shen_qing_id_ = '${shenQingId}'`
  605. let requestData = this.$sig(sql)
  606. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  607. if (res.data.state == 200) {
  608. let result = res.data.variables.data
  609. let list = []
  610. result.forEach(item => {
  611. list.push(item.id_)
  612. })
  613. this.deleteString = list.join(",")
  614. }
  615. })
  616. },
  617. //获取样品
  618. getYangPin(id) {
  619. // uni.showLoading({
  620. // mask: true,
  621. // title: '加载中'
  622. // });
  623. let sql =
  624. `select * from t_lhypb where parent_id_ = '${id}' order by yang_pin_bian_hao asc`
  625. let requestData = this.$sig(sql)
  626. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  627. if (res.data.state == 200) {
  628. let result = res.data.variables.data
  629. let list = service.getListForm(result, this.jianCeList, this.taoCanXiangmMuList, this
  630. .taoCanList)
  631. this.form.lhypb = list
  632. //this.getTotal()
  633. uni.hideLoading()
  634. } else {
  635. uni.hideLoading()
  636. }
  637. }).catch(res => {
  638. uni.hideLoading()
  639. })
  640. },
  641. //获取合同 //weiTouId 委托id特殊 在委托详情和修改才出现
  642. getDataHetong(weiTouId = '', userId = '') {
  643. let info = uni.getStorageSync(USER_INFO);
  644. if (!this.administrator) {
  645. userId = info.user.id
  646. }
  647. if (!userId) {
  648. return
  649. }
  650. let sql = ``
  651. sql =
  652. `select tb.*,ty.ke_hu_ming_cheng_ as ke_hu_dang_wei from t_bjd tb,t_yxkh ty where tb.ke_hu_ming_cheng_ = ty.id_ and tb.ke_hu_zhang_hao_ ='${userId}' and tb.zhuang_tai_='生效中' and tb.shi_fou_guo_shen_ = '已完成'`
  653. let requestData = this.$sig(sql)
  654. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  655. if (res.data.state == 200) {
  656. let result = res.data.variables.data
  657. if (result.length > 0) {
  658. this.heTongShow = false
  659. result.forEach((item, index) => {
  660. this.$set(item, 'text', item.he_tong_bian_hao_)
  661. this.$set(item, 'value', item.id_)
  662. })
  663. this.hetongList = result
  664. } else {
  665. this.heTongShow = true
  666. uni.showToast({
  667. title: '你好,该账户还没有与本公司签订合同,或者你合同已失效。',
  668. icon: 'none',
  669. duration: 2000
  670. })
  671. }
  672. if (weiTouId) {
  673. this.getDe(weiTouId)
  674. }
  675. }
  676. });
  677. },
  678. //选择合同 e 合同id type 判断这个是否添加add 还是 修改 明细 detail id 委托单id
  679. hetongChange(e, type = '', weiTouId = '') {
  680. //从合同中选择付款方式
  681. if (e != '') {
  682. let data = this.hetongList.find((item, index) => item.id_ == e)
  683. if (!type) {
  684. this.form.weiTuoDanLaiYuan = data.wei_tuo_dan_lai_y || ''
  685. this.form.weiTuoHeTong = data.he_tong_lei_xing_ || ''
  686. this.form.fuKuanFangShi = data.fu_kuan_fang_shi_ || ''
  687. this.form.weiTuoDanWei = data.zhuan_huan_ke_hu_ || ''
  688. this.form.songJianDanWei = data.zhuan_huan_ke_hu_ || ''
  689. this.form.weiTuoFangLianXiD = data.dian_hua_ || ''
  690. this.form.weiTuoFangLianXiR = data.lian_xi_ren_ || ''
  691. this.form.weiTuoFangMingChe = data.ke_hu_dang_wei || ''
  692. this.form.heTongBianHao = data.he_tong_bian_hao_ || ''
  693. }
  694. let tcbh = ''
  695. if(data.xuan_ze_tao_can_=='' || data.xuan_ze_tao_can_ == null){
  696. tcbh = data.xin_zeng_tao_can_
  697. }
  698. else if(data.xin_zeng_tao_can_=='' || data.xin_zeng_tao_can_ == null){
  699. tcbh = data.xuan_ze_tao_can_
  700. }else{
  701. tcbh = data.xuan_ze_tao_can_+','+data.xin_zeng_tao_can_
  702. }
  703. this.getJiance(e, type, weiTouId)
  704. this.getTaoCanList(tcbh)
  705. }
  706. },
  707. //根据合同id选择检测项目
  708. getJiance(id, type, weiTouId) {
  709. let sql =
  710. `select tw.*,tb.zhe_hou_jia_ge_,tb.xiang_mu_dan_jia_ from t_htjcxmjmb tb left join t_mjjcnlfw tw on tb.jian_ce_xiang_mu_ = tw.id_ and tb.shi_fou_you_xiao_='有效' where tb.parent_id_ = '${id}' and tw.xiang_mu_bian_hao not like '%/%' order by tw.nodekey1_ asc`
  711. let requestData = this.$sig(sql)
  712. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  713. if (res.data.state == 200) {
  714. let result = res.data.variables.data
  715. if (result.length > 0) {
  716. result.forEach((item, index) => {
  717. if (this.jianCeTypeList.length == 0) {
  718. let obj = {
  719. // text: item.jian_ce_lei_bie_
  720. value: item.jian_ce_lei_bie_,
  721. text: item.jian_ce_lei_bie_,
  722. id: item.jian_ce_lei_bie_,
  723. name: item.jian_ce_lei_bie_
  724. }
  725. this.jianCeTypeList.push(obj)
  726. } else {
  727. let gg = this.jianCeTypeList.findIndex(it => it.value == item
  728. .jian_ce_lei_bie_)
  729. if (gg < 0) {
  730. let obj = {
  731. // text: item.jian_ce_lei_bie_
  732. value: item.jian_ce_lei_bie_,
  733. text: item.jian_ce_lei_bie_,
  734. id: item.jian_ce_lei_bie_,
  735. name: item.jian_ce_lei_bie_
  736. }
  737. this.jianCeTypeList.push(obj)
  738. }
  739. }
  740. })
  741. result.forEach((item, index) => {
  742. item.zhe_hou_jia_ge_ = (parseFloat(item.zhe_hou_jia_ge_)).toFixed(2)
  743. this.$set(item, 'checked', false)
  744. })
  745. this.jianCeList = result
  746. if (type != "") {
  747. this.getYangPin(weiTouId)
  748. }
  749. } else {
  750. meth.getPrompt('该合同没有检测项目')
  751. }
  752. }
  753. });
  754. },
  755. //获取属于合同套餐的全部项目
  756. getTaoCanXiangMu(heTongid) {
  757. let sql =
  758. `select tm.*,tt.zhe_hou_jia_ge_,tt.tao_can_zhu_jian_,tt.id_ as tczbId from t_mjjcnlfw tm,t_httcb tt where tm.id_ = tt.jian_ce_xiang_mu_ and parent_id_ = '${heTongid}'`
  759. let requestData = this.$sig(sql)
  760. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  761. if (res.data.state == 200) {
  762. const datas = res.data.variables.data
  763. this.taoCanXiangmMuList = datas
  764. }
  765. })
  766. },
  767. //根据合同查询套餐 1根据合同人套餐id里面选择套餐 2.根据合同id选择套餐
  768. getTaoCanList(id, type) {
  769. let sql =
  770. `select * from t_jctc where FIND_IN_SET(id_,'${id}') and zhuang_tai_ = '有效'`
  771. let requestData = this.$sig(sql)
  772. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  773. if (res.data.state == 200) {
  774. const datas = res.data.variables.data
  775. if (datas.length > 0) {
  776. this.taoCanShow = true
  777. datas.forEach(item => {
  778. this.$set(item, 'checked', false)
  779. })
  780. this.taoCanList = datas
  781. } else {
  782. setTimeout(function() {
  783. meth.getPrompt('该合同没有套餐检测项目', 'none', 1000)
  784. }, 500);
  785. this.taoCanShow = false
  786. this.taoCanList = []
  787. }
  788. }
  789. })
  790. },
  791. //选择项目
  792. changeIndex(it, index, x) {
  793. let itemData = this.form.lhypb[index]
  794. this.form.lhypb[index].jianCeList[x].checked = !this.form.lhypb[index].jianCeList[x].checked
  795. let show = itemData.jianCeList.some(item => item.id_ == '1039826037036285952' || item.id_ ==
  796. '1040205909151711232')
  797. if (show) {
  798. itemData.mingChengShow = true
  799. }
  800. this.getTotal()
  801. },
  802. getTotal() {
  803. var total = 0
  804. this.form.lhypb.forEach((item, index) => {
  805. let itemTotal = 0
  806. item.jianCeList.forEach((it, x) => {
  807. if (it.checked) {
  808. total += parseFloat(it.zhe_hou_jia_ge_ || 0)
  809. itemTotal += parseFloat(it.zhe_hou_jia_ge_ || 0)
  810. }
  811. })
  812. item.taoCanXiangMuList.forEach((it, x) => {
  813. total += parseFloat(it.zhe_hou_jia_ge_ || 0)
  814. itemTotal += parseFloat(it.zhe_hou_jia_ge_ || 0)
  815. })
  816. if (this.form.chuJuBaoGaoYaoQiu == '特急') {
  817. itemTotal = itemTotal * 1.5
  818. } else if (this.form.chuJuBaoGaoYaoQiu == '加急') {
  819. itemTotal = itemTotal * 1.2
  820. } else {
  821. itemTotal = itemTotal
  822. }
  823. item.yangPinZongJia = itemTotal
  824. })
  825. this.total = total
  826. if (this.form.chuJuBaoGaoYaoQiu == '特急') {
  827. this.form.zongJia = total * 1.5
  828. } else if (this.form.chuJuBaoGaoYaoQiu == '加急') {
  829. this.form.zongJia = total * 1.2
  830. } else {
  831. this.form.zongJia = total
  832. }
  833. this.form.zongJia = (this.form.zongJia).toFixed(2)
  834. },
  835. //特急 加急 常规
  836. getMultiple() {
  837. this.getTotal()
  838. },
  839. //调用日期组件
  840. dateClick(type, index) {
  841. this.listType = type
  842. if (type == 'report' || type == 'weiTuo') {
  843. this.mode = 'date'
  844. this.dateShow = true
  845. }
  846. },
  847. //日期回调
  848. dateChange(e) {
  849. switch (this.listType) {
  850. case 'report':
  851. this.form.chuBaoGaoShiJian = e.result
  852. break
  853. case 'weiTuo':
  854. this.form.weiTuoRiQi = e.result
  855. break
  856. }
  857. },
  858. sheetClick(type, index) {
  859. this.listType = type
  860. this.sheetShow = true
  861. if (type == 'disposition') {
  862. this.list = this.dispositionList
  863. }
  864. },
  865. //下拉框回调
  866. actionSheetCallback(e) {
  867. let that = this
  868. let lists = that.form.lhypb[this.listIndex]
  869. if (this.listType == 'disposition') {
  870. this.form.yangBenChuLi = this.list[e].text
  871. }
  872. },
  873. selectClick(type, index) {
  874. this.listType = type
  875. this.selectShow = true
  876. if (type == 'jianCeType') {
  877. this.list = this.jianCeTypeList
  878. this.listIndex = index
  879. }
  880. },
  881. selectConfirm(e) {
  882. let that = this
  883. let lists = that.form.lhypb[this.listIndex]
  884. if (this.listType == 'jianCeType') {
  885. lists.jianCeType = e[0].value
  886. }
  887. },
  888. onSubmit(valueType) {
  889. if (valueType == '1') {
  890. this.sumbit(valueType)
  891. } else {
  892. let that = this
  893. uni.showModal({
  894. title: '提示',
  895. content: '委托单编号:' + this.form.weiTuoBianHao + '金额为' + this.form.zongJia + '元,是否确定下单?',
  896. success: function(res) {
  897. if (res.confirm) {
  898. that.sumbit(valueType)
  899. } else if (res.cancel) {}
  900. }
  901. });
  902. }
  903. },
  904. //提交 //1 暂存 2提交 3驳回提交
  905. sumbit(valueType) {
  906. //委托提交判断
  907. if (valueType != 1) {
  908. if (this.heTongShow) {
  909. meth.getPrompt("你好,该账户还没有与本公司签订合同,或者你合同已失效。")
  910. return
  911. }
  912. if (this.form.lhypb.length == 0) {
  913. meth.getPrompt("请填写该委托单需要检测的样品信息")
  914. return
  915. }
  916. if (this.form.weiTuoFangQueRen == '') {
  917. this.qianming(0)
  918. meth.getPrompt("请委托人签名")
  919. return
  920. }
  921. uni.showLoading({
  922. mask: true,
  923. title: '加载中'
  924. });
  925. }
  926. let para = {
  927. "parameters": [{
  928. "key": "defId",
  929. "value": "1033014823429865472"
  930. },
  931. {
  932. "key": "version",
  933. "value": "0"
  934. },
  935. {
  936. "key": "data",
  937. "value": ""
  938. }
  939. ]
  940. }
  941. //如果是暂存数据 id清楚
  942. if (this.buttonFlagNum === '3') {
  943. this.form.id = ''
  944. this.form.zhanShiBiaoId = this.generateUUID()
  945. }
  946. this.form.shiFouGuoShen = "已编制"
  947. this.form.bianZhiRen = this.userid
  948. this.form.bianZhiShiJian = this.time
  949. this.form.bianZhiBuMen = this.orgId
  950. this.form.weiTuoZhuangTai = '待审核'
  951. this.form.fuKuanZhuangTai = '未结清'
  952. if (this.form.biaoQianTuPianJudge == '否') {
  953. this.form.biaoQianTuPian = '否'
  954. }
  955. if (!this.administrator) {
  956. this.form.baoGaoBianZhiYuan = this.userid
  957. }
  958. this.form.lhypb.forEach((item, index) => {
  959. item.weiTuoDanHao = this.form.weiTuoBianHao
  960. item.weiTuoDanWei = this.form.weiTuoDanWei
  961. item.lianXiRen = this.form.weiTuoFangLianXiR
  962. item.lianXiDianHua = this.form.weiTuoFangLianXiD
  963. item.heTongBianHao = this.form.heTongId
  964. item.jiaoFeiFangShi = this.form.fuKuanFangShi
  965. item.fuKuanZhuangTai = '未结清'
  966. item.heTongLeiXing = this.form.weiTuoHeTong
  967. item.weiTuoRiQi = this.form.weiTuoRiQi
  968. item.songJianDanWei = this.form.songJianDanWei
  969. item.bianZhiRen = this.userid
  970. item.bianZhiShiJian = meth.time(10)
  971. item.bianZhiBuMen = this.orgId
  972. item.chuBaoGaoYaoQiu = this.form.chuJuBaoGaoYaoQiu
  973. if (this.buttonFlagNum === '3') {
  974. item.id = ''
  975. item.parentId = ''
  976. }
  977. let list1 = []
  978. let list2 = []
  979. let list3 = []
  980. let list4 = []
  981. let list5 = []
  982. let list6 = []
  983. let list7 = []
  984. let list8 = []
  985. let list9 = []
  986. //常规检测项目处理
  987. item.jianCeXiangMu2 = []
  988. item.jianCeList.forEach((it, x) => {
  989. if (it.checked) {
  990. item.jianCeXiangMu2.push(it.id_)
  991. list6.push(it.zhe_hou_jia_ge_)
  992. list7.push(it.jian_ce_xiang_mu_)
  993. let listTe = 0
  994. if (this.form.chuJuBaoGaoYaoQiu == '常规') {
  995. listTe = parseFloat(it.zhe_hou_jia_ge_)
  996. } else if (this.form.chuJuBaoGaoYaoQiu == '加急') {
  997. listTe = parseFloat(it.zhe_hou_jia_ge_) * 1.2
  998. } else if (this.form.chuJuBaoGaoYaoQiu == '特急') {
  999. listTe = parseFloat(it.zhe_hou_jia_ge_) * 1.5
  1000. }
  1001. list9.push(listTe)
  1002. }
  1003. })
  1004. item.jianCeXiangMu = item.jianCeXiangMu2.join(",")
  1005. item.changGuiJiaGe = list6.join(",")
  1006. item.changGuiXiangMuMi = list7.join(",")
  1007. item.changGuiZheHouJia = list9.join(",")
  1008. item.yangPinZongShu = parseFloat(item.shuLiangSi || 0) + parseFloat(item.shuLiangSan || 0) + parseFloat(item.shuLiangEr || 0) + parseFloat(item.shuLiang || 0)
  1009. item.taoCanList.forEach(it => {
  1010. if (it.checked) {
  1011. list1.push(it.id_)
  1012. }
  1013. })
  1014. item.xuanZeTaoCan = list1.join(',')
  1015. if (item.taoCanXiangMuList.length > 0) {
  1016. //套餐检测项目处理
  1017. item.taoCanXiangMuList.forEach(it => {
  1018. list2.push(it.id_)
  1019. let listTo = 0
  1020. if (this.form.chuJuBaoGaoYaoQiu == '常规') {
  1021. listTo = parseFloat(it.zhe_hou_jia_ge_)
  1022. } else if (this.form.chuJuBaoGaoYaoQiu == '加急') {
  1023. listTo = parseFloat(it.zhe_hou_jia_ge_) * 1.2
  1024. } else if (this.form.chuJuBaoGaoYaoQiu == '特急') {
  1025. listTo = parseFloat(it.zhe_hou_jia_ge_) * 1.5
  1026. }
  1027. list8.push(listTo)
  1028. list3.push(it.zhe_hou_jia_ge_)
  1029. list4.push(it.jian_ce_xiang_mu_)
  1030. list5.push(it.tczbId) //套餐子表项目
  1031. })
  1032. item.taoCanZiBiaoId = list5.join(',')
  1033. item.taoCanMingCheng = list4.join(',')
  1034. item.taoCanJiaGe = list3.join(',')
  1035. item.taoCanXiangMu = list2.join(',')
  1036. item.taoCanZheHouJiaGe = list8.join(",")
  1037. } else {
  1038. item.taoCanZiBiaoId = ''
  1039. item.taoCanMingCheng = ''
  1040. item.taoCanJiaGe = ''
  1041. item.taoCanXiangMu = ''
  1042. item.taoCanZheHouJiaGe = ''
  1043. }
  1044. if (item.shuLiang == 0) {
  1045. item.shuLiang = ''
  1046. }
  1047. if (item.shuLiangEr == 0) {
  1048. item.shuLiangEr = ''
  1049. }
  1050. if (item.shuLiangSan == 0) {
  1051. item.shuLiangSan = ''
  1052. }
  1053. if (item.shuLiangSi == 0) {
  1054. item.shuLiangSi = ''
  1055. }
  1056. })
  1057. //委托提交判断
  1058. if (valueType != 1) {
  1059. for (let index in this.form.lhypb) {
  1060. let item = this.form.lhypb[index]
  1061. if (item.yangPinMingCheng == '') {
  1062. meth.getPrompt(`请输入样品信息${parseInt(index)+1}的样品名称`)
  1063. return
  1064. }
  1065. }
  1066. let showIndex = this.form.lhypb.findIndex(item => item.jianCeXiangMu == '' && item.taoCanXiangMuList
  1067. .length ==
  1068. 0)
  1069. if (showIndex >= 0) {
  1070. meth.getPrompt(`请在样品信息${showIndex+1}选择委托单需要检测项目`)
  1071. return
  1072. }
  1073. }
  1074. //委托暂存判断
  1075. if (valueType == 1) {
  1076. this.form.taoCanShow = this.taoCanShow
  1077. this.form.jianCeTypeList = this.jianCeTypeList
  1078. this.form.originalTotal = this.total
  1079. this.form.hetongList = this.hetongList
  1080. this.form.taoCanList = this.taoCanList
  1081. this.form.jianCeList = this.jianCeList
  1082. this.getBeingSave(this.form)
  1083. return
  1084. }
  1085. //驳回同意数据封装
  1086. var editData = {}
  1087. if (valueType == 3) {
  1088. this.form.id = this.id
  1089. editData = {
  1090. data: JSON.stringify(this.form),
  1091. opinion: '重新提交审核',
  1092. taskId: this.taskId
  1093. }
  1094. }
  1095. this.temporaryForm = JSON.parse(JSON.stringify(this.form))
  1096. // if (valueType != 1) {
  1097. // this.form.lhypb.forEach(item => {
  1098. // delete item.jianCeList
  1099. // delete item.taoCanXiangMuList
  1100. // })
  1101. // }
  1102. //end
  1103. para.parameters[2].value = JSON.stringify(this.form)
  1104. //数据添加到展示表上
  1105. var lhwt = []
  1106. if (valueType == 2 || valueType == 3) {
  1107. this.form.lhypb.forEach((item, index) => {
  1108. let bit = {
  1109. he_tong_id_: this.form.heTongBianHao,
  1110. he_tong_bian_hao_: this.form.heTongId,
  1111. jiao_fei_fang_shi: this.form.fuKuanFangShi,
  1112. shen_qing_id_: this.form.zhanShiBiaoId,
  1113. wei_tuo_bian_hao_: this.form.weiTuoBianHao,
  1114. wei_tuo_lai_yuan_: this.form.weiTuoDanLaiYuan,
  1115. wei_tuo_lei_xing_: this.form.weiTuoLeiXing,
  1116. wei_tuo_ren_: this.form.weiTuoFangLianXiR,
  1117. wei_tuo_ri_qi_: this.form.weiTuoRiQi,
  1118. yang_pin_bian_hao: item.yangPinBianHao,
  1119. yang_pin_ming_che: item.yangPinMingCheng,
  1120. zhuang_tai_: "委托进行中"
  1121. }
  1122. lhwt.push(bit)
  1123. })
  1124. }
  1125. this.$refs.form.validate(valid => {
  1126. if (valid) {
  1127. if (valueType == 3) {
  1128. if (this.deleteString) {
  1129. this.getDeleteString()
  1130. }
  1131. this.setZhanShiBiao(lhwt)
  1132. this.getArgee(editData)
  1133. } else if (valueType == 2) {
  1134. if (this.saveId && this.buttonFlagNum === '3') {
  1135. this.getDeleteZanCun()
  1136. }
  1137. this.setZhanShiBiao(lhwt)
  1138. this.getSave(para)
  1139. }
  1140. } else {
  1141. meth.getPrompt('必选项没有填写')
  1142. uni.hideLoading();
  1143. }
  1144. });
  1145. },
  1146. //删除展示表数据
  1147. getDeleteString() {
  1148. let params = {}
  1149. params['tableName'] = 't_lhwtzsb'
  1150. params['paramWhere'] = "{id_:'" + this.deleteString + "'}"
  1151. let requestData = this.$sig(params)
  1152. this.$http.post("/ibps/business/v3/sys/universal/batchDelete", requestData).then(res => {
  1153. if (res.data.state == 200) {}
  1154. })
  1155. },
  1156. //保存
  1157. getSave(data) {
  1158. this.$http.post("ibps/business/v3/bpm/instance/start", data).then(res => {
  1159. if (res.data.state == 200) {
  1160. this.$tip.success('提交成功!')
  1161. this.getLiuHen()
  1162. uni.hideLoading();
  1163. this.$Router.replaceAll({
  1164. name: 'index'
  1165. })
  1166. } else {
  1167. this.form = JSON.parse(JSON.stringify(this.temporaryForm))
  1168. meth.getPrompt('提交异常!', 'error')
  1169. uni.hideLoading()
  1170. }
  1171. });
  1172. },
  1173. //据添加到展示表上
  1174. setZhanShiBiao(params) {
  1175. let pp = {
  1176. paramWhere: [],
  1177. tableName: "t_lhwtzsb"
  1178. }
  1179. pp.paramWhere = params
  1180. let dataPP = this.$sig(pp)
  1181. this.$http.post("/ibps/business/v3/sys/universal/addDataContextTable", dataPP).then(res => {
  1182. if (res.data.state == 200) {
  1183. }
  1184. });
  1185. },
  1186. //驳回同意数据请求
  1187. getArgee(data) {
  1188. this.$http.post("/ibps/business/v3/bpm/task/agree", data).then(res => {
  1189. if (res.data.state == 200) {
  1190. this.$tip.success('提交成功!')
  1191. this.getLiuHen()
  1192. uni.hideLoading();
  1193. this.$Router.replaceAll({
  1194. name: 'index'
  1195. })
  1196. } else {
  1197. this.form = JSON.parse(JSON.stringify(this.temporaryForm))
  1198. meth.getPrompt('提交异常!', 'fail')
  1199. uni.hideLoading()
  1200. }
  1201. });
  1202. },
  1203. //数据留痕
  1204. getLiuHen() {
  1205. this.form.taoCanShow = this.taoCanShow
  1206. this.form.hetongList = this.hetongList
  1207. this.form.taoCanList = this.taoCanList
  1208. this.form.jianCeTypeList = this.jianCeTypeList
  1209. this.form.jianCeList = this.jianCeList
  1210. let dataContent = JSON.stringify(this.form)
  1211. let list = []
  1212. let obj = {
  1213. wei_tuo_dan_hao_: this.form.weiTuoBianHao,
  1214. bao_cun_nei_rong_: dataContent,
  1215. dui_ying_shu_ju_b: 't_lhwtblh',
  1216. bao_cun_biao_ti_: '委托单留痕',
  1217. zhuang_tai_: '留痕',
  1218. bian_zhi_shi_jian: this.time2,
  1219. bian_zhi_ren_: this.userid
  1220. }
  1221. list.push(obj)
  1222. const params2 = {
  1223. tableName: 't_mjsjdzcb',
  1224. paramWhere: list
  1225. }
  1226. let data = this.$sig(params2)
  1227. this.$http.post("ibps/business/v3/sys/universal/addDataContextTable", data).then(res => {
  1228. if (res.data.state == 200) {}
  1229. });
  1230. },
  1231. //删除展示表数据
  1232. getDeleteZanCun() {
  1233. let params = {}
  1234. params['tableName'] = 't_mjsjdzcb'
  1235. params['paramWhere'] = "{id_:'" + this.saveId + "'}"
  1236. let requestData = this.$sig(params)
  1237. this.$http.post("/ibps/business/v3/sys/universal/batchDelete", requestData).then(res => {
  1238. if (res.data.state == 200) {}
  1239. })
  1240. },
  1241. getBeingSave(dataCom) {
  1242. uni.showModal({
  1243. title: '提示',
  1244. content: '是否把现有信息保存?',
  1245. success: res => {
  1246. if (res.confirm) {
  1247. let dataContent = JSON.stringify(dataCom)
  1248. let list = []
  1249. let obj = {
  1250. wei_tuo_dan_hao_: dataCom.weiTuoBianHao,
  1251. bao_cun_nei_rong_: dataContent,
  1252. dui_ying_shu_ju_b: 't_lhwtsqb',
  1253. bao_cun_biao_ti_: '委托单',
  1254. zhuang_tai_: '未完成',
  1255. bian_zhi_shi_jian: this.time2,
  1256. bian_zhi_ren_: this.userid
  1257. }
  1258. list.push(obj)
  1259. const params2 = {
  1260. tableName: 't_mjsjdzcb',
  1261. paramWhere: list
  1262. }
  1263. let data = this.$sig(params2)
  1264. this.$http.post("ibps/business/v3/sys/universal/addDataContextTable", data)
  1265. .then(res => {
  1266. if (res.data.state == 200) {
  1267. meth.getPrompt('暂存成功')
  1268. } else {
  1269. meth.getPrompt('暂存失败', 'error')
  1270. }
  1271. });
  1272. } else if (res.cancel) {}
  1273. }
  1274. });
  1275. },
  1276. //添加样品记录
  1277. getSing() {
  1278. if (this.form.heTongId == '') {
  1279. return meth.getPrompt('请选择合同')
  1280. }
  1281. this.getLhypbh(res => {
  1282. let data = meth.getMjypbSin(res, this.jianCeList, this.taoCanList)
  1283. this.lhypbShow = true
  1284. this.lhypbIndexData = 'add'
  1285. this.itemType = true
  1286. this.$nextTick(() => {
  1287. this.$refs.lhypbMessage.getInit(data)
  1288. })
  1289. })
  1290. },
  1291. updateClick(index, type) {
  1292. let obj = this.form.lhypb[index]
  1293. if (type == 'detail') {
  1294. this.itemType = false
  1295. } else {
  1296. this.itemType = true
  1297. }
  1298. this.lhypbIndexData = type
  1299. this.lhypbShow = true
  1300. this.$nextTick(() => {
  1301. this.$refs.lhypbMessage.getInit(obj)
  1302. })
  1303. this.getTotal()
  1304. },
  1305. deletSing(index) {
  1306. if (index != 0) {
  1307. this.lhypbIndex = index - 1
  1308. } else {
  1309. this.lhypbIndex = 0
  1310. }
  1311. this.form.lhypb.splice(index, 1)
  1312. this.getTotal()
  1313. },
  1314. //弹出框显示
  1315. qianming(index) {
  1316. this.qianshow = true
  1317. this.qianIndex = index
  1318. this.popupShow = true
  1319. },
  1320. //清除签名
  1321. deqianming(index) {
  1322. if (index == 0) {
  1323. this.form.weiTuoFangQueRen = ''
  1324. }
  1325. },
  1326. //保存签名
  1327. save(val) {
  1328. if (this.qianIndex == 0) {
  1329. this.form.weiTuoFangQueRen = val
  1330. }
  1331. this.qianshow = false
  1332. this.popupShow = false
  1333. },
  1334. //清除签名
  1335. clear(val) {
  1336. if (this.qianIndex == 0) {
  1337. this.form.weiTuoFangQueRen = ''
  1338. }
  1339. },
  1340. /**
  1341. * 关闭签名弹窗
  1342. */
  1343. close() {
  1344. this.popupShow = false
  1345. },
  1346. /**
  1347. * @param {Object} data
  1348. * @param {Object} list
  1349. * 过滤,只要判断数据在数组中text字段
  1350. */
  1351. getButtChange(data, list) {
  1352. if (data && list) {
  1353. let itemData = list.find(item => item.value == data)
  1354. if (itemData) {
  1355. return itemData.text
  1356. } else {
  1357. return data
  1358. }
  1359. }
  1360. return data
  1361. },
  1362. /**
  1363. * 生成唯一id
  1364. */
  1365. generateUUID() {
  1366. var d = new Date().getTime();
  1367. var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
  1368. var r = (d + Math.random() * 16) % 16 | 0;
  1369. d = Math.floor(d / 16);
  1370. return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
  1371. });
  1372. return uuid;
  1373. },
  1374. //取消
  1375. deletClick() {
  1376. this.lhypbShow = false
  1377. },
  1378. //样品保存返回数据保存到样品表上,修改样品对对应的样品表
  1379. sumbitSingClick(item) {
  1380. if (this.lhypbIndexData == 'add') {
  1381. this.lhypbShow = false
  1382. this.form.lhypb.push(item)
  1383. } else {
  1384. this.lhypbShow = false
  1385. this.form.lhypb[this.lhypbIndex] = item
  1386. }
  1387. this.getTotal()
  1388. },
  1389. //退回原因
  1390. getBack() {
  1391. this.content = this.option
  1392. this.backShow = true
  1393. },
  1394. //检测详情弹出框
  1395. getJianXiangData(item) {
  1396. let content = `
  1397. 1. 检测项目编号:${item.xiang_mu_bian_hao}<br>
  1398. 2. 检测项目名称:${item.jian_ce_xiang_mu_}<br>
  1399. 3. 检测类别:${item.jian_ce_lei_bie_}<br>
  1400. 4. 操作规程:${item.yi_ju_de_biao_zhu}<br>
  1401. 5. 送样要求:${item.yang_pin_tiao_jia}<br>
  1402. 6. 报告周期(工作日):${item.bao_gao_zhou_qi_g}<br>
  1403. 7. 价格:${item.zhe_hou_jia_ge_}元<br>
  1404. `
  1405. this.content = content
  1406. this.meassageShow = true
  1407. },
  1408. cancel() {
  1409. this.meassageShow = false
  1410. this.backShow = false
  1411. },
  1412. //切换
  1413. activeNumClick(index) {
  1414. if (index != '1') {
  1415. if (!service.getActiveNum1(this.form)) {
  1416. return
  1417. }
  1418. }
  1419. this.$refs.top.activeNum = index
  1420. this.activeNum = index
  1421. },
  1422. userListChange(e) {
  1423. this.hetongList = []
  1424. this.getDataHetong('', e)
  1425. },
  1426. chuBaoGaoChange(e) {
  1427. this.form.chuBaoGaoShiJian = e.detail.value.join(",")
  1428. }
  1429. }
  1430. }
  1431. </script>
  1432. <style scoped lang="scss">
  1433. .btn {
  1434. margin: 15rpx
  1435. }
  1436. .qingshe {
  1437. background-color: #f0f9eb;
  1438. color: #67c23a;
  1439. padding: 15rpx 20rpx;
  1440. border-radius: 8rpx;
  1441. display: flex;
  1442. justify-content: space-between;
  1443. align-items: center;
  1444. margin-top: 25rpx;
  1445. }
  1446. .tagBox {
  1447. display: flex;
  1448. flex-wrap: wrap;
  1449. margin: 20rpx 10rpx;
  1450. .tagSin {
  1451. margin: 10rpx;
  1452. }
  1453. }
  1454. .jiancexiangm {
  1455. padding: 10rpx 30rpx;
  1456. // width: 100%;
  1457. padding: 20rpx;
  1458. margin-bottom: 20rpx;
  1459. background-color: #f1f1f1;
  1460. border-radius: 8rpx;
  1461. font-size: 26rpx;
  1462. color: $u-content-color;
  1463. line-height: 1.7;
  1464. view {
  1465. line-height: 30rpx;
  1466. }
  1467. }
  1468. .btnBox {
  1469. display: flex;
  1470. flex-wrap: wrap;
  1471. .btnSin {
  1472. margin: 10rpx 5rpx;
  1473. }
  1474. }
  1475. .u-full-content {
  1476. background-color: #00C777;
  1477. }
  1478. .u-update-content {
  1479. font-size: 26rpx;
  1480. color: $u-content-color;
  1481. line-height: 1.7;
  1482. padding: 30rpx;
  1483. }
  1484. .bottomBtn {
  1485. position: fixed;
  1486. left: 0;
  1487. right: 0;
  1488. bottom: 0;
  1489. background-color: #FFFFFF;
  1490. z-index: 999;
  1491. }
  1492. /deep/ .uni-group__content {
  1493. padding: 15rpx 25rpx;
  1494. }
  1495. //换行居中
  1496. /deep/ uni-text span {
  1497. white-space: normal;
  1498. word-break: break-all;
  1499. text-align: center;
  1500. display: inline-block;
  1501. }
  1502. /deep/ .uni-checkbox-input::before {
  1503. display: block;
  1504. }
  1505. /deep/ .u-form-item--right__content__slot {
  1506. display: block;
  1507. }
  1508. /deep/ .uni-group__title {
  1509. background-color: #f0f9eb;
  1510. color: #67c23a !important;
  1511. }
  1512. /deep/ .uni-group__title-text {
  1513. color: #67c23a !important;
  1514. }
  1515. /deep/ .lineStyle .u-form-item__body{
  1516. // align-items: baseline;
  1517. .fontSty{
  1518. font-size: 22rpx;
  1519. color: #ff9900;
  1520. }
  1521. }
  1522. </style>