supplyform.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <view>
  3. <view class="solids-bottom margin-bottom-sm">
  4. <view class="bg-white padding">
  5. <view class="text-gray text-sm padding-top">
  6. 请填写真是有效的信息,如有发现诈骗、虚假信息,我们会协助公安与相关法律部门进行调查。
  7. </view>
  8. </view>
  9. </view>
  10. <form>
  11. <view class="echo-formmain" v-if="stepsnum==0">
  12. <view class="cu-form-group">
  13. <view class="title"> <text class="text-red text-bold padding-right-xs">*</text> 现有男性</view>
  14. <input type="number" placeholder="请输入" data-field="mnumber" name="mnumber" :value="supplyinfo.mnumber" @input="setInput"></input>
  15. <view>人</view>
  16. </view>
  17. <view class="cu-form-group">
  18. <view class="title"> <text class="text-red text-bold padding-right-xs">*</text> 现有女性</view>
  19. <input type="number" placeholder="请输入" data-field="wnumber" name="wnumber" :value="supplyinfo.wnumber" @input="setInput"></input>
  20. <view>人</view>
  21. </view>
  22. <view class="cu-form-group">
  23. <view class="title"> <text class="text-red text-bold padding-right-xs">*</text> 年龄范围</view>
  24. <input placeholder="比如:16-35岁" data-field="agegroup" name="agegroup" :value="supplyinfo.agegroup" @input="setInput"></input>
  25. </view>
  26. <view class="cu-form-group">
  27. <view class="title"> <text class="text-red text-bold padding-right-xs">*</text> 人员所在地</view>
  28. <view style="flex: 1; font-size: 30rpx; color: #AAAAAA; line-height: 100rpx;">
  29. <pickerAddress @change="regionChange">{{region}}</pickerAddress>
  30. </view>
  31. </view>
  32. <view class="cu-form-group">
  33. <view class="title"> <text class="text-red text-bold padding-right-xs">*</text> 期望工作地</view>
  34. <input placeholder="请选择期望工作地" data-field="descity" data-modalname="descityModal" name="descity" :value="supplyinfo.descity" @tap="showModal" disabled="true"></input>
  35. </view>
  36. <view class="cu-form-group">
  37. <view class="title"> <text class="text-red text-bold padding-right-xs">*</text> 可到岗日期</view>
  38. <picker mode="date" :value="supplyinfo.candate" @change="bindDateChange">
  39. <view class="picker">{{supplyinfo.candate!='' ? supplyinfo.candate : "请选择可到岗日期"}}</view>
  40. </picker>
  41. </view>
  42. <view class="cu-form-group margin-top-sm">
  43. <view class="title">咨询电话</view>
  44. <input placeholder="请输入联系人电话" data-field="telephone" name="telephone" :value="supplyinfo.telephone" @input="setInput"></input>
  45. </view>
  46. <view class="cu-form-group align-start">
  47. <view class="title">情况说明</view>
  48. <view class="textareabox">
  49. <textarea maxlength="-1" placeholder="请输入..." data-field="remark" name="remark" :value="supplyinfo.remark"
  50. @input="setInput"></textarea>
  51. </view>
  52. </view>
  53. <view class="padding flex flex-direction bg-white">
  54. <button class="cu-btn bg-themeBtn margin-tb-sm lg" @tap="editSupply">立即提交</button>
  55. <view class="padding"></view>
  56. </view>
  57. </view>
  58. </form>
  59. <view class="echo-formmain padding bg-white" v-if="stepsnum==1">
  60. <view class="padding">
  61. <view class="flex-sub text-center padding-tb">
  62. <view class="solid-bottom text-xsl padding">
  63. <text class="cuIcon-emoji text-green"></text>
  64. </view>
  65. <view class="text-xl padding-tb">
  66. <text class="text-black text-bold">供人信息提交成功,请耐心等待审核!</text>
  67. </view>
  68. <view class="flex flex-direction padding-tb">
  69. <navigator class="cu-btn bg-themeBtn margin-tb-sm lg" open-type="redirect" url="/pages/supply/wsupplylist?status=1">我发布的供人</navigator>
  70. <navigator class="cu-btn lg" open-type="redirect" url="/pages/supply/supplyform">继续发布</navigator>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="cu-modal bottom-modal" :class="modalName=='descityModal'?'show':''" @tap="hideModal">
  76. <view class="cu-dialog" @tap.stop="">
  77. <view class="cu-bar bg-white">
  78. <view class="action text-blue" @tap="hideModal">取消</view>
  79. <view class="action text-green" @tap="hideModal">确定</view>
  80. </view>
  81. <view class="grid col-3 padding-sm">
  82. <view v-for="(item,index) in descitylist" class="padding-xs" :key="index">
  83. <button class="cu-btn orange block text-sm" style="padding: 0rpx !important;" :class="supplyinfo.descity.indexOf(item) > -1?'bg-orange':'line-orange'" :data-value="item" @tap="setDescity"> {{item}}</button>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </template>
  90. <script>
  91. var _this;
  92. import avatar from "@/components/yq-avatar/yq-avatar.vue";
  93. import pickerAddress from "@/components/pickerAddress/pickerAddress.vue";
  94. export default {
  95. components: {
  96. avatar,
  97. pickerAddress
  98. },
  99. data() {
  100. return {
  101. isRotate: false,
  102. stepsnum: 0,
  103. userinfo: false,
  104. workerinfo: false,
  105. supplyinfo: {
  106. id: 0,
  107. workerid: 0,
  108. mnumber: "",
  109. wnumber: "",
  110. agegroup: "",
  111. province: "",
  112. city: "",
  113. district: "",
  114. descity: "",
  115. candate: "",
  116. telephone: "",
  117. remark: ""
  118. },
  119. region: "请选择人员所在地",
  120. modalName: null,
  121. descitylist: ["全国", "北京市", "天津市", "河北省", "山西省", "内蒙古自治区", "辽宁省", "吉林省", "黑龙江省", "上海市", "江苏省", "浙江省", "安徽省", "福建省", "江西省", "山东省", "河南省", "湖北省", "湖南省", "广东省", "广西壮族自治区", "海南省", "重庆市", "四川省", "贵州省", "云南省", "西藏自治区", "陕西省", "甘肃省", "青海省", "宁夏回族自治区", "新疆维吾尔自治区", "台湾省", "香港特别行政区", "澳门特别行政区"]
  122. }
  123. },
  124. onLoad: function(option) {
  125. _this = this;
  126. var supplyid = option.supplyid || 0;
  127. _this.userinfo = _this.checkLogin("/pages/my/my");
  128. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  129. if (_this.userinfo === false || _this.workerinfo === false) {
  130. uni.reLaunch({
  131. url: "/pages/my/my"
  132. });
  133. return false;
  134. }
  135. _this.$req.ajax({
  136. path: "wsupply/getsupply",
  137. data: {
  138. supplyid: supplyid,
  139. userid: _this.userinfo.id,
  140. workerid: _this.workerinfo.id
  141. }
  142. }).then((data) => {
  143. _this.catelist = data.catelist;
  144. if (data.supply != "NULL") {
  145. _this.supplyinfo = data.supply;
  146. _this.region = _this.supplyinfo.province + " " + _this.supplyinfo.city + " " + _this.supplyinfo.district;
  147. }
  148. }).catch((err) => {
  149. uni.showModal({
  150. title: '信息提示',
  151. content: err,
  152. showCancel: false
  153. });
  154. });
  155. },
  156. methods: {
  157. // 填写字段
  158. setInput: function(e) {
  159. var field = e.currentTarget.dataset.field;
  160. _this.supplyinfo[field] = e.detail.value;
  161. },
  162. bindDateChange: function(e) {
  163. _this.supplyinfo.candate = e.target.value;
  164. },
  165. regionChange: function(data) {
  166. console.log("data: " + JSON.stringify(data));
  167. _this.supplyinfo.province = data.data[0];
  168. _this.supplyinfo.city = data.data[1];
  169. _this.supplyinfo.district = data.data[2];
  170. _this.region = data.data.join(' ');
  171. },
  172. showModal: function(e) {
  173. _this.modalName = e.currentTarget.dataset.modalname;
  174. },
  175. hideModal: function(e) {
  176. _this.modalName = null
  177. },
  178. setDescity: function(e) {
  179. var value = e.currentTarget.dataset.value;
  180. if(_this.supplyinfo.descity.indexOf(value) > -1){
  181. _this.supplyinfo.descity = _this.supplyinfo.descity.replace(value+",","");
  182. _this.supplyinfo.descity = _this.supplyinfo.descity.replace(value,"");
  183. }else{
  184. _this.supplyinfo.descity = _this.supplyinfo.descity + "," + value;
  185. }
  186. if (value=="全国"){
  187. _this.supplyinfo.descity = "全国";
  188. }else{
  189. _this.supplyinfo.descity = _this.supplyinfo.descity.replace("全国,","");
  190. _this.supplyinfo.descity = _this.supplyinfo.descity.replace("全国","");
  191. }
  192. },
  193. // 提交信息
  194. editSupply: function() {
  195. if (_this.isRotate) {
  196. return false;
  197. }
  198. _this.isRotate = true;
  199. _this.$req.ajax({
  200. path: "wsupply/editsupply",
  201. title: "正在提交信息",
  202. data: {
  203. userid: _this.userinfo.id,
  204. id: _this.supplyinfo.id,
  205. workerid: _this.workerinfo.id,
  206. wnumber: _this.supplyinfo.wnumber,
  207. agegroup: _this.supplyinfo.agegroup,
  208. province: _this.supplyinfo.province,
  209. city: _this.supplyinfo.city,
  210. district: _this.supplyinfo.district,
  211. descity: _this.supplyinfo.descity,
  212. agegroup: _this.supplyinfo.agegroup,
  213. candate: _this.supplyinfo.candate,
  214. telephone: _this.supplyinfo.telephone,
  215. remark: _this.supplyinfo.remark
  216. }
  217. }).then((data) => {
  218. _this.stepsNum(1);
  219. _this.isRotate = false;
  220. }).catch((err) => {
  221. uni.showModal({
  222. title: '信息提示',
  223. content: err,
  224. showCancel: false
  225. });
  226. _this.isRotate = false;
  227. });
  228. },
  229. stepsNum: function(num) {
  230. _this.stepsnum = num;
  231. }
  232. }
  233. }
  234. </script>
  235. <style>
  236. .echo-formmain {
  237. min-height: calc(100vh - 290rpx);
  238. background-color: #FFFFFF;
  239. padding-left: 30rpx;
  240. padding-right: 30rpx;
  241. }
  242. .cu-form-group{ display: flex; flex-wrap: wrap; padding: 40rpx 10rpx 0rpx 10rpx; }
  243. .cu-form-group .title{ width: 100%; }
  244. .cu-form-group>input{ display: block; width: 670rpx; height: 100rpx; color: #AAAAAA; }
  245. .cu-form-group>radio-group{ width: 670rpx; height: 100rpx; line-height: 100rpx; color: #AAAAAA; text-align: left; }
  246. .cu-form-group .textareabox{ width: 670rpx; }
  247. .cu-form-group .textareabox textarea{ width: 670rpx; margin-top: 20rpx !important; margin-bottom: 0rpx; }
  248. .cu-form-group .placeholder{ color: #AAAAAA; }
  249. .cu-form-group picker .picker{ text-align: left; color: #AAAAAA; }
  250. .fieldpic {
  251. width: 150rpx;
  252. height: 150rpx;
  253. }
  254. .fieldpictil {
  255. width: 230rpx;
  256. text-align: center;
  257. }
  258. </style>