order.vue 45 KB

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