expert.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847
  1. $(function () {
  2. $("#jqGrid").jqGrid({
  3. url: baseURL + 'wjxy/expert/page',
  4. datatype: "json",
  5. colModel: [
  6. { label: 'id', name: 'id', index: 'id', width: 50, key: true ,hidden: true},
  7. { label: '行家名称', name: 'name', index: 'name', width: 80 },
  8. { label: '电话', name: 'phone', index: 'phone', width: 80 },
  9. { label: '职称', name: 'jobTitle', index: 'job_title', width: 80 },
  10. { label: '行家头像', name: 'expertPhoto', index: 'expert_photo', width: 80, formatter: imageFormat },
  11. { label: '所属地区', name: 'expertRegion', index: 'expert_region', width: 80, formatter: function (cellvalue, options, rowdata) {
  12. return '湖北省' + rowdata.cityStr
  13. } },
  14. { label: '状态', name: 'status', index: 'status', width: 80,formatter: function (cellvalue, options, rowdata) {
  15. if(cellvalue == 0) {
  16. return '禁用'
  17. }else {
  18. return '正常'
  19. }
  20. } },
  21. { label: '创建时间', name: 'createTime', index: 'create_time', width: 80 },
  22. { label: '关联用户', name: 'updateId', index: 'update_id', width: 80, formatter: function (cellvalue, options, rowdata) {
  23. return "<div>" + rowdata.vipName +"</div>" + "<div>" + rowdata.cardNo + "</div>"
  24. }
  25. },
  26. ],
  27. viewrecords: true,
  28. height: 385,
  29. rowNum: 10,
  30. rowList : [10,30,50],
  31. rownumbers: true,
  32. rownumWidth: 25,
  33. autowidth:true,
  34. multiselect: true,
  35. pager: "#jqGridPager",
  36. jsonReader : {
  37. root: "page.list",
  38. page: "page.currPage",
  39. total: "page.totalPage",
  40. records: "page.totalCount"
  41. },
  42. prmNames : {
  43. page:"page",
  44. rows:"limit",
  45. order: "order"
  46. },
  47. gridComplete:function(){
  48. //隐藏grid底部滚动条
  49. $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
  50. }
  51. });
  52. /* 获取省市区 */
  53. $.ajax({
  54. type: "POST",
  55. url: baseURL + "/api/region/list",
  56. contentType: "application/json",
  57. success: function(r){
  58. if(r.code == 0){
  59. vm.location.city = r.data;
  60. }else{
  61. layer.alert("读取省失败");
  62. }
  63. }
  64. });
  65. upload(1,'images','images/*');
  66. });
  67. var vm = new Vue({
  68. el:'#rrapp',
  69. data:{
  70. showList: true,
  71. title: null,
  72. wjxyExpert: {
  73. goodLabels: ''
  74. },
  75. goodLabels: [],
  76. userObj: {},
  77. location: {
  78. province: {},
  79. city: {},
  80. area: {}
  81. },
  82. shopList: [],
  83. labelList: [],
  84. blank: true,
  85. queryParam: {
  86. name: null,
  87. phone:null
  88. }
  89. },
  90. methods: {
  91. query: function () {
  92. vm.reload(1);
  93. },
  94. init() {
  95. vm.queryParam.name = null
  96. vm.queryParam.phone = null
  97. },
  98. reset: function () {
  99. vm.init();
  100. vm.reload(1);
  101. },
  102. add: function(){
  103. vm.showList = false;
  104. vm.title = "新增";
  105. // vm.wjxyExpert = {};
  106. vm.wjxyExpert.memberId = '';
  107. vm.wjxyExpert.status = '';
  108. vm.wjxyExpert.expertPhoto = '';
  109. vm.wjxyExpert.province = 420000;
  110. vm.wjxyExpert.city = '';
  111. vm.wjxyExpert.area = '';
  112. vm.wjxyExpert.name = '';
  113. vm.wjxyExpert.phone = '';
  114. vm.wjxyExpert.jobTitle = '';
  115. vm.wjxyExpert.id = null
  116. clearImg();
  117. vm.userObj = {}
  118. vm.shopList = []
  119. vm.wjxyExpert.jobTitle = '';
  120. vm.location.area = {};
  121. vm.wjxyExpert.goodLabels = ''
  122. vm.goodLabels = []
  123. vm.wjxyExpert.storeIdList = []
  124. vm.wjxyExpert.isHomeRecommend = ''
  125. vm.wjxyExpert.expertReadme = ''
  126. vm.getLabel()
  127. },
  128. update: function (event) {
  129. var id = getSelectedRow();
  130. if(id == null){
  131. return ;
  132. }
  133. vm.showList = false;
  134. vm.blank = true
  135. vm.title = "修改";
  136. vm.getInfo(id)
  137. },
  138. city: function (event) {
  139. var d = event.target.value;
  140. vm.location.area = {};
  141. vm.wjxyExpert.area = '';
  142. // vm.location.city
  143. for (let i=0; i<=vm.location.city.length; i++) {
  144. if(d == vm.location.city[i].id) {
  145. return vm.location.area = vm.location.city[i].childRegionList
  146. }
  147. }
  148. },
  149. getVal:function(val) {
  150. if (val!= "") {
  151. console.log(val);
  152. vm.wjxyExpert.memberId = val
  153. vm.userInfo(val)
  154. }
  155. },
  156. getShop(val) {
  157. if (val!= "") {
  158. console.log(val);
  159. vm.wjxyExpert.storeIdList = val
  160. // var ids = val.join()bvvbbbvbvbv
  161. $.ajax({
  162. type: "POST",
  163. url: baseURL + 'wjxy/store/getByIdList',
  164. contentType: "application/json",
  165. data: JSON.stringify(val),
  166. success: function(r){
  167. if(r.code === 0){
  168. console.log(r)
  169. vm.shopList = r.list
  170. }else{
  171. layer.alert(r.msg);
  172. }
  173. }
  174. });
  175. console.log(val);
  176. // vm.wjxyExpert.memberId = val
  177. // vm.userInfo(val)
  178. }
  179. },
  180. getLabel() {
  181. $.ajax({
  182. type: "GET",
  183. url: baseURL + 'sys/bizlibrary/infoList/maven_label',
  184. contentType: "application/x-www-form-urlencoded",
  185. success: function(r){
  186. if(r.code === 0){
  187. console.log(r)
  188. vm.labelList = r.dictList
  189. // if(Array.isArray(vm.wjxyExpert.labelIdList)) {
  190. // vm.wjxyExpert.labelIdList = vm.wjxyExpert.labelIdList.join()
  191. // }
  192. // if(vm.wjxyExpert.goodLabels) {
  193. // vm.wjxyExpert.goodLabels = vm.wjxyExpert.goodLabels.split(',')
  194. // }
  195. }else{
  196. layer.alert(r.msg);
  197. }
  198. }
  199. });
  200. },
  201. // 关联用户
  202. checkUser() {
  203. var width = ($(window).width() * 0.6);
  204. var height = ($(window).height() -50);
  205. layui.use([ 'layer', 'form'],function() {
  206. var $ = layui.jquery, layer = layui.layer;
  207. layer.open({
  208. type: 2,
  209. area: [width + 'px', height + 'px'],
  210. fix: false, //不固定
  211. maxmin: true,
  212. shadeClose: true,
  213. resize:false,
  214. full:true,
  215. shade: 0.4,
  216. title: '选择用户',
  217. anim: 3,
  218. content: 'checkuser.html',
  219. end : function(){
  220. // vm.reload();
  221. // console.log(11)
  222. }
  223. });
  224. })
  225. },
  226. // 选择门店
  227. checkShop() {
  228. var width = ($(window).width() * 0.6);
  229. var height = ($(window).height() -50);
  230. layui.use([ 'layer', 'form'],function() {
  231. var $ = layui.jquery, layer = layui.layer;
  232. layer.open({
  233. type: 2,
  234. area: [width + 'px', height + 'px'],
  235. fix: false, //不固定
  236. maxmin: true,
  237. shadeClose: true,
  238. resize:false,
  239. full:true,
  240. shade: 0.4,
  241. title: '选择门店',
  242. anim: 3,
  243. content: 'checkShop.html',
  244. end : function(){
  245. // vm.reload();
  246. // console.log(11)
  247. }
  248. });
  249. })
  250. },
  251. saveOrUpdate: function (event) {
  252. /*图片*/
  253. if ($('#imgUrl1').val() != ''){
  254. vm.wjxyExpert.expertPhoto = $('#imgUrl1').val();
  255. }
  256. console.log(vm.labelList)
  257. console.log(vm.wjxyExpert.goodLabels)
  258. console.log(vm.goodLabels)
  259. if (vm.wjxyExpert.name == '') {
  260. layer.msg('[名称]不能为空',{icon:5})
  261. return false;
  262. }
  263. if (vm.wjxyExpert.phone == '') {
  264. layer.msg('[电话]不能为空',{icon:5});
  265. return false;
  266. }
  267. if (vm.wjxyExpert.jobTitle == '') {
  268. layer.msg('[职称]不能为空',{icon:5});
  269. return false;
  270. }
  271. if (vm.wjxyExpert.memberId == '') {
  272. layer.msg('[关联用户]不能为空',{icon:5});
  273. return false;
  274. }
  275. if (vm.wjxyExpert.status == '') {
  276. layer.msg('[状态]不能为空',{icon:5});
  277. return false;
  278. }
  279. if (vm.wjxyExpert.city == '') {
  280. layer.msg('[市级]不能为空',{icon:5});
  281. return false;
  282. }
  283. if (vm.wjxyExpert.area == '') {
  284. layer.msg('[区级]不能为空',{icon:5});
  285. return false;
  286. }
  287. if (vm.wjxyExpert.storeIdList.length == 0) {
  288. layer.msg('[支持门店]不能为空',{icon:5});
  289. return false;
  290. }
  291. if (vm.goodLabels.length == 0) {
  292. layer.msg('[擅长标签]不能为空',{icon:5});
  293. return false;
  294. }
  295. if (vm.wjxyExpert.expertReadme == '') {
  296. layer.msg('[行家自述]不能为空',{icon:5});
  297. return false;
  298. }
  299. console.log(vm.wjxyExpert.isHomeRecommend,'vm.wjxyExpert.isHomeRecommend')
  300. if (vm.wjxyExpert.isHomeRecommend === '') {
  301. layer.msg('[首页推荐]不能为空',{icon:5});
  302. return false;
  303. }
  304. if(Array.isArray(vm.goodLabels)) {
  305. vm.wjxyExpert.goodLabels = vm.goodLabels.join()
  306. }
  307. vm.wjxyExpert.province = 420000
  308. var url = vm.wjxyExpert.id == null ? "wjxy/expert/save" : "wjxy/expert/update";
  309. var type = vm.wjxyExpert.id == null ? "POST" : "PUT";
  310. $.ajax({
  311. type: type,
  312. url: baseURL + url,
  313. contentType: "application/json",
  314. data: JSON.stringify(vm.wjxyExpert),
  315. success: function(r){
  316. if(r.code === 0){
  317. layer.msg("操作成功", {icon: 1});
  318. vm.reload();
  319. $('#btnSaveOrUpdate').button('reset');
  320. $('#btnSaveOrUpdate').dequeue();
  321. }else{
  322. layer.alert(r.msg);
  323. // $('#btnSaveOrUpdate').button('reset');
  324. // $('#btnSaveOrUpdate').dequeue();
  325. }
  326. }
  327. });
  328. $('#btnSaveOrUpdate').button('loading').delay(1000).queue(function() {
  329. });
  330. },
  331. del: function (event) {
  332. var ids = getSelectedRows();
  333. if(ids == null){
  334. return ;
  335. }
  336. var lock = false;
  337. layer.confirm('确定要删除选中的记录?', {
  338. btn: ['确定','取消'] //按钮
  339. }, function(){
  340. if(!lock) {
  341. lock = true;
  342. $.ajax({
  343. type: "DELETE",
  344. url: baseURL + "wjxy/expert/delete",
  345. contentType: "application/json",
  346. data: JSON.stringify(ids),
  347. success: function(r){
  348. if(r.code == 0){
  349. layer.msg("操作成功", {icon: 1});
  350. $("#jqGrid").trigger("reloadGrid");
  351. }else{
  352. layer.alert(r.msg);
  353. }
  354. }
  355. });
  356. }
  357. }, function(){
  358. });
  359. },
  360. msgh() {
  361. var id = getSelectedRow();
  362. if(id == null){
  363. return ;
  364. }
  365. vm.blank = false;
  366. vm2.blank = true;
  367. vm2.workStu.expertId = id
  368. vm2.parent = id
  369. vm2.reload(1);
  370. console.log(vm2.workStu.expertId)
  371. },
  372. getInfo: function(id){
  373. $.get(baseURL + "wjxy/expert/info/"+id, function(r){
  374. vm.getLabel()
  375. vm.wjxyExpert = r.expert;
  376. console.log(vm.wjxyExpert.area)
  377. vm.wjxyExpert.province = 420000
  378. vm.shopList = vm.wjxyExpert.storeList
  379. vm.goodLabels = vm.wjxyExpert.goodLabels.split(',')
  380. console.log(vm.wjxyExpert.goodLabels)
  381. let ids = []
  382. for(let value of r.expert.storeList) {
  383. ids.push(value.id)
  384. }
  385. vm.wjxyExpert.storeIdList = ids
  386. /*图片*/
  387. if (vm.wjxyExpert.expertPhoto) {
  388. $('#demo1').show();
  389. $('#demo1').attr('src',vm.wjxyExpert.expertPhoto);
  390. }
  391. vm.userInfo(vm.wjxyExpert.memberId)
  392. vm.location.area = [];
  393. // vm.location.city
  394. for (let i=0; i<=vm.location.city.length; i++) {
  395. if(vm.wjxyExpert.city == vm.location.city[i].id) {
  396. return vm.location.area = vm.location.city[i].childRegionList
  397. }
  398. }
  399. // vm.city(vm.wjxyExpert.city)
  400. // vm.getShop()
  401. // console.log(vm.wjxyExpert.storeList)
  402. });
  403. },
  404. userInfo(id) {
  405. $.get(baseURL + "qmgj/memberinfo/info/"+id, function(r){
  406. // vm.wjxyExpert = r.wjxyExpert;
  407. console.log(r)
  408. vm.userObj = r.memberInfo
  409. });
  410. },
  411. reload: function (event) {
  412. vm.showList = true;
  413. var page;
  414. if (event == 1){
  415. page = 1;
  416. } else {
  417. page = $("#jqGrid").jqGrid('getGridParam','page');
  418. }
  419. // vm.queryParam.name = null
  420. // vm.queryParam.phone = null
  421. $("#jqGrid").jqGrid('setGridParam',{
  422. postData: {name: vm.queryParam.name, phone: vm.queryParam.phone},
  423. page:page
  424. }).trigger("reloadGrid");
  425. }
  426. }
  427. });
  428. /*------------------------------------*/
  429. $(function () {
  430. $("#jqGrid2").jqGrid({
  431. url: baseURL + 'wjxy/experttopic/page',
  432. postData: {expertId: vm2.parent},
  433. datatype: "json",
  434. colModel: [
  435. { label: 'id', name: 'id', index: 'id', width: 50, key: true, hidden: true },
  436. { label: '话题名称', name: 'topicName', width: 80, sortable:false },
  437. { label: '话题描述', name: 'topicDescribe', width: 80 , sortable:false },
  438. { label: '话题价格', name: 'topicPrice', width: 80, sortable:false },
  439. { label: '状态', name: 'status', width: 80, sortable:false,formatter: function(value, options, row){
  440. if(value == 1) {
  441. return '正常'
  442. }else {
  443. return '禁用'
  444. }
  445. } },
  446. { label: '创建时间', name: 'createTime', width: 80, sortable:false },
  447. // { label: '数据来源', name: 'fromTo', width: 80, sortable:false , formatter: function(value, options, row){
  448. // if (value == '1') {
  449. // return '小程序';
  450. // } else if (value == '0'){
  451. // return '手动输入';
  452. // } else {
  453. // return '来源不明';
  454. // }
  455. // }
  456. // }
  457. ],
  458. viewrecords: true,
  459. width: w,
  460. height: h,
  461. rowNum: 10,
  462. rowList : [10,30,50],
  463. rownumbers: true,
  464. rownumWidth: 25,
  465. autowidth:false,
  466. multiselect: true,
  467. pager: "#jqGridPager2",
  468. jsonReader : {
  469. root: "page.list",
  470. page: "page.currPage",
  471. total: "page.totalPage",
  472. records: "page.totalCount"
  473. },
  474. prmNames : {
  475. page:"page",
  476. rows:"limit",
  477. order: "order"
  478. },
  479. gridComplete:function(){
  480. //隐藏grid底部滚动条
  481. $("#jqGrid2").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
  482. },
  483. loadComplete:function(data){
  484. vm2.jpgrid = data.page.list;
  485. }
  486. });
  487. $.ajax({
  488. type: "POST",
  489. url: baseURL + "sys/bizlibrary/infoList/workStuEnroll",
  490. contentType: "application/json",
  491. success: function(r){
  492. if(r.code == 0){
  493. vm2.dict.workStuEnroll = r.dictList;
  494. }else{
  495. layer.alert("读取字典项失败");
  496. }
  497. }
  498. });
  499. $.ajax({
  500. type: "POST",
  501. url: baseURL + "sys/bizlibrary/infoList/workStuNotice",
  502. contentType: "application/json",
  503. success: function(r){
  504. if(r.code == 0){
  505. vm2.dict.workStuNotice = r.dictList;
  506. }else{
  507. layer.alert("读取字典项失败");
  508. }
  509. }
  510. });
  511. $.ajax({
  512. type: "POST",
  513. url: baseURL + "sys/bizlibrary/infoList/workStuSignUp",
  514. contentType: "application/json",
  515. success: function(r){
  516. if(r.code == 0){
  517. vm2.dict.workStuSignUp = r.dictList;
  518. }else{
  519. layer.alert("读取字典项失败");
  520. }
  521. }
  522. });
  523. $.ajax({
  524. type: "POST",
  525. url: baseURL + "sys/bizlibrary/infoList/workStuPay",
  526. contentType: "application/json",
  527. success: function(r){
  528. if(r.code == 0){
  529. vm2.dict.workStuPay = r.dictList;
  530. }else{
  531. layer.alert("读取字典项失败");
  532. }
  533. }
  534. });
  535. $.ajax({
  536. type: "POST",
  537. url: baseURL + "sys/bizlibrary/infoList/gender",
  538. contentType: "application/json",
  539. success: function(r){
  540. if(r.code == 0){
  541. vm2.dict.gender = r.dictList;
  542. }else{
  543. layer.alert("读取字典项失败");
  544. }
  545. }
  546. });
  547. });
  548. var vm2 = new Vue({
  549. el:'#rrapp2',
  550. data:{
  551. jpgrid: {},
  552. blank: false,
  553. showList: true,
  554. title: null,
  555. workStu: {
  556. topicPrice: '',
  557. status: ''
  558. },
  559. showInfo: false,
  560. parent: null,
  561. dict:{
  562. workStuEnroll: null,
  563. workStuNotice: null,
  564. workStuSignUp: null,
  565. workStuPay: null,
  566. gender: null
  567. },
  568. queryParam: {
  569. topicName: null
  570. }
  571. },
  572. methods: {
  573. init: function () {
  574. vm2.queryParam.topicName = null;
  575. },
  576. query: function () {
  577. vm2.reload(1);
  578. },
  579. reset: function () {
  580. vm2.init();
  581. vm2.reload(1);
  582. },
  583. add: function(){
  584. vm2.showList = false;
  585. vm2.title = "新增";
  586. vm2.showInfo = false;
  587. vm2.workStu.topicPrice = '';
  588. vm2.workStu.id = null;
  589. vm2.workStu.status = '';
  590. vm2.workStu.topicName = '';
  591. vm2.workStu.topicDescribe = '';
  592. },
  593. update: function (event) {
  594. var id = getSelectedRowMore(2);
  595. if(id == null){
  596. return ;
  597. }
  598. vm2.showList = false;
  599. vm2.title = "编辑";
  600. vm2.showInfo = false;
  601. vm2.getInfo(id)
  602. },
  603. saveOrUpdate: function (event) {
  604. },
  605. del: function (event) {
  606. var ids = getSelectedRowsMore(2);
  607. if(ids == null){
  608. return ;
  609. }
  610. var lock = false;
  611. layer.confirm('确定要删除选中的记录?', {
  612. btn: ['确定','取消'] //按钮
  613. }, function(){
  614. if(!lock) {
  615. lock = true;
  616. $.ajax({
  617. type: "DELETE",
  618. url: baseURL + "wjxy/experttopic/delete",
  619. contentType: "application/json",
  620. data: JSON.stringify(ids),
  621. success: function(r){
  622. if(r.code == 0){
  623. layer.msg("操作成功", {icon: 1});
  624. vm2.reload(1);
  625. }else{
  626. layer.alert(r.msg);
  627. }
  628. }
  629. });
  630. }
  631. }, function(){
  632. });
  633. },
  634. getInfo: function(id){
  635. $.get(baseURL + "wjxy/experttopic/info/"+id, function(r){
  636. vm2.workStu = r.expertTopic;
  637. });
  638. },
  639. reload: function (event) {
  640. vm2.showInfo = false;
  641. vm2.workStu.sex = '';
  642. vm2.workStu.status = '';
  643. vm2.workStu.notifyStatus = '';
  644. vm2.workStu.signStatus = '';
  645. vm2.workStu.cashStatus = '';
  646. vm2.showList = true;
  647. var page;
  648. if (event == 1){
  649. page = 1;
  650. } else {
  651. page = $("#jqGrid2").jqGrid('getGridParam','page');
  652. }
  653. $("#jqGrid2").jqGrid('setGridParam',{
  654. postData: {expertId: vm2.parent, topicName: vm2.queryParam.topicName},
  655. page:page
  656. }).trigger("reloadGrid");
  657. },
  658. reloadFirst: function (event) {
  659. var page = 1;
  660. vm2.init();
  661. $("#jqGrid2").jqGrid('setGridParam',{
  662. postData:{pid: vm2.parent, queryParam: vm2.queryParam.input},
  663. page:page,
  664. gridComplete:function(){
  665. //隐藏grid底部滚动条
  666. $("#jqGrid2").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
  667. //刷新
  668. vm.blank = false;
  669. vm2.blank = true;
  670. vm2.showList = true;
  671. vm2.showInfo = false;
  672. }
  673. }).trigger("reloadGrid");
  674. },
  675. back: function (event) {
  676. vm.reload();
  677. vm.blank = true;
  678. vm.showList = true;
  679. vm2.blank = false;
  680. },
  681. flow: function () {
  682. var id = getSelectedRowMore(2);
  683. if(id == null){
  684. return ;
  685. }
  686. var width = ($(window).width() * 0.8);
  687. var height = ($(window).height() * 0.8);
  688. layui.use([ 'layer', 'form'],function() {
  689. var $ = layui.jquery, layer = layui.layer;
  690. layer.open({
  691. type: 2,
  692. area: [width + 'px', height + 'px'],
  693. fix: false, //不固定
  694. maxmin: true,
  695. shadeClose: true,
  696. resize:false,
  697. full:true,
  698. shade: 0.4,
  699. title: '兼职流程信息',
  700. anim: 3,
  701. content: 'workstu_flow.html?id='+id,
  702. end : function(){
  703. vm2.reload();
  704. }
  705. });
  706. })
  707. },
  708. sign: function () {
  709. var id = getSelectedRowMore(2);
  710. if(id == null){
  711. return ;
  712. }
  713. var width = ($(window).width() * 0.8);
  714. var height = ($(window).height() * 0.8);
  715. layui.use([ 'layer', 'form'],function() {
  716. var $ = layui.jquery, layer = layui.layer;
  717. layer.open({
  718. type: 2,
  719. area: [width + 'px', height + 'px'],
  720. fix: false, //不固定
  721. maxmin: true,
  722. shadeClose: true,
  723. resize:false,
  724. full:true,
  725. shade: 0.4,
  726. title: '签到信息明细',
  727. anim: 3,
  728. content: 'worksign.html?id='+id
  729. });
  730. })
  731. },
  732. bill: function () {
  733. var id = getSelectedRowMore(2);
  734. if(id == null){
  735. return ;
  736. }
  737. var width = ($(window).width() * 0.8);
  738. var height = ($(window).height() * 0.8);
  739. layui.use([ 'layer', 'form'],function() {
  740. var $ = layui.jquery, layer = layui.layer;
  741. layer.open({
  742. type: 2,
  743. area: [width + 'px', height + 'px'],
  744. fix: false, //不固定
  745. maxmin: true,
  746. shadeClose: true,
  747. resize:false,
  748. full:true,
  749. shade: 0.4,
  750. title: '工资发放明细',
  751. anim: 3,
  752. content: 'workstu_bill.html?id='+id
  753. });
  754. })
  755. },
  756. exp: function () {
  757. window.location.href = baseURL + "qmgj/workstu/export/"+vm2.parent;
  758. },
  759. qrcode: function () {
  760. window.location.href = baseURL + "qmgj/workstu/qrcode/"+vm2.parent;
  761. },
  762. topicSubmit() {
  763. if (vm2.workStu.topicPrice == '') {
  764. layer.msg('[话题价格]不能为空',{icon:5});
  765. return false;
  766. }
  767. if (vm2.workStu.status == '') {
  768. layer.msg('[状态]不能为空',{icon:5});
  769. return false;
  770. }
  771. var url = vm2.workStu.id == null ? "wjxy/experttopic/save" : "wjxy/experttopic/update";
  772. var type = vm2.workStu.id == null ? "POST" : "PUT";
  773. $.ajax({
  774. type: type,
  775. url: baseURL + url,
  776. contentType: "application/json",
  777. data: JSON.stringify(vm2.workStu),
  778. success: function(r){
  779. if(r.code === 0){
  780. layer.msg("操作成功", {icon: 1});
  781. vm2.reload();
  782. }else{
  783. layer.alert(r.msg);
  784. }
  785. }
  786. });
  787. }
  788. }
  789. });
  790. // layui.use([ 'layer', 'form'],function() {
  791. // var $ = layui.jquery, layer = layui.layer, form = layui.form;
  792. // if (vm2.workStu.topicPrice == '') {
  793. // layer.msg('[话题价格]不能为空',{icon:5});
  794. // return false;
  795. // }
  796. // if (vm2.workStu.status == '') {
  797. // layer.msg('[状态]不能为空',{icon:5});
  798. // return false;
  799. // }
  800. // console.log(vm2.workStu.topicPrice,'111')
  801. // console.log(vm2.workStu.status,'222')
  802. // form.on('submit(go2)', function(data){
  803. // console.log(vm2.workStu.expertId)
  804. // var url = vm2.workStu.id == null ? "wjxy/experttopic/save" : "wjxy/experttopic/update";
  805. // var type = vm2.workStu.id == null ? "POST" : "PUT";
  806. // $.ajax({
  807. // type: type,
  808. // url: baseURL + url,
  809. // contentType: "application/json",
  810. // data: JSON.stringify(vm2.workStu),
  811. // success: function(r){
  812. // if(r.code === 0){
  813. // layer.msg("操作成功", {icon: 1});
  814. // vm2.reload();
  815. // }else{
  816. // layer.alert(r.msg);
  817. // }
  818. // }
  819. // });
  820. // return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
  821. // });
  822. // })