order.vue 45 KB

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