12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- {include file="public/head"}
- <link href="/system/frame/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
- <link href="/system/frame/css/style.min.css?v=3.0.0" rel="stylesheet">
- <title>{$title|default=''}</title>
- <style></style>
- </head>
- <body>
- <div class="wrapper wrapper-content">
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-title">
- <h5>配送员设置</h5>
- </div>
- <div id="store-attr" class="mp-form" v-cloak="">
- <i-Form :label-width="80" style="width: 100%">
- <template>
- <Form-Item>
- <Row>
- <i-Col span="13">
- <span>配送员姓名:</span>
- <i-Input placeholder="配送员姓名" v-model="form.name" style="width: 80%"
- type="text"></i-Input>
- </i-Col>
- </Row>
- </Form-Item>
- <Form-Item>
- <Row>
- <i-Col span="13">
- <span>配送员手机号:</span>
- <i-Input placeholder="配送员手机号" v-model="form.phone" style="width: 80%"
- type="text"></i-Input>
- </i-Col>
- </Row>
- </Form-Item>
- </template>
- <Form-Item>
- <Row>
- <i-Col span="8" offset="6">
- <i-Button type="primary" @click="submit">提交</i-Button>
- </i-Col>
- </Row>
- </Form-Item>
- </i-Form>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="{__PLUG_PATH}city.js"></script>
- <script>
- var storeData = {:json_encode($store)};
- var store_id = {$store_id};
- mpFrame.start(function (Vue) {
- new Vue({
- data: function () {
- return {
- id: storeData.id || 0,
- form: {
- name: storeData.name || '',
- phone: storeData.phone || '',
- store_id: store_id,
- },
- visible: false,
- }
- },
- methods: {
- isPhone: function (test) {
- var reg = /^1[3456789]\d{9}$/;
- return reg.test(test);
- },
- submit: function () {
- var that = this;
- if (!that.form.name) return $eb.message('error', '请填写名称');
- if (!that.form.phone) return $eb.message('error', '请输入手机号码');
- if (!that.isPhone(that.form.phone)) return $eb.message('error', '请输入正确的手机号码');
- if (!that.form.store_id) return $eb.message('error', '请选择所属门店!');
- var index = layer.load(1, {
- shade: [0.5, '#fff']
- });
- $eb.axios.post('{:Url("save_sender")}' + (that.id ? '?id=' + that.id : ''), that.form).then(function (res) {
- layer.close(index);
- layer.msg(res.data.msg);
- if (res.data.data.id) that.id = res.data.data.id;
- }).catch(function (err) {
- console.log(err);
- layer.close(index);
- })
- },
- },
- }).$mount(document.getElementById('store-attr'))
- })
- </script>
|