init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,233 @@
|
||||
<!--[1.5.70]-->
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
[v-cloak] {
|
||||
display: none;
|
||||
}
|
||||
.el-input-first{
|
||||
width:400px;
|
||||
}
|
||||
.el-input-first>input{
|
||||
width:400px;
|
||||
}
|
||||
</style>
|
||||
<div id="add" v-cloak>
|
||||
<el-form label-width="80px" :model="form" :rules="rules" ref="form" id="formSet">
|
||||
<input type="hidden" id="id" value="{$id}" name="id">
|
||||
<div style="display: flex;">
|
||||
<el-form-item label="仓库名称" prop="name">
|
||||
<el-input v-model="form.name" name="name" class="el-input-first"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item label="仓库编号" prop="number">
|
||||
<el-input v-model="form.number" placeholder="请填写英文加数字(如CK_2501)" name="number" class="el-input-first"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="地址" required>
|
||||
<el-select name="province" v-model="form.selProvince" size="small" placeholder="省" filterable
|
||||
@change="selectProvince(1)">
|
||||
<el-option
|
||||
v-for="item in form.province"
|
||||
:key="item.cityid"
|
||||
:label="item.city_name"
|
||||
:value="item.cityid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select name="city" v-model="form.selCity" size="small" placeholder="市" filterable
|
||||
@change="selectProvince(2)">
|
||||
<el-option
|
||||
v-for="item in form.city"
|
||||
:key="item.cityid"
|
||||
:label="item.city_name"
|
||||
:value="item.cityid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select name="area" v-model="form.selRegion" size="small" placeholder="区" filterable>
|
||||
<el-option
|
||||
v-for="item in form.area"
|
||||
:key="item.cityid"
|
||||
:label="item.city_name"
|
||||
:value="item.cityid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="详细地址" prop="address">
|
||||
<el-input v-model="form.address" name="address" class="el-input-first"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库面积" prop="measure_area">
|
||||
<el-input v-model="form.measure_area" name="measure_area" class="el-input-first" placeholder="㎡"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="person_name">
|
||||
<el-input v-model="form.person_name" name="person_name" class="el-input-first"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="person_phone">
|
||||
<el-input v-model="form.person_phone" name="person_phone" class="el-input-first"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input type="textarea" v-model="form.remarks" name="remarks"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<if condition="$authArr['onSubmit'] eq true">
|
||||
<el-button type="primary" @click="onSubmit('form')">立即创建</el-button>
|
||||
</if>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<script>
|
||||
var add = new Vue({
|
||||
el: '#add',
|
||||
data:function(){
|
||||
return{
|
||||
form:{
|
||||
name:"{$data['name']}",
|
||||
number:"{$data['number']}",
|
||||
address:"{$data['address']}",
|
||||
measure_area:"{$data['measure_area']}",
|
||||
person_name:"{$data['person_name']}",
|
||||
person_phone:"{$data['person_phone']}",
|
||||
remarks:"{$data['remarks']}",
|
||||
selProvince:"{$data['province']}",
|
||||
selCity:"{$data['city']}",
|
||||
selRegion:"{$data['area']}",
|
||||
province: {$prov},
|
||||
city: {$city},
|
||||
area:{$area},
|
||||
default_content:"{$data['default_content']}",
|
||||
},
|
||||
rules:{
|
||||
name:[{message: '请输入仓库名称', required: true, trigger: 'change'}],
|
||||
number:[{message:'请输入正确的编号',required:true,trigger: 'change'},{
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^([a-zA-z_]{1})([\w]*)$/;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error("请输入正确的编号"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'change'
|
||||
}],
|
||||
address:[{message:'请输入仓库地址',required:true, trigger: 'change'}],
|
||||
measure_area:[{message:'请输入正确的仓库面积',required:true,trigger: 'change'},{
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/;//面积m2
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error("请输入正确的仓库面积"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'change'
|
||||
}],
|
||||
person_name:[{message:'请输入负责人名称',required:true,trigger: 'change'}],
|
||||
person_phone:[{message:'请输入正确的手机号',required:true,trigger:'change'},{
|
||||
validator: function (rule, value, callback) {
|
||||
var reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;//手机号;
|
||||
if (!reg.test(value)) {
|
||||
callback(new Error("请输入正确的手机号"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'change'
|
||||
}],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
selectProvince: function (type) {
|
||||
var that = this;
|
||||
$.post("{:U('getCity')}", {
|
||||
pid: type == 1 ? this.form.selProvince : this.form.selCity
|
||||
}, function (res) {
|
||||
if (res.status == 1) {
|
||||
if (type == 1) {
|
||||
that.form.selCity = '';
|
||||
that.form.selRegion = '';
|
||||
that.form.city = res.data;
|
||||
that.form.area = [];
|
||||
} else {
|
||||
that.form.area = res.data;
|
||||
that.form.selRegion = '';
|
||||
}
|
||||
} else {
|
||||
that.$message({
|
||||
type: 'error',
|
||||
massage: res.msg,
|
||||
duration: 1000
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onSubmit:function(formName){
|
||||
var that = this;
|
||||
that.$refs[formName].validate((valid) => {
|
||||
if(valid){
|
||||
if(!that.form.selProvince){
|
||||
that.$message({
|
||||
type:"error",
|
||||
message:"请完善仓库地址",
|
||||
duration:1000
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(!that.form.selCity){
|
||||
that.$message({
|
||||
type:"error",
|
||||
message:"请完善仓库地址",
|
||||
duration:1000
|
||||
})
|
||||
return;
|
||||
}
|
||||
if(!that.form.selRegion){
|
||||
that.$message({
|
||||
type:"error",
|
||||
message:"请完善仓库地址",
|
||||
duration:1000
|
||||
})
|
||||
return;
|
||||
}
|
||||
var formData = new FormData(document.getElementById('formSet'));
|
||||
$.ajax({
|
||||
url:"{:U('addWarehouseOperation')}",
|
||||
type:"post",
|
||||
data:formData,
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
dataType: "json",
|
||||
success:function(res){
|
||||
if(res.status == 1){
|
||||
that.$message({
|
||||
type:"success",
|
||||
message:res.message,
|
||||
duration:1000,
|
||||
onClose:function(){
|
||||
warehouse.closeChild();
|
||||
warehouse.getData();
|
||||
}
|
||||
})
|
||||
}else{
|
||||
that.$message({
|
||||
type:"error",
|
||||
message:res.message,
|
||||
duration:1000
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
that.$message({
|
||||
type:'error',
|
||||
message:"请完善必填项",
|
||||
duration:1500
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created:function(){
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,189 @@
|
||||
<!--[1.6.48]-->
|
||||
<style>
|
||||
|
||||
th {
|
||||
background-color: #f5f7fa !important;
|
||||
}
|
||||
|
||||
th > .cell {
|
||||
white-space: nowrap !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th, td {
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
th > .cell, td > .cell {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
.el-pagination {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.center-content {
|
||||
margin: 20px 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.center-content .el-input__inner {
|
||||
padding: 0 15px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#moreEditBox * {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.small-dialog-content {
|
||||
margin-top: 15vh;
|
||||
margin-left: 48vh;
|
||||
}
|
||||
|
||||
.goods_title {
|
||||
padding: 10px 0;
|
||||
}
|
||||
.el-table__row > td:last-child > .cell {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
<div class="goodsBox" id="warehouse" v-cloak>
|
||||
<div class="goods_title">
|
||||
<div class="goods_title_inner">
|
||||
供给仓
|
||||
</div>
|
||||
</div>
|
||||
<if condition="$authArr['addWarehouse'] eq true">
|
||||
<div class="center-content" v-if="type">
|
||||
<div>
|
||||
<el-button type="primary" plain @click="addWarehouse('添加仓库','{:U('addWarehouse')}')" size="small">新增仓库</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</if>
|
||||
<div style="max-width: calc(100vw - 208px);">
|
||||
<el-table size="small"
|
||||
v-loading="loading"
|
||||
:data="warehouseList"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column prop="number" label="仓库编号" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="name" label="仓库名称" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="measure_area" label="仓库面积(m)" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="region" label="所在地区" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="address" label="详细地址" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="person_name" label="负责人" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="person_phone" label="负责人手机号" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="remarks" label="备注" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column fixed="right" label="操作" style="border-right: none;">
|
||||
<template slot-scope="scope">
|
||||
<if condition="$authArr['setWarehouse'] eq true">
|
||||
<el-button @click.native.prevent="setWarehouse('编辑仓库','{:U('addWarehouse')}?id=' + scope.row.id)" type="text" size="small">编辑
|
||||
</el-button>
|
||||
</if>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- 页面加载-->
|
||||
<el-dialog :title="dialogTitle"
|
||||
:visible.sync="showSetChild"
|
||||
:close-on-click-modal="false"
|
||||
:modal-append-to-body="false"
|
||||
:append-to-body="false"
|
||||
custom-class="small-dialog-content"
|
||||
:close-on-press-escape="false"
|
||||
:before-close="closeChild"
|
||||
:show-close="true"
|
||||
:center="true"
|
||||
width="60%"
|
||||
:modal = "true"
|
||||
>
|
||||
<div id="ChildHtml" v-loading="loading"
|
||||
element-loading-text="数据加载中,请等待"
|
||||
element-loading-spinner="el-icon-loading"></div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var warehouse = new Vue({
|
||||
el: '#warehouse',
|
||||
data: function () {
|
||||
return {
|
||||
warehouseList: [],
|
||||
loading: true,
|
||||
dialogTitle:'',
|
||||
showSetChild:false,
|
||||
type:"{$type}",
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//初始化表格信息
|
||||
getData: function () {
|
||||
var that = this;
|
||||
$.ajax({
|
||||
url: "{:U(warehouseList)}",
|
||||
type: 'POST',
|
||||
data: {},
|
||||
success: function (res) {
|
||||
if (res.status == 1) {
|
||||
that.loading = false;
|
||||
that.warehouseList = [];
|
||||
that.warehouseList = res.data;
|
||||
} else {
|
||||
that.$message({
|
||||
type:'error',
|
||||
message:res.msg,
|
||||
duration:1500
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
closeChild: function () {
|
||||
$('#ChildHtml').html('');
|
||||
this.showSetChild = false;
|
||||
this.getData();
|
||||
},
|
||||
//添加
|
||||
addWarehouse:function(title,url){
|
||||
var that = this;
|
||||
that.dialogTitle = title;
|
||||
that.showSetChild = true;
|
||||
that.loading = true;
|
||||
$.get(url, function (data) {
|
||||
that.loading = false;
|
||||
$('#ChildHtml').html(data);
|
||||
$('#ChildHtml').ready(function () {
|
||||
that.loading = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
setWarehouse:function(title,url){
|
||||
var that = this;
|
||||
that.dialogTitle = title;
|
||||
that.showSetChild = true;
|
||||
that.loading = true;
|
||||
$.get(url, function (data) {
|
||||
that.loading = false;
|
||||
$('#ChildHtml').html(data);
|
||||
$('#ChildHtml').ready(function () {
|
||||
that.loading = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
created: function () {
|
||||
this.getData();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
在新工单中引用
屏蔽一个用户