order.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771
  1. <template>
  2. <view>
  3. <cu-custom bgColor="bg-gradual-pink" :isBack="true" >
  4. <block slot="backText">返回</block>
  5. <block slot="content">检测委托申请</block>
  6. </cu-custom>
  7. <form>
  8. <uni-group mode="card">
  9. <view class="cu-form-group" style="justify-content: flex-start;">
  10. <view class="title">委托单号</view>
  11. <view style="text-align: left;" >{{weituodanhao}}</view>
  12. </view>
  13. <!-- <view class="cu-form-group">
  14. <view class="title">类型</view>
  15. <input placeholder="常规" name="input" v-model="myFormData.username" disabled></input>
  16. </view> -->
  17. <view class="cu-form-group">
  18. <my-date style="padding: 0rpx;" v-model="beginTime" placeholder="请选择" fields="day"
  19. label="期望完成时间"></my-date>
  20. </view>
  21. </uni-group>
  22. <!-- <uni-link
  23. href="https://www.szjyxt.com/demo/reportJsp/pdfReport.jsp?access_token%20=%20999f19ea64f947ab83c13b0ef5e6677e&rpx=%E4%B8%AD%E6%B1%87%E7%91%9E%E5%BE%B7%E6%A3%80%E6%B5%8B%E4%B8%AD%E5%BF%83/08%E4%BB%AA%E5%99%A8%E8%AE%BE%E5%A4%87%E7%9A%84%E4%BD%BF%E7%94%A8%E3%80%81%E7%BB%B4%E6%8A%A4%E5%92%8C%E7%AE%A1%E7%90%86%E7%A8%8B%E5%BA%8F/GDYR-CX06-R06A%20%20%E4%BB%AA%E5%99%A8%E8%AE%BE%E5%A4%87%E7%BB%B4%E6%8A%A4%E4%BF%9D%E5%85%BB%E8%AE%B0%E5%BD%95%E8%A1%A8(%E6%9C%88).rpx&id_=948538515816185856"
  24. text="查阅报告"></uni-link>
  25. <uni-link
  26. href="
  27. https://www.szjyxt.com/demo/reportJsp/pdfReport.jsp?access_token%20=%20999f19ea64f947ab83c13b0ef5e6677e&rpx=%E4%B8%AD%E6%B1%87%E7%91%9E%E5%BE%B7%E6%A3%80%E6%B5%8B%E4%B8%AD%E5%BF%83/08%E4%BB%AA%E5%99%A8%E8%AE%BE%E5%A4%87%E7%9A%84%E4%BD%BF%E7%94%A8%E3%80%81%E7%BB%B4%E6%8A%A4%E5%92%8C%E7%AE%A1%E7%90%86%E7%A8%8B%E5%BA%8F/GDYR-CX06-R06A%20%20%E4%BB%AA%E5%99%A8%E8%AE%BE%E5%A4%87%E7%BB%B4%E6%8A%A4%E4%BF%9D%E5%85%BB%E8%AE%B0%E5%BD%95%E8%A1%A8(%E6%9C%88).rpx&id_=948538515816185856
  28. "
  29. text="超链"></uni-link> -->
  30. <!-- <uni-section title="基本用法" type="line" padding>
  31. <uni-rate v-model="rateValue" @change="onChange" />
  32. </uni-section>
  33. <uni-section title="半星" subTitle="使用 allow-half 属性设置是否显示半星" type="line" padding>
  34. <uni-rate allow-half :value="3.5" />
  35. </uni-section> -->
  36. <uni-group mode="card" title="样品信息">
  37. <view class="cu-form-group margin-top">
  38. <view class="title" style="color: #888888">样品名称</view>
  39. <input placeholder="请输入样品名称" v-model="ypname" name="input"></input>
  40. </view>
  41. <view class="cu-form-group ">
  42. <view class="title" style="color: #888888">规格型号</view>
  43. <input placeholder="请输入规格型号" v-model="ypguige" name="input"></input>
  44. </view>
  45. <view class="cu-form-group ">
  46. <view class="title" style="color: #888888">数量</view>
  47. <input placeholder="请输入数量" v-model="ypshuliang" type="number" name="input"></input>
  48. </view>
  49. <view class="cu-form-group ">
  50. <view class="title" style="color: #888888">生产日期/批号</view>
  51. <input placeholder="请输入" v-model="yppihao" name="input"></input>
  52. </view>
  53. <view class="cu-form-group ">
  54. <view class="title" style="color: #888888">样品处置</view>
  55. <app-select v-model="type2" placeholder="请选择处置方式" :dict="plan_type" space></app-select>
  56. </view>
  57. <view class="cu-form-group">
  58. <view class="title" style="color: #888888">检测类别</view>
  59. <app-select v-model="type1" placeholder="请选择检测类别" :dict="plan_type1" space ></app-select>
  60. </view>
  61. </uni-group>
  62. <uni-group mode="card" >
  63. <uni-section v-bind:title="'检测对象/'+sex[radio1].leixing" type="line">
  64. <view class="example-body2 uni-px-5 uni-pb-5">
  65. <uni-data-checkbox :multiple="false" v-model="radio1" :localdata="sex" @change="change(sex[radio1].text)">
  66. </uni-data-checkbox>
  67. </view>
  68. <view class="uni-px-5 uni-pb-5">
  69. <uni-data-checkbox multiple v-model="checkbox2"
  70. :localdata="sex[radio1].canshu" icon="right" @change="calc" ></uni-data-checkbox>
  71. </view>
  72. <view>
  73. <view style="margin-bottom: 25rpx; float: right;">总价:{{total}}¥</view>
  74. </view>
  75. </uni-section>
  76. <uni-collapse-item title="检测方法" :open="false">
  77. <uni-card :is-shadow="false" >
  78. {{fangfaText}}
  79. </uni-card>
  80. </uni-collapse-item>
  81. </uni-group>
  82. <view class="">
  83. <uni-section title="" type="line" padding>
  84. <view class="cu-form-group">
  85. <view class="title">报告份数</view>
  86. <uni-number-box v-model="vModelValue" @blur="blur" @focus="focus" @change="changeValue" />
  87. </view>
  88. <view class="cu-form-group">
  89. <view class="title">是否出具意见和解释</view>
  90. <uni-data-checkbox v-model="radio2" :localdata="yijian" @change="change(yijian[radio2].text)">
  91. </uni-data-checkbox>
  92. </view>
  93. <view class="cu-form-group">
  94. <view class="title">检测结论</view>
  95. <uni-data-checkbox v-model="radio3" :localdata="jielun" @change="change(jielun[radio3].text)">
  96. </uni-data-checkbox>
  97. </view>
  98. <view class="cu-form-group">
  99. <view class="title">取报告方式</view>
  100. <uni-data-checkbox style="flex-wrap: nowrap;" v-model="radio4" :localdata="baogao"
  101. @change="change(baogao[radio4].text)"></uni-data-checkbox>
  102. </view>
  103. <view class="cu-form-group" style="justify-content: flex-start;">
  104. <view class="title">其它要求</view>
  105. <view><input class="uni-input" v-model="remark" /></view>
  106. </view>
  107. <uni-collapse-item title="声明" :open="open">
  108. <uni-card :is-shadow="false">
  109. <text class="uni-body" style="color: #DD514C;">1.送样单位须保证样品的真实性、代表性.
  110. 2.本检验中心保证检测结果的公正性,对来样的检测数据负责;并对其样品及相关资料保密。
  111. 3.委托方需对送检样品的安全性和缺陷负责,一旦因样品自身问题发生事故损失的,委托方需承担相应责任。</text>
  112. </uni-card>
  113. </uni-collapse-item>
  114. </uni-section>
  115. </view>
  116. <view class="padding flex flex-direction" style="margin-bottom: 100rpx;">
  117. <button class="cu-btn bg-blue lg" @click="onSubmit">提交</button>
  118. </view>
  119. </form>
  120. </view>
  121. </template>
  122. <script>
  123. const plan_type = [{
  124. text: '返回给委托人',
  125. value: '1'
  126. }, {
  127. text: '自取',
  128. value: '2'
  129. }, {
  130. text: '不取回',
  131. value: '3'
  132. }];
  133. const plan_type1 = [{
  134. text: '委托检测',
  135. value: '1'
  136. }, {
  137. text: '抽样检测',
  138. value: '2'
  139. }];
  140. import myDate from '@/components/my-componets/my-date.vue'
  141. import appSelect from '@/components/my-componets/appSelect.vue'
  142. import md5 from "@/common/util/md5.js"
  143. import { ACCESS_TOKEN,USER_NAME,USER_INFO } from "@/common/util/constants"
  144. export default {
  145. components: {
  146. myDate,
  147. appSelect
  148. },
  149. data() {
  150. return {
  151. remark:'无特殊要求',
  152. jiance:[],
  153. ypname:'',
  154. ypguige:'',
  155. ypshuliang:'',
  156. yppihao:'',
  157. ypchuzhi:'',
  158. ypleibie:'',
  159. fangfa:[],
  160. fangfaText:'',
  161. total:0,
  162. open:true,
  163. rateValue: 0,
  164. vModelValue: 1,
  165. radio1: 0,
  166. radio2: 1,
  167. radio3: 1,
  168. radio4: 0,
  169. checkbox2: [],
  170. sex: [{
  171. text: '碳素钢和中低合金钢',
  172. value: 0,
  173. canshu:[]
  174. }, {
  175. text: '金属零件',
  176. value: 1,
  177. canshu:[]
  178. }],
  179. yijian: [{
  180. text: '要',
  181. value: 0
  182. }, {
  183. text: '不要',
  184. value: 1
  185. }],
  186. jielun: [{
  187. text: '要',
  188. value: 0
  189. }, {
  190. text: '不要',
  191. value: 1
  192. }],
  193. baogao: [{
  194. text: '自取',
  195. value: 0
  196. }, {
  197. text: '邮件',
  198. value: 1
  199. }, {
  200. text: '其它',
  201. value: 2
  202. }],
  203. value: 0,
  204. type: "default",
  205. inverted: false,
  206. leibie: "",
  207. weituodanhao: '',
  208. plan_type1,
  209. plan_type,
  210. type2: '',
  211. type1: '',
  212. beginTime: '',
  213. index: -1,
  214. leixing: '',
  215. switchC: true,
  216. imgList: [],
  217. uploadUrl: "/sys/common/upload",
  218. myFormData: {
  219. weituodanhao: '',
  220. avatar: '',
  221. realname: '',
  222. username: '',
  223. sex: 1,
  224. birthday: '',
  225. orgCode: '',
  226. workNo: '',
  227. phone: '',
  228. email: '',
  229. id: '',
  230. },
  231. };
  232. },
  233. onLoad: function(option) {
  234. let pagepara={
  235. "parameters": [],
  236. "requestPage": {
  237. "pageNo": 1,
  238. "limit": 100,
  239. "offset": 0,
  240. "totalCount": 12
  241. }
  242. }
  243. let this_=this;
  244. //"ibps/business/v3/entrust/sysjtsjpz/query"
  245. this.$http.post("/ibps/business/v3/entrust/sysjtsjpz/query", pagepara).then(res => {
  246. if (res.data.state == 200) {
  247. console.log(res.data.variables.data)
  248. let data=res.data.variables.data;
  249. //console.log(filterJson(data,"jianCeDuiXiang"))
  250. let jianceduix=filterJson(data,"jianCeDuiXiang")
  251. let datajiance=[]
  252. for(let i in jianceduix){
  253. let yy={};
  254. yy.jianceduix=jianceduix[i].jianCeDuiXiang;
  255. yy.jianCeLeiBie=jianceduix[i].jianCeLeiBie;
  256. yy.jianCeFangFa=jianceduix[i].jianCeFangFa;
  257. yy.canshu=data.filter(function(item){
  258. return item.jianCeDuiXiang==jianceduix[i].jianCeDuiXiang
  259. })
  260. datajiance.push(yy);
  261. }
  262. //let jiance=[];
  263. for(let i in datajiance){
  264. let entity={};
  265. entity.value=i;
  266. entity.text=datajiance[i].jianceduix;
  267. entity.leixing=datajiance[i].jianCeLeiBie;
  268. entity.canshu=datajiance[i].canshu;
  269. entity.fangfa=datajiance[i].jianCeFangFa;
  270. for(let j in datajiance[i].canshu){
  271. datajiance[i].canshu[j].text=datajiance[i].canshu[j].xiangMuCanShu+" 单价:"+datajiance[i].canshu[j].price +"¥"
  272. datajiance[i].canshu[j].value=j;
  273. // datajiance[i].canshu[j].selected=true;
  274. }
  275. if(i<2){
  276. this_.sex[i]=entity;//
  277. }else{
  278. this_.sex.push(entity)
  279. }
  280. //jiance.push(entity)
  281. }
  282. this_.radio1=0;
  283. console.log(this_.sex)
  284. //this_.radio1=0;
  285. }
  286. });
  287. this.radio1=0;
  288. //this.defaultdata=[0,1];
  289. //委托单号
  290. let smsParams = {
  291. alias: "gzyrwtbh"
  292. };
  293. this.$http.post("/ibps/business/v3/jc/sys/getNextIdByAlias", smsParams).then(res => {
  294. if (res.data.state == 200) {
  295. console.log(res.data.data)
  296. this_.weituodanhao = res.data.data
  297. }
  298. });
  299. //检测对象 https://www.szjyxt.com/ibps/business/v3/data/template/queryDataTable
  300. /* let param1 = {
  301. "parameters": [{
  302. "key": "response_data",
  303. "value": "{\"template_id\":\"958692267806162944\",\"template_type\":\"\",\"attrs\":\"\",\"result_columns\":[{\"label\":\"检测对象\",\"name\":\"jian_ce_dui_xiang\"}],\"sort_columns\":\"\",\"buttons\":\"\",\"export_columns\":\"\",\"datasetKey\":\"jianceduixiangv\",\"unique\":\"jian_ce_dui_xiang\",\"key\":\"jcdxzly\",\"dynamic_params\":{}}"
  304. },
  305. {
  306. "key": "filter_condition_key",
  307. "value": ""
  308. }
  309. ]
  310. } */
  311. /* this.$http.post("ibps/business/v3/data/template/queryDataTable", param1).then(res => {
  312. if (res.data.state == 200) {
  313. console.log(res.data.data)
  314. let data = res.data.data.dataResult
  315. console.log(data)
  316. }
  317. }); */
  318. //检测类型、检测
  319. //请求系统接口demo
  320. //查询方法名称
  321. let data = 'select * FROM t_ffgl';
  322. data = '{"sql":"' + data + '"}'
  323. let md5 = this.sig(data) //加密, 获取md5密文
  324. let requestData = data.slice(0, 1) + '"sig":"' + md5 + '",' + data.slice(1) //结果拼接
  325. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  326. if (res.data.state == 200) {
  327. this.fangfa = res.data.variables.data
  328. }
  329. });
  330. let query = this.$Route.query
  331. },
  332. methods: {
  333. calc(e){
  334. console.log(e)
  335. //计算价格
  336. let total=0;
  337. let data=e.detail.data;
  338. let canshu=[];
  339. let text='';
  340. let jiance=[];
  341. for(let i in data){
  342. //计算价格
  343. total=total+data[i].price;
  344. canshu.push(data[i].xiangMuCanShu)
  345. //生成检测项目数据
  346. let entity={};
  347. entity.jianCeLeiXing=data[i].jianCeDuiXiang;
  348. entity.xiangMuCanShu=data[i].xiangMuCanShu;
  349. entity.jianCeFangFa=data[i].jianCeFangFa;
  350. entity.danJia=data[i].price;
  351. entity.shuLiang="1";
  352. entity.zheKou="0";
  353. entity.zheHouJia=data[i].price;
  354. //方法text拼接
  355. for(let j in this.fangfa){
  356. let fangfaid=data[i].jianCeFangFa.split(",")
  357. //console.log(fangfaid)
  358. /* for( let k in fangfaid){
  359. let id=fangfaid[k].replace(",","")
  360. console.log(data[i].jianCeFangFa==id)
  361. if(data[i].jianCeFangFa==id){
  362. text=text+ i+"."+this.fangfa[j].fang_fa_ming_chen+"<br/>"
  363. }
  364. } */
  365. }
  366. jiance.push(entity);
  367. }
  368. this.fangfaText=text;
  369. console.log(this.fangfaText)
  370. this.jiance=jiance;
  371. this.canshu=canshu;
  372. this.total=total
  373. },
  374. onChange(e) {
  375. //console.log('rate发生改变:' + JSON.stringify(e))
  376. console.log(e)
  377. // console.log(this.rateValue);
  378. },
  379. onSubmit() {
  380. let data={
  381. crmZhuangTai: "crm",
  382. weiTuoZhuangTai: "待审核",
  383. id: "",
  384. weiTuoDanHaoZhuan: "",
  385. yangPinBianHaoZhu: "",
  386. shouLiBuMen: "检测室",
  387. weiTuoFang: "外部委托",
  388. jianCeWeiZhi: "",
  389. shouLiShiJian: "2022-06-07",
  390. dingDanHao: "",
  391. dingDanLaiYuan: "业务人员下单",
  392. baoJiaDan: "",
  393. quDao: "手机下单",
  394. xiaoShouRenYuan: "",
  395. zongJinE: this.total,
  396. weiTuoDanHao: "",
  397. lianXiRen: "",
  398. weiTuoDanWei: "",
  399. lianXiFangShi: "",
  400. qiWangWanChengShi: "",
  401. tongXunDiZhi: "质量部",
  402. gdyrqcyp: [],
  403. yangPinChuZhi: "",
  404. jianCeLeiBie: "",
  405. keHuYaoQiu: "无特殊要求",
  406. jcxmcrm: [], //检测项目
  407. quBaoGaoFangShiJi: "自取",
  408. baoGaoFenShu: 1,
  409. qiTaYaoQiu: this.remark,
  410. jianCeJieGuoZuoCh: "不要",
  411. jianCeJieLun: "不要",
  412. jianCeBaoGaoZhong: "不要",
  413. hkfab: [],
  414. dingDanShenHeYiJi: "",
  415. dingDanShenPiYiJi: "",
  416. bianZhiRen: "",
  417. yangPinMingCheng: "样品名称",
  418. guiGeXingHao: "",
  419. shengChanRiQiPiHa: "",
  420. shouJiKeHuId:""
  421. };
  422. //组装数据
  423. //获取下单用户信息
  424. let info= uni.getStorageSync(USER_INFO);
  425. console.log(info)
  426. if(info==undefined){
  427. return;
  428. }
  429. data.lianXiRen=info.username;
  430. data.weiTuoDanWei=info.companyid;
  431. data.lianXiFangShi=info.number;
  432. data.dingDanLaiYuan="手机下单";
  433. data.shouLiBuMen="检测室";
  434. data.shouJiKeHuId=info.id;
  435. data.weiTuoDanHao=this.weituodanhao;
  436. data.qiWangWanChengShi=this.beginTime;
  437. data.jcxmcrm=this.jiance;
  438. //样品处置
  439. if(this.type2==""||this.type1==""){
  440. this.$tip.alert("请选择检测类别或处置方式");
  441. return false;
  442. }
  443. data.yangPinChuZhi=this.plan_type[this.type2-1].text;
  444. //检测类别
  445. data.jianCeLeiBie=this.plan_type1[this.type1-1].text;
  446. //样品名称、规格、数量、批号
  447. let yangpin= {
  448. yangPinMingCheng: this.ypname,
  449. guiGeXingHao:this.ypguige,
  450. shuLiang: this.ypshuliang,
  451. shengChanRiQiPiHa: this.yppihao
  452. }
  453. data.gdyrqcyp.push(yangpin);
  454. //报告份数
  455. data.baoGaoFenShu=this.vModelValue;
  456. //检测结论
  457. data.jianCeJieLun=this.jielun[this.radio3].text;
  458. data.quBaoGaoFangShiJi=this.baogao[this.radio4].text
  459. let para={boCode: "gdyrqcwt",
  460. version: 0,
  461. formKey: "ddfq",
  462. pk: "",
  463. data:JSON.stringify(data)}
  464. // console.log(para)
  465. let that=this;
  466. this.$http.post("ibps/business/v3/data/template/saveFormData/vo",para).then(res =>{
  467. if (res.data.state == 200) {
  468. this.$tip.success("下单成功!")
  469. this.$Router.replace({name:'index'})
  470. }else{
  471. this.$tip.error("请求错误: "+res.data.message)
  472. }
  473. }).catch((err) => {
  474. let msg = ((err.response || {}).data || {}).message || err.data.message || "请求出现错误,请稍后再试"
  475. this.$tip.error(msg);
  476. });
  477. },
  478. DateChange(e) {
  479. this.myFormData.birthday = e.detail.value
  480. },
  481. SwitchC(e) {
  482. this.switchC = e.detail.value
  483. },
  484. sig(sql) {
  485. let rul = (sql.length + 9) * 12 * 3 + 168
  486. let salt = "JinYuanXinTong"
  487. return md5(rul + '' + salt)
  488. },
  489. ChooseImage() {
  490. var that = this;
  491. uni.chooseImage({
  492. count: 4, //默认9
  493. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  494. sourceType: ['album'], //从相册选择
  495. success: (res) => {
  496. that.$http.upload(that.$config.apiUrl + that.uploadUrl, {
  497. filePath: res.tempFilePaths[0],
  498. name: 'file'
  499. })
  500. .then(res => {
  501. that.myFormData.avatar = res.data.message;
  502. })
  503. .catch(err => {
  504. that.$tip.error(err.data.message)
  505. });
  506. this.imgList = res.tempFilePaths
  507. }
  508. });
  509. },
  510. ViewImage(e) {
  511. uni.previewImage({
  512. urls: this.imgList,
  513. current: e.currentTarget.dataset.url
  514. });
  515. },
  516. DelImg(e) {
  517. uni.showModal({
  518. title: '召唤师',
  519. content: '确定要删除这段回忆吗?',
  520. cancelText: '再看看',
  521. confirmText: '再见',
  522. success: res => {
  523. if (res.confirm) {
  524. this.imgList.splice(e.currentTarget.dataset.index, 1)
  525. }
  526. }
  527. })
  528. },
  529. change(text) {
  530. this.checkbox2=[]; //检测项目重新选择
  531. /* if (text == '金属零件' || text == '碳素钢和中低合金钢') {
  532. let data = '';
  533. if (text == '金属零件') {
  534. data = "select * from t_sysjtsjpz where jian_ce_dui_xiang = '金属零件' and shi_fou_shan_chu_ = '0'";
  535. this.leixing = "尺寸和形位公差测量"
  536. }
  537. if (text == '碳素钢和中低合金钢') {
  538. data =
  539. "select * from t_sysjtsjpz where jian_ce_dui_xiang = '碳素钢和中低合金钢' and shi_fou_shan_chu_ = '0'";
  540. this.leixing = "元素成分测定"
  541. }
  542. data = '{"sql":"' + data + '"}'
  543. let md5 = this.sig(data) //加密, 获取md5密文
  544. let requestData = data.slice(0, 1) + '"sig":"' + md5 + '",' + data.slice(1) //结果拼接
  545. this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
  546. if (res.data.state == 200) {
  547. let result = res.data.variables.data;
  548. console.log(result)
  549. let canshu = []
  550. for (let index in result) {
  551. let en = {}
  552. en.show = false,
  553. en.text = result[index].xiang_mu_can_shu_;
  554. canshu.push(en);
  555. }
  556. this.canshu = canshu;
  557. console.log(this.canshu)
  558. }
  559. });
  560. }
  561. */
  562. },
  563. changeValue(value) {
  564. console.log('返回数值:', value);
  565. },
  566. focus(e) {
  567. console.log('focus:', e);
  568. },
  569. blur(e) {
  570. console.log('blur:', e);
  571. },
  572. setType() {
  573. let types = ["default", "primary", "success", "warning", "error"];
  574. let index = types.indexOf(this.type);
  575. types.splice(index, 1);
  576. let randomIndex = Math.floor(Math.random() * 4);
  577. this.type = types[randomIndex];
  578. },
  579. setInverted(index) {
  580. this.canshu[index].show = !this.canshu[index].show;
  581. },
  582. }
  583. }
  584. //过滤数据
  585. function filterJson(data, Name) { //data是json对象,Name是根据什么字段去重
  586. var map = {},
  587. dest = [];
  588. for (var i = 0; i < data.length; i++) {
  589. var ai = data[i];
  590. if (i == 0) {
  591. dest.push(ai);
  592. } else {
  593. var filterData = dest.filter(function (e) {
  594. return e[Name] == ai[Name];
  595. })
  596. if (filterData.length == 0) {
  597. dest.push(ai);
  598. }
  599. }
  600. }
  601. return dest;
  602. }
  603. </script>
  604. <style>
  605. .cu-form-group .title {
  606. min-width: calc(4em + 15px);
  607. }
  608. .example-body {
  609. /* #ifndef APP-PLUS-NVUE */
  610. display: flex;
  611. /* #endif */
  612. flex-direction: row;
  613. justify-content: flex-start;
  614. align-items: flex-end;
  615. flex-wrap: wrap;
  616. }
  617. .tag-view {
  618. margin-right: 10px;
  619. }
  620. .example-body2 {
  621. padding: 12px;
  622. background-color: #FFFFFF;
  623. }
  624. .result-box {
  625. text-align: center;
  626. padding: 20px 0px;
  627. font-size: 16px;
  628. }
  629. .uni-list-item {
  630. border-bottom-style: solid;
  631. border-bottom-width: 1px;
  632. border-bottom-color: #eee;
  633. font-size: 14px;
  634. }
  635. .uni-list-item__container {
  636. /* #ifndef APP-NVUE */
  637. display: flex;
  638. width: 100%;
  639. box-sizing: border-box;
  640. /* #endif */
  641. padding: 12px 15px;
  642. flex: 1;
  643. position: relative;
  644. flex-direction: row;
  645. justify-content: space-between;
  646. align-items: center;
  647. }
  648. .uni-list-item__content-title {
  649. font-size: 14px;
  650. color: #666;
  651. }
  652. </style>