123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>消毒申请单-添加/修改</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport"
- content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
- <!-- 所有的 css js 资源 -->
- <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
- <link rel="stylesheet" href="../../static/sa.css">
- <script src="../../static/kj/vue.min.js"></script>
- <script src="../../static/kj/element-ui/index.js"></script>
- <script src="../../static/kj/httpVueLoader.js"></script>
- <script src="../../static/kj/jquery.min.js"></script>
- <script src="../../static/kj/layer/layer.js"></script>
- <script src="../../static/sa.js"></script>
- <style type="text/css">
- .c-panel .el-form .c-label {
- width: 12em !important;
- }
- .c-panel .el-form .el-input, .c-panel .el-form .el-textarea__inner {
- width: 250px;
- }
- </style>
- </head>
- <body>
- <div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
- <!-- ------- 内容部分 ------- -->
- <div class="s-body">
- <div class="c-panel">
- <div class="c-title" v-if="id == 0">数据添加</div>
- <div class="c-title" v-else>数据修改</div>
- <el-form v-if="m">
- <sa-item type="text" name="发货人" v-model="m.sendPeople" br></sa-item>
- <sa-item type="text" name="收货人" v-model="m.receivePeople" br></sa-item>
- <sa-item type="text" name="品名" v-model="m.goodsName" br></sa-item>
- <sa-item type="text" name="产地" v-model="m.origin" br></sa-item>
- <sa-item type="num" name="数量" v-model="m.num" br></sa-item>
- <sa-item type="num" name="重量(kg)" v-model="m.grossWeight" br></sa-item>
- <sa-item type="text" name="规格" v-model="m.unit" br></sa-item>
- <sa-item type="text" name="包装" v-model="m.pack" br></sa-item>
- <sa-item type="text" name="标记" v-model="m.flag" br></sa-item>
- <sa-item type="text" name="号码" v-model="m.phone" br></sa-item>
- <sa-item type="text" name="启运地" v-model="m.sourceAddress" br></sa-item>
- <sa-item type="text" name="到达口岸" v-model="m.arrivePart" br></sa-item>
- <sa-item type="text" name="运输工具" v-model="m.carName" br></sa-item>
- <sa-item type="text" name="运输工具号码" v-model="m.carNo" br></sa-item>
- <sa-item type="text" name="国内运输工具" v-model="m.chinaCarName" br></sa-item>
- <sa-item type="text" name="工具号码" v-model="m.chinaCarNo" br></sa-item>
- <sa-item type="text" name="备注" v-model="m.remark" br></sa-item>
- <sa-item type="text" name="申请单位" v-model="m.applyUnit" br></sa-item>
- <sa-item type="text" name="申请人" v-model="m.declarePeople" br></sa-item>
- <sa-item type="text" name="申请人联系号码" v-model="m.declarePhone" br></sa-item>
- <div class="c-item br">
- <label class="c-label">申请时间:</label>
- <el-date-picker type="date" value-format="yyyy-MM-dd" v-model="m.applyTime"
- placeholder="请选择"></el-date-picker>
- </div>
- <sa-item type="text" name="受理人" v-model="m.acceptPeople" br></sa-item>
- <div class="c-item br">
- <label class="c-label">受理时间:</label>
- <el-date-picker type="date" value-format="yyyy-MM-dd" v-model="m.acceptTime"
- placeholder="请选择"></el-date-picker>
- </div>
- <sa-item type="num" name="计费(分)" v-model="m.money" br></sa-item>
- <sa-item name="" class="s-ok" br>
- <el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
- </sa-item>
- </el-form>
- </div>
- </div>
- <!-- ------- 底部按钮 ------- -->
- <div class="s-foot">
- <el-button type="primary" @click="ok()">确定</el-button>
- <el-button @click="sa.closeCurrIframe()">取消</el-button>
- </div>
- </div>
- <script>
- var app = new Vue({
- components: {
- "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
- },
- el: '.vue-box',
- data: {
- id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
- m: null, // 实体对象
- },
- methods: {
- // 创建一个 默认Model
- createModel: function () {
- return {
- id: '', // 主键
- sendPeople: '', // 发货人
- receivePeople: '', // 收货人
- goodsName: '', // 品名
- origin: '', // 产地
- num: '', // 数量
- grossWeight: '', // 重量
- unit: '', // 规格
- pack: '', // 包装
- flag: '', // 标记
- phone: '', // 号码
- sourceAddress: '', // 启运地
- arrivePart: '', // 到达口岸
- carName: '', // 运输工具
- carNo: '', // 运输工具号码
- chinaCarName: '', // 中国运输工具
- chinaCarNo: '', // 中国运输号码
- remark: '', // 备注
- applyUnit: '', // 申请单位
- declarePeople: '', // 申请人
- declarePhone: '', // 申请人联系号码
- applyTime: '', // 申请时间
- acceptPeople: '', // 受理人
- acceptTime: '', // 受理时间
- money: '', // 计费(分)
- }
- },
- // 提交数据
- ok: function () {
- // 表单校验
- let m = this.m;
- // sa.checkNull(m.id, '请输入 [主键]');
- sa.checkNull(m.sendPeople, '请输入 [发货人]');
- sa.checkNull(m.receivePeople, '请输入 [收货人]');
- sa.checkNull(m.goodsName, '请输入 [品名]');
- sa.checkNull(m.origin, '请输入 [产地]');
- sa.checkNull(m.num, '请输入 [数量]');
- sa.checkNull(m.grossWeight, '请输入 [重量]');
- sa.checkNull(m.unit, '请输入 [规格]');
- sa.checkNull(m.pack, '请输入 [包装]');
- sa.checkNull(m.flag, '请输入 [标记]');
- sa.checkNull(m.phone, '请输入 [号码]');
- sa.checkNull(m.sourceAddress, '请输入 [启运地]');
- sa.checkNull(m.arrivePart, '请输入 [到达口岸]');
- sa.checkNull(m.carName, '请输入 [运输工具]');
- sa.checkNull(m.carNo, '请输入 [运输工具号码]');
- sa.checkNull(m.chinaCarName, '请输入 [国内运输工具]');
- sa.checkNull(m.chinaCarNo, '请输入 [国内运输工具号码]');
- // sa.checkNull(m.remark, '请输入 [备注]');
- sa.checkNull(m.applyUnit, '请输入 [申请单位]');
- sa.checkNull(m.declarePeople, '请输入 [申请人]');
- sa.checkNull(m.declarePhone, '请输入 [申请人联系号码]');
- if (!sa.isPhone(m.declarePhone)) {
- sa.error('申请人联系号码不正确')
- return;
- }
- sa.checkNull(m.applyTime, '请输入 [申请时间]');
- // sa.checkNull(m.acceptPeople, '请输入 [受理人]');
- // sa.checkNull(m.acceptTime, '请输入 [受理时间]');
- // sa.checkNull(m.money, '请输入 [计费(分)]');
- // 开始增加或修改
- if (this.id <= 0) { // 添加
- sa.ajax('/TbDisinfect/add', m, function (res) {
- sa.alert('增加成功', this.clean);
- }.bind(this));
- } else { // 修改
- sa.ajax('/TbDisinfect/update', m, function (res) {
- sa.alert('修改成功', this.clean);
- }.bind(this));
- }
- },
- // 添加/修改 完成后的动作
- clean: function () {
- if (this.id == 0) {
- this.m = this.createModel();
- } else {
- parent.app.f5(); // 刷新父页面列表
- sa.closeCurrIframe(); // 关闭本页
- }
- }
- },
- mounted: function () {
- // 初始化数据
- if (this.id <= 0) {
- this.m = this.createModel();
- } else {
- sa.ajax('/TbDisinfect/getById?id=' + this.id, function (res) {
- this.m = res.data;
- if (res.data == null) {
- sa.alert('未能查找到 id=' + this.id + " 详细数据");
- }
- }.bind(this))
- }
- }
- })
- </script>
- </body>
- </html>
|