init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,243 @@
|
||||
<!--[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>
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="form.state" label="默认仓库"></el-checkbox>
|
||||
</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},
|
||||
state:"{$data['default_state']}" == 1?true:false,
|
||||
},
|
||||
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'));
|
||||
if(that.form.state){
|
||||
that.form.default_state = 1;
|
||||
}else{
|
||||
that.form.default_state = 0;
|
||||
}
|
||||
var default_state = JSON.parse(JSON.stringify(that.form.default_state));
|
||||
formData.append('default_state',JSON.stringify(default_state));
|
||||
$.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,303 @@
|
||||
<!--[1.6.48]-->
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
[v-cloak] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
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-table_1_column_13 {
|
||||
border-right: none !important;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.el-input {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.save {
|
||||
white-space: nowrap;
|
||||
background-color: #409EFF;
|
||||
color: white;
|
||||
font-size: 12px;
|
||||
line-height: 30px;
|
||||
padding: 0 4px;
|
||||
border-radius: 4px;
|
||||
margin-left: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.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: normal !important;
|
||||
overflow: visible !important;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 6px 12px;
|
||||
line-height: 22px;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.el-table__row > td:last-child .el-button--text {
|
||||
padding: 0 6px;
|
||||
}
|
||||
</style>
|
||||
<div class="goodsBox" id="warehouse" v-cloak>
|
||||
<div class="goods_title">
|
||||
<div class="goods_title_inner">
|
||||
采购仓库
|
||||
</div>
|
||||
</div>
|
||||
<div class="center-content">
|
||||
<div>
|
||||
<if condition="$authArr['addWarehouse'] eq true">
|
||||
<el-button type="primary" plain @click="addWarehouse('添加仓库','{:U('addWarehouse')}')" size="small">新增仓库
|
||||
</el-button>
|
||||
</if>
|
||||
</div>
|
||||
</div>
|
||||
<div style="border: 1px solid #e6e6e6;max-width: calc(100vw - 208px);">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="warehouseList"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column prop="index" label="序号" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="add_time" label="创建时间" show-overflow-tooltip></el-table-column>
|
||||
<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="操作" min-width="160" 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>
|
||||
<if condition="$authArr['delWarehouse'] eq true">
|
||||
<el-button @click.native.prevent="delWarehouse(scope.row.id)" style="color: #999" type="text"
|
||||
size="small">删除
|
||||
</el-button>
|
||||
</if>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="currentPage"
|
||||
:page-sizes="[10, 15, 20, 25, 30, 35, 40, 45, 50]"
|
||||
:page-size="100"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="currentLen">
|
||||
</el-pagination>
|
||||
</div>
|
||||
<!-- 页面加载-->
|
||||
<el-dialog :title="dialogTitle"
|
||||
:visible.sync="showSetChild"
|
||||
:close-on-click-modal="false"
|
||||
:append-to-body="true"
|
||||
custom-class="small-dialog-content"
|
||||
:close-on-press-escape="false"
|
||||
:before-close="closeChild"
|
||||
:show-close="true"
|
||||
:center="true"
|
||||
width="60%"
|
||||
:modal="false"
|
||||
>
|
||||
<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 {
|
||||
currentPage: 1,
|
||||
currentLimit: 10,
|
||||
currentLen: 0,
|
||||
warehouseList: [],
|
||||
loading: true,
|
||||
dialogTitle: '',
|
||||
showSetChild: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//初始化表格信息
|
||||
getData: function () {
|
||||
var that = this;
|
||||
that.loading = true;
|
||||
$.ajax({
|
||||
url: "{:U(warehouseList)}",
|
||||
type: 'POST',
|
||||
data: {
|
||||
page: this.currentPage,
|
||||
limit: this.currentLimit,
|
||||
},
|
||||
success: function (res) {
|
||||
if (res.status == 1) {
|
||||
that.loading = false;
|
||||
that.warehouseList = [];
|
||||
that.warehouseList = res.data;
|
||||
that.$nextTick(function () {
|
||||
that.currentLen = parseInt(res.count);
|
||||
})
|
||||
} else {
|
||||
that.$message({
|
||||
type: 'error',
|
||||
message: res.msg,
|
||||
duration: 1500
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSizeChange: function (val) {
|
||||
this.currentLimit = val;//切换每页数量
|
||||
this.currentPage = 1;
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange: function (val) {
|
||||
this.currentPage = val;
|
||||
this.getData();//切换页数
|
||||
},
|
||||
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;
|
||||
});
|
||||
});
|
||||
},
|
||||
//删除
|
||||
delWarehouse: function (id) {
|
||||
var that = this;
|
||||
this.$confirm('确认删除此操作, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
that.loading = true;
|
||||
$.ajax({
|
||||
url: "{:U('deleteWarehouseOperation')}",
|
||||
data: {id: id},
|
||||
type: "post",
|
||||
success: function (res) {
|
||||
if (res.status === 1) {
|
||||
that.$message({
|
||||
type: "success",
|
||||
message: res.msg,
|
||||
duration: 1000,
|
||||
onClose: function () {
|
||||
that.loading = false;
|
||||
that.getData();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.$message({
|
||||
type: "error",
|
||||
message: res.msg,
|
||||
duration: 1000,
|
||||
onClose: function () {
|
||||
that.loading = false;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.getData();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
在新工单中引用
屏蔽一个用户