Commit 24970fbd by 杨树贤

订单备注页面

parent aa0ff2dd
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin', 'laydate', 'xmSelect'], function () {
let admin = layui.admin;
let form = layui.form;
let table = layui.table;
let layDate = layui.laydate;
let element = layui.element;
let xmSelect = layui.xmSelect;
form.on('checkbox(cn_filter)', function (data) {
if (data.elem.checked === true) {
$('#cn_max').val(9999999);
}
});
form.on('checkbox(hk_filter)', function (data) {
if (data.elem.checked === true) {
$('#hk_max').val(9999999);
}
});
//渲染主营品牌的多选
function getExcludeBrandOption(element, idName = 'exclude_main_brands') {
return {
el: '#' + element,
filterable: true,
paging: true,
height: '250px',
size: 'mini',
direction: 'auto',
autoRow: true,
prop: {
name: 'brand_name',
value: 'brand_id',
},
remoteSearch: true,
pageRemote: true,
template({item, sels, name, value}) {
return item.brand_name + '<span style="position: absolute; right: 10px; color: #8799a3">' + item.mapping_brand_names + '</span>'
},
filterMethod: function (val, item, index, prop) {
},
pageSize: 30,
remoteMethod: function (val, cb, show, pageIndex) {
//val: 搜索框的内容, 不开启搜索默认为空, cb: 回调函数, show: 当前下拉框是否展开, pageIndex: 当前第几页
$.ajax({
url: '/api/common/getStandardBrandList',
type: 'post',
data: {
brand_name: val,
page: pageIndex
},
dataType: 'json',
timeout: 10000,
success: function (res) {
if (!res) return layer.msg('网络错误,请重试', {icon: 5});
if (res.err_code === 0) {
cb(res.data, res.last_page);
} else {
layer.msg(res.err_msg, {icon: 6});
}
},
error: function () {
return layer.msg('网络错误,请重试', {icon: 5});
}
});
},
on: function (data) {
let arr = data.arr;
let excludeBrandIds = '';
for (let i in arr) {
excludeBrandIds += arr[i].brand_id + ',';
}
$('#' + idName).val(excludeBrandIds);
},
};
}
//主营品牌的渲染
let brandOption = getExcludeBrandOption('exclude_brand_selector');
let excludeBrandSelector = xmSelect.render(brandOption);
let excludeBrandIds = $('#exclude_main_brands').attr('value');
let excludeBrandInitValue = {!! json_encode($exclude_brand_init_value?:[])!!};
excludeBrandSelector.setValue(excludeBrandInitValue);
//批量新增主营品牌
$('#batchAddExcludeMainBrands').click(function () {
layer.open({
title: "批量增加主营品牌",
area: ['600px', '400px'],
type: 1,
content: $('#batchAddExcludeMainBrandsDiv')
});
});
$('#confirmBatchAddExcludeMainBrands').click(function () {
let brandValue = excludeBrandSelector.getValue();
console.log(brandValue);
let standardBrandNames = $('#batchAddExcludeMainBrandsTextarea').val();
//请求接口获取返回的数据,并且合并目前选择的主营品牌,重新渲染xm-select
let res = ajax('/api/supplier/getBatchAddExcludeMainBrandsData', {standard_brand_names: standardBrandNames});
let data = res.data;
let brandNames = arrayColumn(data, 'brand_name').join(',')
$('#batchAddExcludeMainBrandsBlockQuote').text(brandNames);
if (data.length === 0) {
layer.msg('没有匹配到有效的标准品牌', {icon: 5});
return false;
} else {
brandValue = brandValue.concat(data);
brandValue = multiArrayUnique(brandValue);
excludeBrandSelector.setValue(brandValue);
$('#exclude_main_brands').val(arrayColumn(brandValue, 'brand_id').join(','));
$('#batchAddExcludeMainBrandsTextarea').val('');
$('#batchAddExcludeMainBrandsBlockQuote').text('');
layer.msg('批量添加主营品牌成功', {icon: 6});
}
});
$('#closeBatchAddExcludeMainBrands').click(function () {
$('#batchAddExcludeMainBrandsTextarea').val('');
$('#batchAddExcludeMainBrandsBlockQuote').text('');
layer.closeAll();
});
table.render({
elem: '#purchaseRemarkList',
url: '/api/purchase_remark/GetPurchaseRemarkList',
method: 'get',
cellMinWidth: 80,//全局定义常规单元格的最小宽度
where: {
supplier_id: getQueryVariable("supplier_id")
},
loading: true,
first: true,//不显示首页
last: false,//不显示尾页
cols: [[
{field: 'participate_type_name', title: '参与类型', align: 'center', width: 140},
{field: 'participate_content', title: '传真', align: 'center', width: 140},
{field: 'duration', title: '开始时间 - 截至时间', align: 'center', width: 300},
{field: 'remark', title: '备注内容', align: 'center'},
]],
id: 'purchaseRemarkList',
page: {},
});
//新增联系方式
$("#savePurchaserRemark").click(function () {
let supplierId = getQueryVariable('supplier_id');
layer.open({
type: 2,
content: '/purchase_remark/SavePurchaseRemark?view=iframe&supplier_id=' + supplierId,
area: ['800px', '725px'],
title: '新增采购备注',
end: function () { // 监听弹窗关闭
table.reload('purchaseRemarkList');
}
});
})
});
</script>
\ No newline at end of file
......@@ -133,6 +133,12 @@
@endif
id="examination">检测记录
</li>
<li @if (!checkPerm('ViewOrderRemark')) style="display: none" @endif
@if(request()->get('tab')=='order_remark')
class="layui-this"
@endif
id="order_remark">下单备注
</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item
......@@ -229,11 +235,13 @@
<hr/>
</div>
</div>
{{--联系人--}}
<div class="layui-tab-item @if(request()->get('tab')=='contact') layui-show @endif">
<div @if(!checkPerm('ViewSupplierContact'))style="display: none"@endif>
@include('web.supplier.SupplierContact')
</div>
</div>
{{--特殊规则--}}
<div class="layui-tab-item @if(request()->get('tab')=='ruler') layui-show @endif">
<div
@if(!checkPerm('ViewRuler') || !checkPerm('UpdateRuler'))
......@@ -242,13 +250,19 @@
@include('web.supplier.SupplierRuler')
</div>
</div>
{{--sku规则--}}
<div class="layui-tab-item @if(request()->get('tab')=='sku_ruler') layui-show @endif">
@include('web.supplier.SkuRuler')
</div>
{{--iqc记录--}}
<div class="layui-tab-item @if(request()->get('tab')=='examination') layui-show @endif">
@include('web.SupplierExaminationList')
</div>
</div>
{{--下单备注--}}
<div class="layui-tab-item @if(request()->get('tab')=='order_remark') layui-show @endif">
@include('web.supplier.OrderRemark')
</div>
</div>
</div>
@include('web.supplier.ApplyAuditReason')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment