outjobform.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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. priority: "",
  179. market_content: "",
  180. is_bargain: 1,
  181. },
  182. modalName: null,
  183. market: [],
  184. }
  185. },
  186. onLoad: function(option) {
  187. _this = this;
  188. _this.userinfo = _this.checkLogin("/pages/my/my");
  189. _this.workerinfo = uni.getStorageSync('workerinfo') || false;
  190. if (_this.userinfo === false || _this.workerinfo === false) {
  191. uni.reLaunch({
  192. url: "/pages/my/my"
  193. });
  194. return false;
  195. }
  196. var id = option.id || 0;
  197. if (id > 0) {
  198. _this.$req.ajax({
  199. path: "woutjobs/getrecruit",
  200. data: {
  201. id: id
  202. }
  203. }).then((data) => {
  204. _this.form = data;
  205. }).catch((err) => {
  206. uni.showModal({
  207. title: '信息提示',
  208. content: err,
  209. showCancel: false
  210. });
  211. });
  212. }
  213. },
  214. methods: {
  215. // 填写字段
  216. setInput: function(e) {
  217. var field = e.currentTarget.dataset.field;
  218. _this.form[field] = e.detail.value;
  219. },
  220. bindDateChange: function(e) {
  221. _this.form.candate = e.target.value;
  222. },
  223. showModal: function(e) {
  224. _this.modalName = e.currentTarget.dataset.modalname;
  225. },
  226. hideModal: function(e) {
  227. _this.modalName = null
  228. },
  229. RegionChange(e) {
  230. this.form.province = e.detail.value[0];
  231. this.form.city = e.detail.value[1];
  232. this.form.district = e.detail.value[2];
  233. },
  234. isBargainChange(e) {
  235. _this.form.is_bargain = e.detail.value;
  236. },
  237. getMarket() {
  238. _this.$req.ajax({
  239. path: "woutjobs/getmarket",
  240. data: {}
  241. }).then((data) => {
  242. _this.market = data.list;
  243. _this.modalName = 'marketModal';
  244. }).catch((err) => {
  245. uni.showModal({
  246. title: '信息提示',
  247. content: err,
  248. showCancel: false
  249. });
  250. });
  251. },
  252. callMobile(e) {
  253. let mobile = e.currentTarget.dataset.mobile;
  254. uni.makePhoneCall({phoneNumber: mobile});
  255. },
  256. selectMarket(e) {
  257. let index = e.currentTarget.dataset.index;
  258. let market = this.market[index];
  259. this.form.is_bargain = market.is_bargain;
  260. this.form.market_content = market.content;
  261. this.modalName = null
  262. },
  263. // 提交信息
  264. editRecruit: function() {
  265. if (_this.isRotate) {
  266. return false;
  267. }
  268. _this.isRotate = true;
  269. _this.form.worker_id = _this.workerinfo.id;
  270. _this.$req.ajax({
  271. path: "woutjobs/editrecruit",
  272. title: "正在提交信息",
  273. data: _this.form,
  274. }).then((data) => {
  275. _this.isRotate = false;
  276. uni.navigateBack();
  277. }).catch((err) => {
  278. uni.showModal({
  279. title: '信息提示',
  280. content: err,
  281. showCancel: false
  282. });
  283. _this.isRotate = false;
  284. });
  285. },
  286. // 图片上传
  287. chooseImage: function(e) {
  288. uni.chooseImage({
  289. count: 12,
  290. sizeType: ['original', 'compressed'],
  291. sourceType: ['album'],
  292. success: (res) => {
  293. _this.$req.ajaxFile({
  294. path: "attachment/tplfieldimage",
  295. title: '正在上传',
  296. filePath: res.tempFilePaths[0],
  297. fileName: 'file',
  298. }).then((filedata) => {
  299. var data = JSON.parse(filedata.data);
  300. _this.form.picall.push(data.data.src);
  301. }).catch((err) => {
  302. uni.showModal({
  303. title: '信息提示',
  304. content: err,
  305. showCancel: false
  306. });
  307. });
  308. }
  309. });
  310. },
  311. }
  312. }
  313. </script>
  314. <style>
  315. .echo-formmain {
  316. min-height: calc(100vh - 290rpx);
  317. background-color: #FFFFFF;
  318. padding-left: 30rpx;
  319. padding-right: 30rpx;
  320. }
  321. .cu-form-group{ display: flex; flex-wrap: wrap; padding: 40rpx 10rpx 0rpx 10rpx; }
  322. .cu-form-group .title{ width: 100%; }
  323. .cu-form-group>input{ display: block; width: 670rpx; height: 100rpx; color: #AAAAAA; }
  324. .cu-form-group>radio-group{ width: 670rpx; height: 100rpx; line-height: 100rpx; color: #AAAAAA; text-align: left; }
  325. .cu-form-group .textareabox{ width: 670rpx; }
  326. .cu-form-group .textareabox textarea{ width: 670rpx; margin-top: 20rpx !important; margin-bottom: 0rpx; }
  327. .cu-form-group .placeholder{ color: #AAAAAA; }
  328. .cu-form-group picker .picker{ text-align: left; color: #AAAAAA; }
  329. .fieldpic {
  330. width: 150rpx;
  331. height: 150rpx;
  332. }
  333. .fieldpictil {
  334. width: 230rpx;
  335. text-align: center;
  336. }
  337. </style>