manualCreate.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814
  1. <template>
  2. <div class="form-wrap" v-loading="isLoading" element-loading-text="正在计算中...">
  3. <el-form label-position="left" ref="form" :model="form" label-width="110px">
  4. <div class="moudle-list">
  5. <div class="moudle">
  6. <div class="title-list">
  7. <div v-if="memberType !== 1" @click="sendType = 1" :class=" sendType ? 'title' : 'normal-title'">
  8. 门店地址发单
  9. </div>
  10. <div @click="sendType = 0" :class=" !sendType ? 'title' : 'normal-title'">
  11. 个人地址发单
  12. </div>
  13. </div>
  14. <el-form-item :label="sendType ? '发件门店' : '发件人姓名'" required>
  15. <el-input v-show="!sendType" size="small" class="input" v-model="form.sendAddress.contact" placeholder="请填写发件人姓名" clearable></el-input>
  16. <el-input v-show="sendType" disabled size="small" class="input" v-model="name" placeholder="请填写发件门店"></el-input>
  17. <el-button v-show="sendType" @click="showShop(1)" class="but1 active" type="info">选择门店</el-button>
  18. <el-button v-show="!sendType" @click="showShop(2)" class="but1 active" type="info">常用地址</el-button>
  19. </el-form-item>
  20. <el-form-item label="发件人电话" required>
  21. <el-input size="small" class="phone-before" v-model="form.sendAddress.phone" placeholder="请填写发件人电话" clearable></el-input>
  22. <div class="phone-center">~</div>
  23. <el-input size="small" class="phone-after" v-model="form.sendAddress.extension" placeholder="分机号"></el-input>
  24. </el-form-item>
  25. <el-form-item label="发件人地址" required>
  26. <el-input size="small" v-model="form.sendAddress.address" placeholder="请选择发件人地址" disabled>
  27. <img @click="showMap(1)" slot="append" class="map" src="../../static/image/icon_map.png">
  28. </el-input>
  29. </el-form-item>
  30. <el-form-item label="楼号/门牌号">
  31. <el-input size="small" v-model="form.sendAddress.street" placeholder="请填写发件人楼号/门牌号" :disabled="!!sendType" clearable>
  32. </el-input>
  33. </el-form-item>
  34. </div>
  35. <div class="moudle">
  36. <div class="title">
  37. 收件地址
  38. </div>
  39. <el-form-item label="收件人姓名" required>
  40. <el-input size="small" v-model="form.receiptAddress.contact" placeholder="请填写收件人姓名" clearable>
  41. </el-input>
  42. <el-button @click="showShop(3)" class="but1 active" type="info">常用地址</el-button>
  43. </el-form-item>
  44. <el-form-item label="收件人电话" required>
  45. <el-input size="small" class="phone-before" v-model="form.receiptAddress.phone" placeholder="请填写收件人电话" clearable></el-input>
  46. <div class="phone-center">~</div>
  47. <el-input size="small" class="phone-after" v-model="form.receiptAddress.extension" placeholder="分机号"></el-input>
  48. </el-form-item>
  49. <el-form-item label="收件人地址" required>
  50. <el-input size="small" v-model="form.receiptAddress.address" placeholder="请选择收件人地址" disabled>
  51. <img @click="showMap(2)" slot="append" class="map" src="../../static/image/icon_map.png">
  52. </el-input>
  53. </el-form-item>
  54. <el-form-item label="楼号/门牌号">
  55. <el-input size="small" v-model="form.receiptAddress.street" placeholder="请填写收件人楼号/门牌号" clearable>
  56. </el-input>
  57. </el-form-item>
  58. </div>
  59. <div class="moudle">
  60. <div class="title">
  61. 物品信息
  62. </div>
  63. <el-form-item label="物品类型" required>
  64. <!-- <div class="category_box">
  65. <div class="item" :class="form.productId === item.id ? 'active':''" v-for="(item,i) in products" :key="i" @click="$set(form,'productId',item.id)">
  66. {{item.name}}
  67. </div>
  68. </div> -->
  69. <el-radio-group class="category_box" v-model="form.productId">
  70. <el-radio class="item" v-for="(item,i) in products" :key="i" :label="item.id">{{item.name}}</el-radio>
  71. </el-radio-group>
  72. </el-form-item>
  73. <el-form-item label="物品重量" required>
  74. <div class="printer-num">
  75. <img @click="reduce()" src="../../static/image/icon_reduce.png" class="reduce" alt="" srcset="" />
  76. <el-input ref="weight" size="small" class="num" v-model="form.weight" clearable>
  77. <template slot="append">KG</template>
  78. </el-input>
  79. <img @click="add()" src="../../static/image/icon_add.png" class="add" alt="" srcset="" />
  80. </div>
  81. <!-- <el-input-number size="small" v-model="form.weight" :min="1" :max="10" label="描述文字">
  82. </el-input-number> -->
  83. </el-form-item>
  84. <el-form-item label="物品价值" required>
  85. <el-input class="product-amount" ref="productAmount" size="small" v-model="form.productAmount" placeholder="请输入物品价值!" clearable>
  86. <template slot="append">元</template>
  87. </el-input>
  88. </el-form-item>
  89. <el-form-item label="发单时间">
  90. <el-button @click="form.takeType = 0" :class="!form.takeType ? 'but active' : 'but'" type="info">立即发单</el-button>
  91. <el-button @click="form.takeType = 1" :class="form.takeType ? 'but but-r active' : 'but'" type="info">预约发单</el-button>
  92. <el-date-picker @focus="focus" @change="chooseTime" size="small" v-show="form.takeType === 1" v-model="form.takeTime" type="datetime" placeholder="选择日期时间" format="yyyy-MM-dd HH:mm" :picker-options="pickerOptions">
  93. </el-date-picker>
  94. </el-form-item>
  95. <el-form-item label="发单备注">
  96. <el-input type="text" size="small" v-model="form.takeRemark" maxlength="20" placeholder="请添加备注信息,最多输入20个字!" clearable show-word-limit>
  97. </el-input>
  98. </el-form-item>
  99. </div>
  100. <div class="moudle">
  101. <div class="title">
  102. 发票信息
  103. </div>
  104. <el-form-item label="发票抬头">
  105. <el-input size="small" v-model="form.invoiceTitle" placeholder="请输入发票抬头!" clearable>
  106. </el-input>
  107. </el-form-item>
  108. <el-form-item label="发票税号">
  109. <el-input size="small" v-model="form.taxpayerId" placeholder="请输入发票税号!" clearable>
  110. </el-input>
  111. </el-form-item>
  112. </div>
  113. </div>
  114. <!-- 选择门店 -->
  115. <el-dialog v-loading="loading" element-loading-text="拼命加载中" :title="addressType === 1 ? '选择门店' : '常用地址'" :visible.sync="showChooseShop" width="600px" center>
  116. <div class="shop-top">
  117. <div @click="showAddress = true" v-if="addressType === 3 || addressType === 2" class="management-address">地址管理</div>
  118. <el-input size="small" placeholder="请输入姓名/手机号/地址" v-model="searchKey" @keydown.enter.native="seachEnterFun" clearable>
  119. <el-button type="primary" @click.stop="getData" slot="append" icon="el-icon-search"></el-button>
  120. </el-input>
  121. </div>
  122. <div class="shop-list">
  123. <div @dblclick="chooseShop" @click="curIdx = index" :class=" curIdx === index ? 'shop-item active' : 'shop-item'" v-for="(shop,index) in addressList" :key="index">
  124. <div class="name">{{shop.name}}</div>
  125. <div class="phone">{{shop.contact + ' ' + shop.phone}}</div>
  126. <div class="address">{{shop.districtName + shop.address}}</div>
  127. </div>
  128. </div>
  129. <span slot="footer" class="dialog-footer">
  130. <el-button size="small" @click="showChooseShop = false">取 消</el-button>
  131. <el-button size="small" type="primary" @click="chooseShop">确 定</el-button>
  132. </span>
  133. </el-dialog>
  134. </el-form>
  135. <el-button class="btn" size="small" type="primary" @click="onSubmit">{{form.takeType ? '保存' : '去结算'}}</el-button>
  136. <!-- 通过地图选择地理位置 -->
  137. <order-map :key="new Date().getTime()" @getAddressDetail="getAddressDetail" ref="orderMap"></order-map>
  138. <!-- 发起配送 -->
  139. <send-order-popup ref="sendOrderPopup"></send-order-popup>
  140. <!-- 地址管理 -->
  141. <el-dialog title="常用地址" :visible.sync="showAddress" width="800px" center @close="closeAddress">
  142. <address-management></address-management>
  143. </el-dialog>
  144. </div>
  145. </template>
  146. <script>
  147. import orderMap from "./orderComponents/orderAMap.vue";
  148. import addressManagement from "./addressManagement.vue";
  149. import { getProductList } from "../api/shop.js";
  150. import { getConfig } from "../api/setting.js";
  151. import { sendValuation, saveOrder, getAddressList } from "../api/order.js";
  152. import sendOrderPopup from "../components/orderComponents/sendOrderPopup.vue";
  153. export default {
  154. name: "manualCreate",
  155. data() {
  156. return {
  157. products: [],
  158. addressType: 1,
  159. name: "",
  160. sendType: this.$store.state.userInfo.memberType === 1 ? 0 : 1,
  161. memberType: this.$store.state.userInfo.memberType,
  162. form: {
  163. name: "",
  164. sendAddress: {
  165. id: "",
  166. address: "",
  167. cityCode: "",
  168. cityName: "",
  169. contact: "",
  170. lat: "",
  171. lng: "",
  172. phone: "",
  173. provinceName: "",
  174. districtName: "",
  175. extension: "",
  176. street: "",
  177. },
  178. receiptAddress: {
  179. address: "",
  180. contact: "",
  181. phone: "",
  182. street: "",
  183. },
  184. weight: 1,
  185. productId: "",
  186. takeType: 0,
  187. takeTime: "",
  188. takeRemark: "",
  189. type: this.$store.state.userInfo.memberType === 1 ? 1 : 2,
  190. isWaimai: false,
  191. createType: 1,
  192. shopId: this.$store.state.userInfo.shopId,
  193. productAmount: 50,
  194. invoiceTitle: "",
  195. taxpayerId: "",
  196. transport: "0",
  197. },
  198. chooseMapAddress: 1, // 1 发件选择地址2 收件选择地址
  199. showChooseShop: false,
  200. showChooseAddress: false,
  201. loading: false,
  202. shopList: [],
  203. personalList: [],
  204. addressList: [],
  205. searchKey: "",
  206. curIdx: 0,
  207. isLoading: false,
  208. pickerOptions: {
  209. disabledDate(time) {
  210. return (
  211. time.getTime() > Date.now() + 3600 * 1000 * 24 ||
  212. time.getTime() < Date.now() - 3600 * 1000 * 24
  213. );
  214. },
  215. },
  216. min: 15,
  217. showAddress: false,
  218. personalSendAddressId: "",
  219. personalReceiptAddressId: "",
  220. };
  221. },
  222. components: {
  223. orderMap,
  224. sendOrderPopup,
  225. addressManagement,
  226. },
  227. // 监听属性 类似于data概念
  228. computed: {},
  229. // 监控data中的数据变化
  230. watch: {
  231. "$store.state.userInfo": {
  232. handler(newVal, oldVal) {
  233. this.sendType = newVal.memberType === 1 ? 0 : 1;
  234. this.memberType = newVal.memberType;
  235. this.form.type = newVal.memberType === 1 ? 1 : 2;
  236. this.form.shopId = newVal.shopId;
  237. },
  238. deep: true,
  239. },
  240. sendType: {
  241. handler(newVal, oldVal) {
  242. this.searchKey = "";
  243. Object.keys(this.form.sendAddress).map((v) => {
  244. this.form.sendAddress[v] = "";
  245. });
  246. if (newVal) {
  247. this.addressType = 1;
  248. } else {
  249. this.addressType = 2;
  250. }
  251. this.getData();
  252. },
  253. immediate: true,
  254. },
  255. },
  256. // 生命周期 - 创建完成(可以访问当前this实例)
  257. created() {
  258. this.getProductList();
  259. this.getData();
  260. },
  261. // 方法集合
  262. methods: {
  263. closeAddress() {
  264. this.getData();
  265. },
  266. seachEnterFun(e) {
  267. var keyCode = window.event ? e.keyCode : e.which;
  268. if (keyCode == 13) {
  269. this.getData();
  270. }
  271. },
  272. chooseTime(time) {
  273. let min = this.min; // 多少分钟后发起配送
  274. let now = new Date().getTime();
  275. let inputTime = new Date(time).getTime();
  276. if (inputTime < now + 60 * 1000 * (min - 1)) {
  277. this.$message({
  278. type: "error",
  279. message: `至少选择${min}分钟后发单!`,
  280. });
  281. this.form.takeTime = this.$tool.getFormatDate(now + 60 * 1000 * min);
  282. } else {
  283. this.form.takeTime = this.$tool.getFormatDate(inputTime);
  284. }
  285. },
  286. chooseShop() {
  287. this.showChooseShop = false;
  288. let sendAddress = this.addressList[this.curIdx];
  289. if (this.addressType === 1) {
  290. Object.keys(this.form.sendAddress).map((v) => {
  291. this.form.sendAddress[v] = sendAddress[v];
  292. });
  293. this.name = sendAddress.name;
  294. this.form.shopId = sendAddress.id;
  295. } else if (this.addressType === 2) {
  296. this.form.sendAddress = sendAddress;
  297. this.personalSendAddressId = sendAddress.id;
  298. } else {
  299. this.form.receiptAddress = sendAddress;
  300. this.personalReceiptAddressId = sendAddress.id;
  301. }
  302. },
  303. showShop(addressType) {
  304. // 1门店地址发单选择门店 2是个人地址发单选择常用地址 3是收件地址选择常用地址
  305. this.addressType = addressType;
  306. this.searchKey = "";
  307. this.getData();
  308. this.showChooseShop = true;
  309. },
  310. getData() {
  311. this.loading = true;
  312. getAddressList({
  313. searchKey: this.searchKey,
  314. }).then((res) => {
  315. this.loading = false;
  316. if (res.code === 200) {
  317. let sendAddress;
  318. if (this.addressType === 1) {
  319. this.addressList = res.data.shop;
  320. sendAddress = this.addressList.filter((v) => {
  321. return v.id === this.form.shopId;
  322. })[0];
  323. this.curIdx = this.addressList.findIndex((v) => {
  324. return v.id === this.form.shopId;
  325. });
  326. console.log("sendAddress1", sendAddress);
  327. Object.keys(this.form.sendAddress).map((v) => {
  328. this.form.sendAddress[v] = sendAddress ? sendAddress[v] : "";
  329. });
  330. this.name = sendAddress ? sendAddress.name : "";
  331. }
  332. if (this.addressType === 2) {
  333. this.addressList = res.data.personal;
  334. if (this.personalSendAddressId) {
  335. sendAddress = this.addressList.filter((v) => {
  336. return v.id === this.personalSendAddressId;
  337. })[0];
  338. this.curIdx = this.addressList.findIndex((v) => {
  339. return v.id === this.personalSendAddressId;
  340. });
  341. } else {
  342. sendAddress = this.addressList.filter((v) => {
  343. return v.isDefault;
  344. })[0];
  345. this.curIdx = this.addressList.findIndex((v) => {
  346. return v.isDefault;
  347. });
  348. }
  349. console.log("sendAddress2", sendAddress);
  350. Object.keys(this.form.sendAddress).map((v) => {
  351. this.form.sendAddress[v] = sendAddress ? sendAddress[v] : "";
  352. });
  353. }
  354. if (this.addressType === 3) {
  355. this.addressList = res.data.personal;
  356. let receiptAddress = this.addressList.filter((v) => {
  357. return v.id === this.personalReceiptAddressId;
  358. })[0];
  359. this.curIdx = this.addressList.findIndex((v) => {
  360. return v.id === this.personalReceiptAddressId;
  361. });
  362. console.log("receiptAddress", receiptAddress);
  363. Object.keys(this.form.receiptAddress).map((v) => {
  364. this.form.receiptAddress[v] = receiptAddress
  365. ? receiptAddress[v]
  366. : "";
  367. });
  368. }
  369. } else {
  370. this.$message({
  371. type: "error",
  372. message: res.msg,
  373. });
  374. }
  375. });
  376. },
  377. getProductList() {
  378. getProductList().then((res) => {
  379. if (res.code === 200) {
  380. this.products = res.data;
  381. this.form.productId = this.products[0].id;
  382. } else {
  383. this.$message({
  384. type: "error",
  385. message: res.msg,
  386. });
  387. }
  388. });
  389. },
  390. onSubmit() {
  391. // 去除电话中的空格
  392. this.form.sendAddress.phone = this.form.sendAddress.phone.replace(
  393. /\s/g,
  394. ""
  395. );
  396. this.form.receiptAddress.phone = this.form.receiptAddress.phone.replace(
  397. /\s/g,
  398. ""
  399. );
  400. if (!this.form.sendAddress.phone.trim()) {
  401. return this.$message({
  402. type: "error",
  403. message: "请先输入发件人电话!",
  404. });
  405. }
  406. let reg2 = new RegExp(/^1[3456789]\d{9}$/);
  407. if (!reg2.test(this.form.sendAddress.phone)) {
  408. return this.$message({
  409. type: "error",
  410. message: "请输入正确的发件人电话!",
  411. });
  412. }
  413. // 个人发件
  414. if (!this.sendType) {
  415. this.form.shopId = this.$store.state.userInfo.shopId;
  416. if (!this.form.sendAddress.contact.trim()) {
  417. return this.$message({
  418. type: "error",
  419. message: "请先输入发件人姓名!",
  420. });
  421. }
  422. if (!this.form.sendAddress.address.trim()) {
  423. return this.$message({
  424. type: "error",
  425. message: "请先选择发件人地址!",
  426. });
  427. }
  428. }
  429. if (!this.form.receiptAddress.contact.trim()) {
  430. return this.$message({
  431. type: "error",
  432. message: "请先输入收件人姓名!",
  433. });
  434. }
  435. if (!this.form.receiptAddress.phone.trim()) {
  436. return this.$message({
  437. type: "error",
  438. message: "请先输入收件人电话!",
  439. });
  440. }
  441. if (!reg2.test(this.form.receiptAddress.phone)) {
  442. return this.$message({
  443. type: "error",
  444. message: "请输入正确的收件人电话!",
  445. });
  446. }
  447. if (!this.form.receiptAddress.address.trim()) {
  448. return this.$message({
  449. type: "error",
  450. message: "请先选择收件人地址!",
  451. });
  452. }
  453. let reg = new RegExp(/^([1-4][0-9]{0,1}|50)$/);
  454. if (!reg.test(Number(this.form.weight))) {
  455. this.$refs.weight.focus();
  456. return this.$message({
  457. type: "error",
  458. message: "物品重量为正整数且不得超过50KG!",
  459. });
  460. }
  461. let reg1 = new RegExp(/(^[1-9]{1}[0-9]*$)|(^[0-9]*\.[0-9]{2}$)/);
  462. if (!reg1.test(Number(this.form.productAmount))) {
  463. this.$refs.productAmount.focus();
  464. return this.$message({
  465. type: "error",
  466. message: "请输入正确的金额!",
  467. });
  468. }
  469. if (Number(this.form.productAmount) > 20000) {
  470. this.$refs.productAmount.focus();
  471. return this.$message({
  472. type: "error",
  473. message: "物品价值不得超过20000元!",
  474. });
  475. }
  476. // 预约发单
  477. if (this.form.takeType) {
  478. if (!this.form.takeTime.trim()) {
  479. return this.$message({
  480. type: "error",
  481. message: "请先选择预约发单时间!",
  482. });
  483. }
  484. let min = this.min; // 多少分钟后发起配送
  485. let now = new Date().getTime();
  486. let inputTime = new Date(this.form.takeTime).getTime();
  487. if (inputTime < now + 60 * 1000 * (min - 1)) {
  488. return this.$message({
  489. type: "error",
  490. message: `预约发单时间至少为${min}分钟后发单!`,
  491. });
  492. }
  493. this.form.saveFlag = 1;
  494. getConfig().then((res) => {
  495. if (res.code === 200) {
  496. let amount = res.data.amount;
  497. if (amount < 100) {
  498. this.$confirm(
  499. "您的账户余额不足100元,可能会导致预约发单失败,请及时充值!",
  500. "提示",
  501. {
  502. confirmButtonText: "去充值",
  503. cancelButtonText: "知道了!",
  504. distinguishCancelAndClose: true,
  505. center: true,
  506. type: "warning",
  507. }
  508. )
  509. .then(() => {
  510. this.$router.push({
  511. path: "/shopInfo/shopAccount",
  512. });
  513. })
  514. .catch((action) => {
  515. console.log("action:", action);
  516. if (action === "close") {
  517. return;
  518. } else {
  519. this.saveOrder();
  520. }
  521. });
  522. } else {
  523. this.saveOrder();
  524. }
  525. } else {
  526. this.$message({
  527. type: "error",
  528. message: res.msg,
  529. });
  530. }
  531. });
  532. } else {
  533. this.form.takeTime = this.$tool.getFormatDate(new Date());
  534. this.sendValuation();
  535. }
  536. },
  537. saveOrder() {
  538. saveOrder(this.form).then((res) => {
  539. if (res.code === 200) {
  540. this.$message({
  541. type: "success",
  542. message: "预约单保存成功!",
  543. });
  544. this.$router.push({
  545. name: "HomeIndex",
  546. params: { tabNum: 1 },
  547. });
  548. } else {
  549. this.$message({
  550. type: "error",
  551. message: res.msg,
  552. });
  553. }
  554. });
  555. },
  556. // 计价
  557. sendValuation() {
  558. this.isLoading = true;
  559. sendValuation(this.form).then((res) => {
  560. this.isLoading = false;
  561. if (res.code == 200) {
  562. res.data.optionals.forEach((item) => {
  563. item.optionals = item.optionals ? item.optionals : [];
  564. item.lowOptionals = item.lowOptionals ? item.lowOptionals : [];
  565. item.supports = item.supports ? item.supports : [];
  566. });
  567. this.$refs.sendOrderPopup.init(res.data, {
  568. ...this.form,
  569. });
  570. } else {
  571. this.$message({
  572. type: "error",
  573. message: res.msg,
  574. });
  575. }
  576. });
  577. },
  578. showMap(type) {
  579. this.searchKey = "";
  580. this.chooseMapAddress = type;
  581. if (this.sendType === 1 && this.chooseMapAddress === 1) return;
  582. this.$refs.orderMap.chooseLocation();
  583. },
  584. getAddressDetail(v, lng, lat) {
  585. let type = "sendAddress";
  586. if (this.chooseMapAddress === 1) {
  587. type = "sendAddress";
  588. } else {
  589. type = "receiptAddress";
  590. }
  591. this.form[type].address = v.address;
  592. this.form[type].provinceName = v.province;
  593. this.form[type].cityName = v.city;
  594. this.form[type].cityCode = v.citycode;
  595. this.form[type].districtName = v.district;
  596. this.form[type].lng = lng;
  597. this.form[type].lat = lat;
  598. },
  599. reduce() {
  600. this.form.weight = this.form.weight === 1 ? 1 : --this.form.weight;
  601. },
  602. add() {
  603. this.form.weight = ++this.form.weight;
  604. },
  605. focus() {
  606. this.$nextTick(() => {
  607. document
  608. .getElementsByClassName("el-button--text")[0]
  609. .setAttribute("style", "display:none"); // 隐藏此刻按钮
  610. });
  611. },
  612. },
  613. };
  614. </script>
  615. <style lang="scss" scoped="scoped">
  616. .form-wrap {
  617. display: flex;
  618. flex-direction: column;
  619. align-items: center;
  620. width: calc(100% - 40px);
  621. padding: 20px;
  622. background: #fff;
  623. .product-amount {
  624. width: 190px;
  625. }
  626. .moudle-list {
  627. display: flex;
  628. flex-wrap: wrap;
  629. .moudle {
  630. width: 600px;
  631. margin: 0 100px 50px 0;
  632. /deep/ .el-radio__input.is-checked .el-radio__inner {
  633. border-color: #fc7200;
  634. background: #fc7200;
  635. }
  636. /deep/ .el-radio__input.is-checked + .el-radio__label {
  637. color: #fc7200;
  638. }
  639. .category_box {
  640. display: flex;
  641. flex-wrap: wrap;
  642. width: 100%;
  643. margin-top: -10px;
  644. .item {
  645. display: flex;
  646. align-items: center;
  647. width: 92px;
  648. height: 30px;
  649. margin: 10px 10px 0 0;
  650. border-radius: 2px;
  651. cursor: pointer;
  652. &.active {
  653. color: #ffffff;
  654. background: #fc7200;
  655. border-color: #fc7200 !important;
  656. }
  657. }
  658. }
  659. .phone-before {
  660. width: 50%;
  661. }
  662. .phone-center {
  663. margin: 0 15px;
  664. }
  665. .phone-after {
  666. width: 70px;
  667. }
  668. .map {
  669. height: 25px;
  670. width: 25px;
  671. cursor: pointer;
  672. }
  673. }
  674. }
  675. .btn {
  676. width: 200px;
  677. height: 40px;
  678. font-size: 14px;
  679. background: #fc7200;
  680. border: #fc7200;
  681. margin-top: -50px;
  682. }
  683. /deep/ .el-form {
  684. display: flex;
  685. flex-wrap: wrap;
  686. }
  687. /deep/ .el-form-item__label {
  688. color: #b1b1b1;
  689. }
  690. .title-list {
  691. display: flex;
  692. align-items: center;
  693. .normal-title {
  694. color: #999;
  695. font-weight: bold;
  696. margin: 0 30px 20px 0;
  697. cursor: pointer;
  698. }
  699. .normal-title:before {
  700. content: "";
  701. display: inline-block;
  702. width: 3px;
  703. height: 14px;
  704. background-color: #999;
  705. }
  706. }
  707. .title {
  708. font-weight: bold;
  709. color: #333;
  710. margin: 0 30px 20px 0;
  711. cursor: pointer;
  712. }
  713. .title:before {
  714. content: "";
  715. display: inline-block;
  716. width: 3px;
  717. height: 14px;
  718. background-color: #fc7200;
  719. }
  720. .but {
  721. display: flex;
  722. align-items: center;
  723. justify-content: center;
  724. margin: 0;
  725. border-radius: 0;
  726. height: 32px;
  727. background: #ebebeb;
  728. border-color: #ebebeb;
  729. color: #666;
  730. &.active {
  731. color: #ffffff;
  732. background: #fc7200;
  733. border-color: #fc7200 !important;
  734. }
  735. &.but-r {
  736. margin-right: 20px;
  737. }
  738. }
  739. .but1 {
  740. display: flex;
  741. align-items: center;
  742. justify-content: center;
  743. margin-left: 100px;
  744. height: 32px;
  745. &.active {
  746. color: #ffffff;
  747. background: #fc7200;
  748. border-color: #fc7200 !important;
  749. }
  750. }
  751. /deep/ .el-form-item__content {
  752. display: flex;
  753. align-items: center;
  754. line-height: 32px;
  755. }
  756. .printer-num {
  757. display: flex;
  758. align-items: center;
  759. .reduce {
  760. width: 32px;
  761. height: 32px;
  762. cursor: pointer;
  763. }
  764. .num {
  765. margin: 0 10px;
  766. width: 150px;
  767. }
  768. .add {
  769. width: 32px;
  770. height: 32px;
  771. cursor: pointer;
  772. }
  773. .name {
  774. margin-left: 20px;
  775. }
  776. }
  777. .shop-top {
  778. display: flex;
  779. align-items: center;
  780. margin-bottom: 10px;
  781. .management-address {
  782. flex-shrink: 0;
  783. color: #fc7200;
  784. margin-right: 15px;
  785. cursor: pointer;
  786. }
  787. }
  788. .shop-list {
  789. height: 60vh;
  790. overflow: scroll;
  791. .shop-item {
  792. border: 1px solid #999;
  793. padding: 10px;
  794. margin: 10px 0;
  795. border-radius: 5px;
  796. color: #333;
  797. cursor: pointer;
  798. }
  799. .active {
  800. border-color: #fc7200;
  801. color: #fc7200;
  802. }
  803. }
  804. }
  805. </style>