synoutjobs.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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">
  12. <view class="cu-form-group">
  13. <view class="title"> <text class="text-red text-bold padding-right-xs">*</text> 订单标题</view>
  14. <input placeholder="请输入" data-field="title" name="title" :value="form.title" @input="setInput"></input>
  15. </view>
  16. <view class="cu-form-group">
  17. <view class="title"> <text class="text-red text-bold padding-right-xs">*</text> 公司名</view>
  18. <input placeholder="请输入" data-field="company_name" name="company_name" :value="form.company_name" @input="setInput"></input>
  19. </view>
  20. <view class="cu-form-group">
  21. <view class="title"> <text class="text-red text-bold padding-right-xs">*</text> 招聘人数</view>
  22. <input type="number" placeholder="请输入" data-field="num" name="num" :value="form.num" @input="setInput"></input>
  23. <view>人</view>
  24. </view>
  25. <view class="cu-form-group">
  26. <view class="title"> <text class="text-red text-bold padding-right-xs">*</text> 省市区</view>
  27. <picker mode="region" @change="RegionChange">
  28. <view class="picker">
  29. {{form.province}},{{form.city}},{{form.district}}
  30. </view>
  31. </picker>
  32. </view>
  33. <view class="cu-form-group">
  34. <view class="title"> <text class="text-red text-bold padding-right-xs">*</text> 地址</view>
  35. <input placeholder="请输入" data-field="address" name="address" :value="form.address" @input="setInput"></input>
  36. </view>
  37. <view class="cu-form-group">
  38. <view class="title"> <text class="text-red text-bold padding-right-xs">*</text> 招工年龄</view>
  39. <input placeholder="例如:18岁到50岁" data-field="agegroup" name="agegroup" :value="form.agegroup" @input="setInput"></input>
  40. </view>
  41. <view class="cu-form-group">
  42. <view class="title"> <text class="text-red text-bold padding-right-xs">*</text> 咨询电话</view>
  43. <input placeholder="请输入" data-field="telephone" name="telephone" :value="form.telephone" @input="setInput"></input>
  44. </view>
  45. <view class="cu-form-group">
  46. <view class="title">招聘标签</view>
  47. <input placeholder="空格分隔。例如:包吃住 包住宿" data-field="tags" name="tags" :value="form.tags" @input="setInput"></input>
  48. </view>
  49. <view class="cu-form-group">
  50. <view class="title">工资</view>
  51. <input placeholder="5000/月" data-field="salary" name="salary" :value="form.salary" @input="setInput"></input>
  52. </view>
  53. <view class="cu-form-group">
  54. <view class="title">岗位要求</view>
  55. <view class="textareabox">
  56. <textarea maxlength="-1" placeholder-class="placeholder" placeholder="请输入..." data-field="requirement" name="requirement" :value="form.requirement"
  57. @input="setInput"></textarea>
  58. </view>
  59. </view>
  60. <view class="cu-form-group">
  61. <view class="title">企业简介</view>
  62. <view class="textareabox">
  63. <textarea maxlength="-1" placeholder-class="placeholder" placeholder="请输入..." data-field="comdetails" name="comdetails" :value="form.comdetails"
  64. @input="setInput"></textarea>
  65. </view>
  66. </view>
  67. <view class="cu-form-group">
  68. <view class="title">补充说明</view>
  69. <view class="textareabox">
  70. <textarea maxlength="-1" placeholder-class="placeholder" placeholder="请输入..." data-field="remark" name="remark" :value="form.remark"
  71. @input="setInput"></textarea>
  72. </view>
  73. </view>
  74. <view class="padding-tb padding-lr-xs bg-white solids-top">
  75. <view class="title padding-bottom-sm text-lg">环境照片</view>
  76. <view class="grid col-4 grid-square flex-sub">
  77. <block v-for="(picitem,picindex) in form.picall" :key="picindex">
  78. <view class="bg-img" @tap="viewImage" :data-url="picitem">
  79. <image :src="picitem" mode="aspectFill"></image>
  80. <view class="cu-tag bg-red" @tap.stop="delImg" :data-index="index">
  81. <text class='cuIcon-close'></text>
  82. </view>
  83. </view>
  84. </block>
  85. <view class="solids" @tap="chooseImage" v-if="form.picall.length <= 12">
  86. <text class='cuIcon-cameraadd'></text>
  87. </view>
  88. </view>
  89. </view>
  90. <view class="padding flex flex-direction bg-white">
  91. <button class="cu-btn bg-blue margin-tb-sm lg" @tap="getMarket">获取市场行情</button>
  92. </view>
  93. <view class="cu-form-group">
  94. <view class="title" style="min-width: calc(10em + 15px);"> <text class="text-red text-bold padding-right-xs">*</text> 可否议价</view>
  95. <radio-group class="block" @change="isBargainChange">
  96. <view class="flex justify-start">
  97. <label class="flex align-center"> <radio class='red' :class="form.is_bargain==1?'checked':''" :checked="form.is_bargain==1?true:false" value="1"></radio> <text> 是</text></label>
  98. <label class="flex align-center"> <radio class='red' :class="form.is_bargain==2?'checked':''" :checked="form.is_bargain==2?true:false" value="2"></radio> <text> 否</text></label>
  99. </view>
  100. </radio-group>
  101. </view>
  102. <view class="cu-form-group">
  103. <view class="title">行情内容</view>
  104. <view class="textareabox">
  105. <textarea maxlength="-1" placeholder-class="placeholder" placeholder="例如:一次性交通补贴:1000元;入职前3个月,每个月600元。" data-field="market_content" name="market_content" :value="form.market_content"
  106. @input="setInput"></textarea>
  107. </view>
  108. </view>
  109. <view class="padding flex flex-direction bg-white">
  110. <button class="cu-btn bg-themeBtn margin-tb-sm lg" @tap="editRecruit">立即提交</button>
  111. <view class="padding"></view>
  112. </view>
  113. </view>
  114. </form>
  115. <view class="cu-modal bottom-modal" :class="modalName=='marketModal'?'show':''">
  116. <view class="cu-dialog">
  117. <view class="cu-bar bg-white">
  118. <view class="action text-blue" @tap="hideModal">关闭</view>
  119. </view>
  120. <view class="padding-xl">
  121. <block v-for="(item,index) in market" :key="index">
  122. <view class="cu-card dynamic no-card solid-bottom echo-comjobs-item margin-tb-sm">
  123. <view class="cu-item shadow padding-top-sm padding-bottom">
  124. <view class="padding-lr padding-bottom-xs flex justify-between align-left">
  125. <view class="basis-xl text-bold text-lg text-cut">
  126. {{item.name}}
  127. <text class="text-red margin-left">{{item.mobile}}</text>
  128. </view>
  129. <view class="basis-xs text-cut text-right text-gray text-sm">{{item.is_bargain == 1 ? '可议价' : '不可议价'}}</view>
  130. </view>
  131. <view class="padding-lr flex justify-between align-bottom">
  132. <view><text class="text-red text-bold">{{item.content}}</text></view>
  133. </view>
  134. <view class="grid solids-top text-center col-2">
  135. <view @tap="selectMarket" :data-index="index" class="padding-top"><text class="cuIcon-write padding-right-xs"></text> 选择 </view>
  136. <view @tap="callMobile" :data-mobile="item.mobile" class="text-red padding-top"><text class="cuIcon-pulldown padding-right-xs"></text> 拔打电话 </view>
  137. </view>
  138. </view>
  139. </view>
  140. </block>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. </template>
  146. <script>
  147. var _this;
  148. import avatar from "@/components/yq-avatar/yq-avatar.vue";
  149. import pickerAddress from "@/components/pickerAddress/pickerAddress.vue";
  150. export default {
  151. components: {
  152. avatar,
  153. pickerAddress
  154. },
  155. data() {
  156. return {
  157. isRotate: false,
  158. userinfo: false,
  159. workerinfo: false,
  160. form: {
  161. id: 0,
  162. worker_id: 0,
  163. title: "",
  164. company_name: "",
  165. num: 1,
  166. province: "福建省",
  167. city: "泉州市",
  168. district: "晋江市",
  169. address: "",
  170. agegroup: "",
  171. tags: "",
  172. requirement: "",
  173. comdetails: "",
  174. picall: [],
  175. salary: "",
  176. telephone: "",
  177. remark: "",
  178. market_content: "",
  179. is_bargain: 1,
  180. },
  181. modalName: null,
  182. market: [],
  183. }
  184. },
  185. onLoad: function(option) {
  186. _this = this;
  187. _this.userinfo = _this.checkLogin("/pages/my/my");
  188. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  189. if (_this.userinfo === false || _this.workerinfo === false) {
  190. uni.reLaunch({
  191. url: "/pages/my/my"
  192. });
  193. return false;
  194. }
  195. var id = option.id || 0;
  196. _this.$req.ajax({
  197. path: "wcomjobs/getComjobs",
  198. data: {
  199. comjobsid: id,
  200. workerid: _this.workerinfo.id,
  201. }
  202. }).then((data) => {
  203. _this.form = {
  204. worker_id: _this.workerinfo.id,
  205. title: data.comjobs.title,
  206. company_name: data.comjobs.worker.title,
  207. num: data.comjobs.num,
  208. province: data.comjobs.province,
  209. city: data.comjobs.city,
  210. district: data.comjobs.district,
  211. address: data.comjobs.address,
  212. agegroup: data.comjobs.agegroup,
  213. tags: data.comjobs.tags.replace(',',' '),
  214. requirement: data.comjobs.requirement,
  215. comdetails: data.comjobs.comdetails,
  216. picall: data.comjobs.picall,
  217. salary: data.comjobs.zwagall,
  218. telephone: data.comjobs.telephone,
  219. remark: data.comjobs.remark,
  220. market_content: "",
  221. is_bargain: 1,
  222. };
  223. console.log(data);
  224. }).catch((err) => {
  225. uni.showModal({
  226. title: '信息提示',
  227. content: err,
  228. showCancel: false
  229. });
  230. });
  231. },
  232. methods: {
  233. // 填写字段
  234. setInput: function(e) {
  235. var field = e.currentTarget.dataset.field;
  236. _this.form[field] = e.detail.value;
  237. },
  238. bindDateChange: function(e) {
  239. _this.form.candate = e.target.value;
  240. },
  241. showModal: function(e) {
  242. _this.modalName = e.currentTarget.dataset.modalname;
  243. },
  244. hideModal: function(e) {
  245. _this.modalName = null
  246. },
  247. RegionChange(e) {
  248. this.form.province = e.detail.value[0];
  249. this.form.city = e.detail.value[1];
  250. this.form.district = e.detail.value[2];
  251. },
  252. isBargainChange(e) {
  253. _this.form.is_bargain = e.detail.value;
  254. },
  255. getMarket() {
  256. _this.$req.ajax({
  257. path: "woutjobs/getmarket",
  258. data: {}
  259. }).then((data) => {
  260. _this.market = data.list;
  261. _this.modalName = 'marketModal';
  262. }).catch((err) => {
  263. uni.showModal({
  264. title: '信息提示',
  265. content: err,
  266. showCancel: false
  267. });
  268. });
  269. },
  270. callMobile(e) {
  271. let mobile = e.currentTarget.dataset.mobile;
  272. uni.makePhoneCall({phoneNumber: mobile});
  273. },
  274. selectMarket(e) {
  275. let index = e.currentTarget.dataset.index;
  276. let market = this.market[index];
  277. this.form.is_bargain = market.is_bargain;
  278. this.form.market_content = market.content;
  279. this.modalName = null
  280. },
  281. // 提交信息
  282. editRecruit: function() {
  283. if (_this.isRotate) {
  284. return false;
  285. }
  286. _this.isRotate = true;
  287. _this.$req.ajax({
  288. path: "woutjobs/editrecruit",
  289. title: "正在提交信息",
  290. data: _this.form,
  291. }).then((data) => {
  292. _this.isRotate = false;
  293. uni.redirectTo({
  294. url: '/pages/worker/worker'
  295. });
  296. }).catch((err) => {
  297. uni.showModal({
  298. title: '信息提示',
  299. content: err,
  300. showCancel: false
  301. });
  302. _this.isRotate = false;
  303. });
  304. },
  305. // 图片上传
  306. chooseImage: function(e) {
  307. uni.chooseImage({
  308. count: 12,
  309. sizeType: ['original', 'compressed'],
  310. sourceType: ['album'],
  311. success: (res) => {
  312. _this.$req.ajaxFile({
  313. path: "attachment/tplfieldimage",
  314. title: '正在上传',
  315. filePath: res.tempFilePaths[0],
  316. fileName: 'file',
  317. }).then((filedata) => {
  318. var data = JSON.parse(filedata.data);
  319. _this.form.picall.push(data.data.src);
  320. }).catch((err) => {
  321. uni.showModal({
  322. title: '信息提示',
  323. content: err,
  324. showCancel: false
  325. });
  326. });
  327. }
  328. });
  329. },
  330. }
  331. }
  332. </script>
  333. <style>
  334. .echo-formmain {
  335. min-height: calc(100vh - 290rpx);
  336. background-color: #FFFFFF;
  337. padding-left: 30rpx;
  338. padding-right: 30rpx;
  339. }
  340. .cu-form-group{ display: flex; flex-wrap: wrap; padding: 40rpx 10rpx 0rpx 10rpx; }
  341. .cu-form-group .title{ width: 100%; }
  342. .cu-form-group>input{ display: block; width: 670rpx; height: 100rpx; color: #AAAAAA; }
  343. .cu-form-group>radio-group{ width: 670rpx; height: 100rpx; line-height: 100rpx; color: #AAAAAA; text-align: left; }
  344. .cu-form-group .textareabox{ width: 670rpx; }
  345. .cu-form-group .textareabox textarea{ width: 670rpx; margin-top: 20rpx !important; margin-bottom: 0rpx; }
  346. .cu-form-group .placeholder{ color: #AAAAAA; }
  347. .cu-form-group picker .picker{ text-align: left; color: #AAAAAA; }
  348. .fieldpic {
  349. width: 150rpx;
  350. height: 150rpx;
  351. }
  352. .fieldpictil {
  353. width: 230rpx;
  354. text-align: center;
  355. }
  356. </style>