Commit d2e39eed by 朱继来

merge

parents d22cb187 1684b763
......@@ -70,207 +70,6 @@ class WebController extends Controller
return view('errors.error',$data);
}
//询价列表--我的
private function InquiryListMy($request,$data,$id){
$data['title']='我的询价列表';
$data["status"] = InquiryMap::$status;
$data["id"] = "InquiryList";
$data["types"] = 1;
return view('web',$data);
}
//询价列表-已关闭的
private function InquiryListClose($request,$data,$id){
$data['title']='已关闭的询价列表';
$data["status"] = InquiryMap::$status;
$data["id"] = "InquiryList";
$data["types"] = 2;
return view('web',$data);
}
//询价列表-所有的
private function InquiryListAll($request,$data,$id){
$data['title']='所有询价列表';
$data["status"] = InquiryMap::$status;
$data["id"] = "InquiryList";
$data["types"] = 3;
return view('web',$data);
}
//新增询价
private function AddInquiry($request,$data,$id){
$data['title']='新增询价';
#先给当前用户生成一条草稿数据
$data["inquiry_id"] = (new InquiryModel())->FindInquiryId($this->login_user_id,$this->login_user_name);
return view('web',$data);
}
//新增询价弹窗
private function PureAddInquiry($request,$data,$id){
$inquiry_items_id = @$_REQUEST["inquiry_items_id"];
if ($inquiry_items_id > 0){
$info = (new InquiryItemsModel())->where("id",$inquiry_items_id)->first()->toArray();
$assign = (new InquiryItemsAssignModel())->where("inquiry_items_id",$inquiry_items_id)->get();
if ($assign){
$assign = $assign->toArray();
foreach ($assign as $k=>$v){
$info["pur_init"] = json_encode([["value"=>$v["assign_uid"],"name"=>$info["assign_name"],"selected"=>true]]);
}
}
$info["sku_init"] = json_encode([["value"=>$info["goods_name"],"name"=>$info["goods_name"],"selected"=>true]]);
$info["brand_init"] = json_encode([["value"=>$info["brand_id"],"name"=>$info["brand_name"],"selected"=>true]]);
$data["info"] = $info;
}
$data['title'] = $inquiry_items_id > 0 ? '修改询价': '新增询价';
return view('window', $data);
}
//询价单详情
private function InquiryDetail($request,$data,$id){
$data['title'] = '询价单详情';
if (empty(@$_GET["inquiry_id"])){
exit("询价单id不得为空");
}
$inquiry_id = $_GET["inquiry_id"];
#询价详情
$data["itemsDetail"] = (new InquiryModel())->where("id",$inquiry_id)->first()->toArray();
return view('web', $data);
}
//询价明细报价详情
private function InquiryItemsDetail($request,$data,$id){
$data['title'] = '询价明细详情';
if (empty(@$_GET["inquiry_items_id"])){
exit("询价单明细id不得为空");
}
$inquiry_items_id = $_GET["inquiry_items_id"];
#询价详情
$data["itemsDetail"] = (new InquiryItemsModel())->ItemsDetail($inquiry_items_id);
#报价信息
$quoteData = (new QuoteModel())->ItemsListGroup($inquiry_items_id);
$data["dataSure"] = $quoteData["dataSure"];
$data["dataCheck"] = $quoteData["dataCheck"];
$data["dataDelete"] = $quoteData["dataDelete"];
$data["dataReady"] = $quoteData["dataReady"];
return view('web', $data);
}
//生成报价单
private function AddReportOffer($request,$data,$id){
$data['title'] = '生成报价单';
if (empty(@$_GET["inquiry_id"])){
exit("询价单id不得为空");
}
$inquiry_id = $_GET["inquiry_id"];
#询价详情
$data["inquiry_id"] = $inquiry_id;
$data["itemsArr"] = (new InquiryItemsModel())->ItemsOfferDetail($inquiry_id);
return view('web', $data);
}
//生成销售单
private function AddReportSale($request,$data,$id){
$data['title'] = '生成销售单';
if (empty(@$_GET["inquiry_items_id"])){
exit("询价单明细id不得为空");
}
$inquiry_items_id = $_GET["inquiry_items_id"];
#询价详情
$data["itemsDetail"] = (new InquiryItemsModel())->ItemsDetail($inquiry_items_id);
#报价信息
$quoteData = (new QuoteModel())->ItemsListGroup($inquiry_items_id);
$data["dataSure"] = $quoteData["dataSure"];
$data["dataCheck"] = $quoteData["dataCheck"];
$data["dataDelete"] = $quoteData["dataDelete"];
$data["dataReady"] = $quoteData["dataReady"];
return view('web', $data);
}
// 报价管理 - 询价池
public function InquiryPool($request, $data, $id)
{
$data['title'] = '询价池';
$perm = new PermController;
$data['sale_list'] = $perm->getUserByDepartmentId(7);
return view('web', $data);
}
// 报价管理 - 已领取的询价
public function TakedInquiry($request, $data, $id)
{
$data['title'] = '已领取的询价';
$perm = new PermController;
$data['sale_list'] = $perm->getUserByDepartmentId(7); // 销售部门所有人员
return view('web', $data);
}
// 报价管理 - 我的报价
public function QuoteList($request, $data, $id)
{
$data['title'] = '我的报价';
return view('web', $data);
}
// 报价管理 - 所有报价
public function AllQuote($request, $data, $id)
{
$data['title'] = '所有报价';
$perm = new PermController;
$data['pur_list'] = $perm->getUserByDepartmentId(8); // 采购部门所有人员
return view('web', $data);
}
// 报价管理 - 报价详情
public function QuoteDetails($request, $data, $id)
{
$quote_id = $request->input('id', 0);
if (!$quote_id) return redirect('/web/QuoteList');
$data['title'] = '报价详情';
$QuoteModel = new QuoteModel;
$InquiryModel = new InquiryModel;
$InquiryItemsModel = new InquiryItemsModel;
$OpLogModel = new OpLogModel;
$data['quote_info'] = $QuoteModel->find($quote_id);
$data['inquiry_info'] = $InquiryModel->find($data['quote_info']['inquiry_id']);
$data['inquiry_items_info'] = $InquiryItemsModel->find($data['quote_info']['inquiry_items_id']);
$data['action_log'] = $OpLogModel->where(['types'=>2, 'relation_id'=>$quote_id])->orderBy('id', 'desc')->get(); // 操作日志
$data["sku_init"] = json_encode([["value"=>$data['quote_info']["goods_name"],"name"=>$data['quote_info']["goods_name"],"selected"=>true]]);
$data["brand_init"] = json_encode([["value"=>$data['quote_info']["brand_id"],"name"=>$data['quote_info']["brand_name"],"selected"=>true]]);
$data["supplier_init"] = json_encode([["value"=>$data['quote_info']["supplier_id"],"name"=>$data['quote_info']["supplier_name"],"selected"=>true]]);
return view('web', $data);
}
// 报价管理 - 新增报价
public function AddQuote($request, $data, $id)
{
$inquiry_item_id = $request->input('inquiry_item_id', 0);
if (!$inquiry_item_id) return redirect('/web/QuoteList');
$data['title'] = '新增报价';
$InquiryModel = new InquiryModel;
$InquiryItemsModel = new InquiryItemsModel;
$data['inquiry_items_info'] = $InquiryItemsModel->find($inquiry_item_id);
$data['inquiry_info'] = $InquiryModel->find($data['inquiry_items_info']['inquiry_id']);
return view('web', $data);
}
}
......@@ -189,17 +189,24 @@ class InquiryItemsModel extends Model
if (empty($b["batch"])) return [1003, "请输入批次要求"];
if (empty($b["delivery_time"])) return [1003, "请选择交货日期"];
try{
$con = DB::connection('rfq');
$con->beginTransaction();
#插入明细
$brandInfo = json_decode($b["brand_s"],true);
$check = $this->where(["inquiry_id"=>$b["inquiry_id"],"goods_name"=>$b["goods_name"],"brand_name"=>$brandInfo[0]["name"]])->count();
if ($check >0){
throw new Exception("已存在重复此型号品牌!");
}
$insertArr= [
"inquiry_id"=>$b["inquiry_id"] ,
"goods_name"=>@$b["goods_name"] ? $b["goods_name"] : "" ,
"brand_id"=>@$brandInfo[0]["brand_id"],
"brand_name"=>@$brandInfo[0]["brand_name"],
"brand_id"=>@$brandInfo[0]["value"],
"brand_name"=>@$brandInfo[0]["name"],
"class_id2"=>@$b["class_id2"] ? $b["class_id2"] : 0 ,
"class_id2_name"=>@$b["class_id2_name"] ? $b["class_id2_name"] : "" ,
"inquiry_number"=>@$b["inquiry_number"] ? $b["inquiry_number"] :0 ,
......@@ -531,6 +538,11 @@ class InquiryItemsModel extends Model
if (empty($input["delivery_time"])) return [1003, "请选择交货日期"];
$brandInfo = json_decode($input["brand_s"],true);
$check = $this->where(["inquiry_id"=>$input["inquiry_id"],"goods_name"=>$input["goods_name"],"brand_name"=>$brandInfo[0]["name"]])->count();
if ($check >0){
return [1003, "重复数据,已存在此型号品牌"];
}
$check = $this
->select("inquiry_id")
->where(["goods_name"=>$input["goods_name"],"inquiry_number"=>$input["inquiry_number"],"brand_name"=>$brandInfo[0]["brand_name"]])
......@@ -538,7 +550,7 @@ class InquiryItemsModel extends Model
if ($check){
$user_name = (new InquiryModel())->where("id",$check->inquiry_id)->value("user_name");
return [1001,"此型号 ".$user_name." 在询,仍然询价吗?"];
return [2001,"此型号 ".$user_name." 在询,仍然询价吗?"];
}
return [0,"通过"];
}
......
......@@ -57,8 +57,8 @@ class InquiryItemsReportModel extends Model
"inquiry_number"=>@$input["inquiry_number"][$k] ? $input["inquiry_number"][$k] : "" ,
"delivery_time"=>@$input["delivery_time"][$k] ? $input["delivery_time"][$k] : "" ,
"batch"=>@$input["batch"][$k] ? $input["batch"][$k] : "" ,
"create_uid"=>$input["user_id"],
"create_name"=>$input["user_name"],
"quote_uid"=>$input["user_id"],
"quote_name"=>$input["user_name"],
"create_time"=>time() ,
];
......
......@@ -145,31 +145,11 @@ class InquiryModel extends Model
->where("inquiry_items_id", $v["id"])
->whereIn("status", QuoteMap::$status_used)
->orderby("status","desc")
->get();
->orderby("price_rmb","asc")
->first();
if ($quote){
$quoteArr = $quote->toArray();
$checkPrice = 0; //rmb 为准
$lowerPrice = "";
foreach ($quoteArr as $a=>$b){
if ($b["status"] == 3){ #已确认
$lowerPrice = $b["currency"] == 1 ? "¥".$b["price_rmb"]:"$".$b["price_origin"];
break;
}
if ($b["status"] == 2){ #已选中
$lowerPrice = $b["currency"] == 1 ? "¥".$b["price_rmb"]:"$".$b["price_origin"];
break;
}
$price = $b["currency"] == 1 ? $b["price_rmb"] : $b["price_origin"]*6.5;
if ($checkPrice == 0){
$checkPrice = $price;
$lowerPrice = $b["currency"] == 1 ? "¥".$b["price_rmb"]:"$".$b["price_origin"];
}elseif ($price < $lowerPrice){
$checkPrice = $price;
$lowerPrice = $b["currency"] == 1 ? "¥".$b["price_rmb"]:"$".$b["price_origin"];
}
}
$b = $quote->toArray();
$lowerPrice = $b["currency"] == 1 ? "¥".$b["price_rmb"]:"$".$b["price_origin"];
$v["quote_price"] = $lowerPrice;
}
......
......@@ -41,8 +41,10 @@ class QuoteModel extends Model
$list = $this
->where("inquiry_items_id",$input["inquiry_items_id"])
->orderBy('status','desc')
->orderBy('price_rmb','asc')
->whereNotIn("status",[-1,0])
->paginate(@$input['limit'] ? $input["limit"] : 10, ['*'], 'p', @$input['p'] ? $input["p"] : 1)->toArray();
->paginate(@$input['limit'] ? $input["limit"] : 10, ['*'], 'p', @$input['p'] ? $input["p"] : 1)
->toArray();
if (!$list) return [20001, '没有数据'];
foreach ($list['data'] as $k=>&$v){
$v["price_origin"] = $v["currency"] == 2 ? "$".$v["price_origin"] : "--";
......@@ -793,12 +795,19 @@ class QuoteModel extends Model
$QuoteModel = new QuoteModel();
$InquiryItemsModel = new InquiryItemsModel();
$info = $QuoteModel->select("inquiry_items_id")->where("id",$quote_id)->first()->toArray();
$info = $QuoteModel->select("status","inquiry_items_id")->where("id",$quote_id)->first()->toArray();
$inquiry_items_id = $info["inquiry_items_id"];
#更新询价明细表状态
$InquiryItemsModel->where("id",$inquiry_items_id)->update(["status"=>2, 'update_time'=>time()]); #更新报价待报价
#更新
$QuoteModel->where("inquiry_items_id",$inquiry_items_id)->update(["status"=>1, 'update_time'=>time()]); #重启其他所有状态为 已报价
if ($info["status"] == 2){ #撤销选中
$QuoteModel->where("inquiry_items_id",$inquiry_items_id)->whereNotIn("status",[-1,0,3])
->update(["status"=>1, 'update_time'=>time()]); #重启其他所有状态为 已报价
}
if ($info["status"] == 3){ #撤销确认
$QuoteModel->where("inquiry_items_id",$inquiry_items_id)->whereNotIn("status",[-1,0,2])
->update(["status"=>1, 'update_time'=>time()]); #重启其他所有状态为 已报价
}
$data = [];
$data['types'] = 1;
......
layui.config({
//base: '/js/web/'
}).extend({
opTable: '/js/web/opTable/opTable'
}).use(['opTable','form','element','layer','laydate'], function () {
var table = layui.table;
var element = layui.element;
var form = layui.form;
var laydate = layui.laydate;
var opTable = layui.opTable.render({
elem: '#list'
, id: '#list'
, url: '/api/ApiInquiryList'
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
},
page :{
layout: [ 'prev', 'page', 'next','count',] //自定义分页布局
,groups: 1 //只显示 1 个连续页码
,first: false //不显示首页
,last: false //不显示尾页
}
, cols: [[
{field:'inquiry_sn', title: '询价单号',width:120,align:'center'},
{field:'goods_name', title: '询价型号',width:200,align:'center'},
{field:'brand_name', title: '询价品牌',width:120,align:'center'},
{field:'inquiry_number', title: '询价数量',width:120,align:'center'},
{field:'customer_name', title: '询价客户',width:120,align:'center'},
{field:'create_time', title: '询价时间',width:200,align:'center'},
{field:'target_price', title: '客户目标价',width:120,align:'center'},
{field:'replay_price', title: '报价',width:120,align:'center'},
{field:'status', title: '状态',width:120,align:'center'},
{field:'main', title: '操作',templet:'#main',width:200,align:'center', fixed: 'right'}
]],
/**
* 展开显示表格 参数支持layui所有参数
* @param itemData 当前行数据
* @returns 支持 layui table 的所有配置参数
* 说明子表的 lay-filter='filter' 值与ID参数相同(去掉 # .)
*/
openTable: function (itemData) {
return {
// 由于同时支持展开多个表格 组装唯一的id
elem: '#child' + itemData.LAY_INDEX
, id: 'child' + itemData.LAY_INDEX
, url: '/api/ApiQuoteItemsList'
, page: true
, where: {inquiry_items_id: itemData.id}
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
}
,page :{
layout: [ 'prev', 'page', 'next','count',] //自定义分页布局
,groups: 1 //只显示 1 个连续页码
,first: false //不显示首页
,last: false //不显示尾页
}
, openVisible: false
, cols: [[
{field: 'price_origin', title: '单价'},
{field: 'price_rmb', title: '含税价格'},
{field: 'price_other', title: '采购费'},
{field: 'batch', title: '批次'},
{field: 'quote_number', title: '报价数量'},
{field: 'create_name', title: '报价人'},
{field: 'create_time', title: '报价时间'},
{field: 'status', title: '状态'},
{title: '操作', toolbar: '#son', width: 150}
]]
}
}
});
//重新查
form.on('submit(load)', function(data){
form.render();
var data=data.field
//执行重载
opTable.reload('list', {
page: {
curr: 1
}
,where: data
});
return false;
});
//新增单个询价弹窗
$('#addOne').click(function(){
layer.open({
scrollbar: false,
type:2
,area: ['800px', '400px']
,title: '新增询价'
,content: '/web/PureAddInquiry?inquiry_id='+$("#inquiry_id").val()
});
return false;
});
//提交
$(".sumbit").on('click',function () {
var res = ajax("/api/ApiDeleteInquiryItems", { "inquiry_id":$("#inquiry_id").val(),})
if(res.errcode >0 ){
alert_err(res.errmsg)
}else{
alert_succ(res.errmsg,function () {
window.parent.layer.closeAll('iframe')
})
}
return false;
})
});
layui.use(['form', 'element'], function(){
var form = layui.form;
var element = layui.element;
//sku搜索
var skuSelect = xmSelect.render({
el: '#skuSelect',
autoRow: false,
radio:true,
toolbar: { show: false },
remoteSearch: true,
filterable: true,
clickClose: true,
remoteMethod: function(val, cb, show){
//这里如果val为空, 则不触发搜索
if(!val){
return cb([]);
}
$.ajax({
url: '/api/ApiSkuList',
type: 'get',
data: {
k: val,
},
dataType: 'json',
timeout: 10000,
success: function (res) {
cb(res)
},
error: function () {
return layer.msg('网络错误,请重试', {icon: 5});
}
});
}
,on: function (data) {
var arr = data.arr
if (arr.length == 0){
console.log("数组为空")
}else {
console.log(data.arr)
console.log(data.arr[0].name)
$("#goods_name").val(data.arr[0].name);
}
}
})
//品牌搜索
var brandSelect = xmSelect.render({
el: '#brandSelect',
autoRow: false,
radio:true,
toolbar: { show: false },
remoteSearch: true,
filterable: true,
clickClose: true,
remoteMethod: function(val, cb, show){
//这里如果val为空, 则不触发搜索
if(!val){
return cb([]);
}
$.ajax({
url: '/api/ApiBrandList',
type: 'get',
data: {
k: val,
},
dataType: 'json',
timeout: 10000,
success: function (res) {
cb(res)
},
error: function () {
return layer.msg('网络错误,请重试', {icon: 5});
}
});
}
,on: function (data) {
var arr = data.arr
if (arr.length == 0){
console.log("数组为空")
}else {
// var json = [];
// var j = {};
// j.brand_id = data.arr[0].value;
// j.brand_name = data.arr[0].name;
// json.push(j);
// var brand = JSON.stringify(json);
// console.log(brand)
$("#brand_id").val(data.arr[0].value);
$("#brand_name").val(data.arr[0].name);
}
}
})
// 供应商搜索
var supplierSelect = xmSelect.render({
el: '#supplierSelect',
autoRow: false,
radio:true,
toolbar: { show: false },
remoteSearch: true,
filterable: true,
clickClose: true,
remoteMethod: function(val, cb, show){
//这里如果val为空, 则不触发搜索
if(!val){
return cb([]);
}
$.ajax({
url: '/api/ApiSupplierList',
type: 'get',
data: {
k: val,
},
dataType: 'json',
timeout: 10000,
success: function (res) {
cb(res)
},
error: function () {
return layer.msg('网络错误,请重试', {icon: 5});
}
});
}
,on: function (data) {
var arr = data.arr
if (arr.length == 0){
console.log("数组为空")
}else {
$("#supplier_id").val(data.arr[0].value);
$("#supplier_name").val(data.arr[0].name);
}
}
})
// 监听币种
form.on('select(currency)', function(data) {
if (data.value == 2) {
$('.price-section').hide();
} else {
$('.price-section').show();
}
})
// 单价校验
$('.price').keyup(function() {
var val = $(this).val();
var reg = /^\d{0,6}(\.\d{0,6})?$/g;
if (!val) return false;
if(!(reg.test(val))){//判断输入是否合法
if (isNaN(parseFloat(val))) {
layer.msg('只能是数字和小数组成');
$(this).val('');
} else {
$(this).val(parseFloat($(this).val()).toFixed(6));
}
return false;
}
if (val < 0) {
layer.msg('只能是正整数');
$(this).val('');
return false;
}
if (val > 999999.999999) {
val = 999999.999999;
}
if (val.length > 13) {
val = val.slice(0, 13);
}
$(this).val(val);
var currency = $('.currency').val();
if (currency == 1) { // 人民币
var tax_rate = parseFloat($('.tax-rate').text());
var tax_price = parseFloat(val * (1 + tax_rate)).toFixed(6);
$('.price_rmb').val(tax_price);
}
})
// 报价有效期
$('.effect_days').keyup(function() {
var val = $(this).val();
var reg = /\d/;
if (!val) return false;
if (!(reg.test(val))) {
layer.msg('只能是数字');
$(this).val('');
return false;
}
})
// 采购费校验
$('.price_other').keyup(function() {
var val = $(this).val();
var reg = /^\d{0,10}(\.\d{0,2})?$/g;
if (!val) return false;
if(!(reg.test(val))){//判断输入是否合法
if (isNaN(parseFloat(val))) {
layer.msg('只能是数字和小数组成');
$(this).val('');
} else {
$(this).val(parseFloat($(this).val()).toFixed(2));
}
return false;
}
if (val < 0) {
layer.msg('只能是正整数');
$(this).val('');
return false;
}
if (val > 9999999999.99) {
val = 9999999999.99;
}
if (val.length > 13) {
val = val.slice(0, 13);
}
$(this).val(val);
})
// 新增报价
// $('.add-quote').click(function() {
// 保存
form.on('submit(save)', function(data) {
var goods_name = $('#goods_name').val();
var brand_id = $('#brand_id').val();
var supplier_id = $('#supplier_id').val();
if (!goods_name) {
layer.msg('请选择报价型号');
return false;
}
if (!brand_id) {
layer.msg('请选择报价品牌');
return false;
}
if (!supplier_id) {
layer.msg('请选择供应商');
return false;
}
layer.open({
area: ['300px'],
title: '新增报价',
content: '确定新增报价吗?',
btn: ['确认', '取消'],
yes: function(index) {
var datax = $('.quoteForm').serialize();
$.ajax({
url : '/api/ApiAddQuote',
type: 'post',
data: datax,
dataType: 'json',
success: function(resp) {
if (resp.errcode == 0) {
layer.close(index);
layer.msg(resp.errmsg);
// window.location.reload();
layer.confirm('恭喜,报价成功!', {
btn: ['继续新增', '返回询价池', '返回我的报价'] //可以无限个按钮
,btn3: function(index, layero){
//按钮【按钮三】的回调
window.location.href = '/web/QuoteList';
}
}, function(index, layero){
//按钮【按钮一】的回调
window.location.reload();
}, function(index){
//按钮【按钮二】的回调
window.location.href = '/web/InquiryPool';
});
return false;
}
layer.msg(resp.errmsg);
},
error: function(err) {
console.log(err)
}
})
// layer.msg('新增报价中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
return false;
},
cancel: function(index) {
layer.close(index);
}
})
return false;
})
});
\ No newline at end of file
layui.config({
//base: '/js/web/'
}).extend({
opTable: '/js/web/opTable/opTable'
}).use(['opTable','form','element','layer','laydate'], function () {
var table = layui.table;
var element = layui.element;
var form = layui.form;
var laydate = layui.laydate;
var opTable = layui.opTable.render({
elem: '#list'
, id: '#list'
, url: '/api/ApiInquiryList'
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
},
where:{
types:$('input[name=types]').val(),
inquiry_id:$('#inquiry_id').val()
},
page :{
layout: ['prev', 'page', 'next','count',] //自定义分页布局
,groups: 1 //只显示 1 个连续页码
,first: false //不显示首页
,last: false //不显示尾页
}
, cols: [[
{field:'inquiry_sn', title: '询价单号',width:190,align:'center',templet: function(d){
return '<a class="layui-icon " href="/web/InquiryDetail?inquiry_id='+d.inquiry_id+'" target="_blank" style="cursor:pointer;font-size: 14px; color: #666;"> '+d.inquiry_sn+'&nbsp;&#xe623</a>'
}},
{field:'goods_name', title: '询价型号',align:'center'},
{field:'brand_name', title: '询价品牌',align:'center'},
{field:'inquiry_number', title: '询价数量',align:'center'},
{field:'customer_name', title: '询价客户',align:'center'},
{field:'target_price', title: '客户目标价',align:'center'},
{field:'quote_price', title: '报价',align:'center'},
{field:'status_val', title: '状态',align:'center'},
{field:'create_time', title: '询价时间',width:170,align:'center'},
{field:'main', title: '操作',templet:'#main',width:230,align:'center'}
]],
});
//监听单元格编辑
table.on('edit(test3)', function(obj){
var value = obj.value //得到修改后的值
,data = obj.data //得到所在行所有键值
,field = obj.field; //得到字段
layer.msg('[ID: '+ data.id +'] ' + field + ' 字段更改为:'+ value);
});
//提交(新增修改)
$("#sumbit").on('click',function () {
var res = ajax("/api/ApiAddInquiryReport", $("#forma").serialize())
if(res.errcode >0 ){
alert_err(res.errmsg)
}else{
alert_succ(res.errmsg,function () {
window.parent.layer.closeAll('iframe')
})
}
return false;
})
//新增单个询价物料
$('#addOne').click(function(){
layer.open({
scrollbar: false,
type:2
,area: ['800px', '400px']
,title: '新增询价'
,content: '/web/PureAddInquiry?inquiry_id='+$("#inquiry_id").val()
});
return false;
});
});
layui.use(['form', 'table', 'laydate'], function(){
var form = layui.form;
var table = layui.table;
var laydate = layui.laydate;
laydate.render({
elem: '#start_time' //指定元素
});
laydate.render({
elem: '#end_time' //指定元素
});
var renderTable = function () {
table.render({
id: 'list'
,elem: '#list'
,url: '/api/ApiQuoteList' //数据接口
,method:'post'
,cellMinWidth: 80 //全局定义常规单元格的最小宽度
,page: true //开启分页
,where: {
type: 2
}
,cols: [[ //表头
{title: '序号', type: 'numbers', fixed: 'left', width: 80}
,{field: 'inquiry_sn', title: '询价单号', width: 200}
,{field: 'goods_name', title: '询价型号', width: 200}
,{field: 'brand_name', title: '询价品牌', width: 150}
,{field: 'inquiry_number', title: '询价数量', width: 150}
,{field: 'quote_sn', title: '报价单号', width: 200}
,{field: 'supplier_name', title: '供应商名称', width: 240}
,{field: 'price', title: '报价价格', width: 150}
,{field: 'quote_number', title: '报价数量', width: 150}
,{field: 'create_time', title: '报价时间', width: 170}
,{field: 'create_name', title: '报价制单人', width: 120}
,{field: 'quote_info', title: '所有报价情况', width: 170}
,{field: 'status_val', title: '状态', width: 120}
,{title: '操作', align:'center', fixed: 'right', toolbar: '#list_action', width: 218}
]]
,limit: 10
,limits: [10, 20, 50,]
});
};
renderTable();
form.on('submit(load)', function(data) {
//执行重载
table.reload('list', {
page: {
curr: 1
}
,where: data.field
});
return false;
});
});
\ No newline at end of file
layui.config({
//base: '/js/web/'
}).extend({
opTable: '/js/web/opTable/opTable'
}).use(['opTable','form','element','layer','laydate'], function () {
var table = layui.table;
var element = layui.element;
var form = layui.form;
var laydate = layui.laydate;
var opTable = layui.opTable.render({
elem: '#list'
, id: '#list'
, url: '/api/ApiInquiryList'
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
},
where:{
types:$('input[name=types]').val(),
inquiry_id:$('#inquiry_id').val()
},
page :{
layout: ['prev', 'page', 'next','count',] //自定义分页布局
,groups: 1 //只显示 1 个连续页码
,first: false //不显示首页
,last: false //不显示尾页
}
, cols: [[
{field:'inquiry_sn', title: '询价单号',width:190,align:'center',templet: function(d){
return '<a class="layui-icon " href="/web/InquiryDetail?inquiry_id='+d.inquiry_id+'" target="_blank" style="cursor:pointer;font-size: 14px; color: #666;"> '+d.inquiry_sn+'&nbsp;&#xe623</a>'
}},
{field:'goods_name', title: '询价型号',align:'center'},
{field:'brand_name', title: '询价品牌',align:'center'},
{field:'inquiry_number', title: '询价数量',align:'center'},
{field:'customer_name', title: '询价客户',align:'center'},
{field:'target_price', title: '客户目标价',align:'center'},
{field:'quote_price', title: '报价',align:'center'},
{field:'status_val', title: '状态',align:'center'},
{field:'create_time', title: '询价时间',width:170,align:'center'},
{field:'main', title: '操作',templet:'#main',width:230,align:'center'}
]],
/**
* 展开显示表格 参数支持layui所有参数
* @param itemData 当前行数据
* @returns 支持 layui table 的所有配置参数
* 说明子表的 lay-filter='filter' 值与ID参数相同(去掉 # .)
*/
openTable: function (itemData) {
return {
// 由于同时支持展开多个表格 组装唯一的id
elem: '#child' + itemData.LAY_INDEX
, id: 'child' + itemData.LAY_INDEX
, url: '/api/ApiQuoteItemsList'
, page: true
, where: {inquiry_items_id: itemData.id}
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
}
,page :{
layout: [ 'prev', 'page', 'next','count',] //自定义分页布局
,groups: 1 //只显示 1 个连续页码
,first: false //不显示首页
,last: false //不显示尾页
}
, openVisible: false
, cols: [[
{field: 'price_origin', title: '单价'},
{field: 'price_rmb', title: '含税价格'},
{field: 'price_other', title: '采购费'},
{field: 'date_code', title: '批次'},
{field: 'quote_number', title: '报价数量'},
{field: 'create_name', title: '报价人'},
{field: 'create_time', title: '报价时间'},
{field: 'status', title: '状态'},
{field:'son', title: '操作',templet:'#main',width:230,align:'center'}
]]
}
}
});
//新增单个询价物料
$('#addOne').click(function(){
layer.open({
scrollbar: false,
type:2
,area: ['800px', '400px']
,title: '新增询价'
,content: '/web/PureAddInquiry?inquiry_id='+$("#inquiry_id").val()
});
return false;
});
//生成报价单
$('#AddReportOffer').click(function(){
window.location.href = "/web/AddReportOffer?inquiry_id="+$("#inquiry_id").val()
});
});
layui.use(['element','table','form','layer'], function(){
var element = layui.element,
table=layui.table,
form=layui.form;
layer = layui.layer;
//询价日志
table.render({
elem: '#inquiry_log'
,url:'/api/ApiOpLogList'
,method:'post'
,cellMinWidth: 100 //全局定义常规单元格的最小宽度
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
}
,loading:true
,where:{
relation_id:$('#inquiry_id').val(),
types: 1 //询价
}
,cols: [[
{field:'id', title: 'ID',align:'center'},
{field:'create_time', title: '操作时间',align:'center'},
{field:'create_name', title: '操作人',align:'center'},
{field:'content', title: '描述',align:'center'},
]]
,done: function(res, curr, count){
}
,id:'PurchaseList1'
,page:{
}
});
//报价日志
table.render({
elem: '#quote_log'
,url:'/api/ApiOpLogList'
,method:'post'
,cellMinWidth: 100 //全局定义常规单元格的最小宽度
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
}
,loading:true
,where:{
relation_id:$('#inquiry_items_id').val(),
types: 2 //报价
}
,cols: [[
{field:'id', title: 'ID',align:'center'},
{field:'create_time', title: '操作时间',align:'center'},
{field:'create_name', title: '操作人',align:'center'},
{field:'content', title: '描述',align:'center'},
]]
,done: function(res, curr, count){
}
,id:'PurchaseList2'
,page:{
}
});
//修改
$('#updateItem').click(function(){
layer.open({
scrollbar: true,
type:2
,area: ['900px', '600px']
,title: '新增询价'
,content: '/web/PureAddInquiry?inquiry_items_id='+$("#inquiry_items_id").val()
});
return false;
});
});
layui.config({
//base: '/js/web/'
}).extend({
opTable: '/js/web/opTable/opTable'
}).use(['opTable','form','element','layer','laydate'], function () {
var table = layui.table;
var element = layui.element;
var form = layui.form;
var laydate = layui.laydate;
var opTable = layui.opTable.render({
elem: '#list'
, id: '#list'
, url: '/api/ApiInquiryList'
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
},
where:{
types:$('input[name=types]').val(),
},
page :{
layout: ['prev', 'page', 'next','count',] //自定义分页布局
,groups: 1 //只显示 1 个连续页码
,first: false //不显示首页
,last: false //不显示尾页
}
, cols: [[
{field:'inquiry_sn', title: '询价单号',width:190,align:'center',templet: function(d){
return '<a class="layui-icon " href="/web/InquiryDetail?inquiry_id='+d.inquiry_id+'" target="_blank" style="cursor:pointer;font-size: 14px; color: #666;"> '+d.inquiry_sn+'&nbsp;&#xe623</a>'
}},
{field:'goods_name', title: '询价型号',align:'center'},
{field:'brand_name', title: '询价品牌',align:'center'},
{field:'inquiry_number', title: '询价数量',align:'center'},
{field:'customer_name', title: '询价客户',align:'center'},
{field:'target_price', title: '客户目标价',align:'center'},
{field:'quote_price', title: '报价',align:'center'},
{field:'status_val', title: '状态',align:'center'},
{field:'create_time', title: '询价时间',width:170,align:'center'},
{field:'main', title: '操作',templet:'#main',width:230,align:'center'}
]],
/**
* 展开显示表格 参数支持layui所有参数
* @param itemData 当前行数据
* @returns 支持 layui table 的所有配置参数
* 说明子表的 lay-filter='filter' 值与ID参数相同(去掉 # .)
*/
openTable: function (itemData) {
return {
// 由于同时支持展开多个表格 组装唯一的id
elem: '#child' + itemData.LAY_INDEX
, id: 'child' + itemData.LAY_INDEX
, url: '/api/ApiQuoteItemsList'
, page: true
, where: {inquiry_items_id: itemData.id}
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
}
,page :{
layout: [ 'prev', 'page', 'next','count',] //自定义分页布局
,groups: 1 //只显示 1 个连续页码
,first: false //不显示首页
,last: false //不显示尾页
}
, openVisible: false
, cols: [[
{field: 'price_origin', title: '单价'},
{field: 'price_rmb', title: '含税价格'},
{field: 'price_other', title: '采购费'},
{field: 'batch', title: '批次'},
{field: 'quote_number', title: '报价数量'},
{field: 'create_name', title: '报价人'},
{field: 'create_time', title: '报价时间'},
{field: 'status', title: '状态'},
{title: '操作', toolbar: '#son', width: 150}
]]
}
}
});
form.on('submit(load)', function(data){
form.render();
var data=data.field
//执行重载
opTable.reload('list', {
page: {
curr: 1
}
,where: data
});
return false;
});
laydate.render({
elem: '#end_time'
,type:'datetime'
,format:'yyyy-MM-dd HH:mm'
,isInitValue: false
});
laydate.render({
elem: '#start_time'
,type:'datetime'
,format:'yyyy-MM-dd HH:mm'
,isInitValue: false
});
form.on('checkbox(*)', function(data){
var status='';
$('input:checkbox:checked').each(function(){
var obj=$(this).data('type');
if(obj=='status'){
status +=$(this).val()+',';
}
})
$("input[name=status]").val(status);
});
element.on('collapse(where)', function(data){
if(data.show==true){
$(data.title).html('查询条件 (点击收起)<i class="layui-icon layui-colla-icon"></i>');
}else{
$(data.title).html('查询条件 (点击展开)<i class="layui-icon layui-colla-icon"></i>');
}
});
//关闭询价
$('#close').click(function(){
layer.confirm('确定关闭?', {
title: '关闭询价单'
,btn: ['确定', '取消']
}, function(){
var res = ajax('/api/ApiInquiryClose',$('#form1').serializeArray())
res.err_code > 0 ? alert_err(res.err_msg): alert_succ(res.err_msg,function () {
window.location.href = res.data
})
return false;
});
return false;
})
// 导出
$('#export').click(function(){
layer.confirm('确定导出数据吗?', {
title: '导出数据'
,btn: ['确定', '取消']
}, function(){
var res = ajax('/api/ApiInquiryExport',$('#form1').serializeArray())
res.err_code > 0 ? alert_err(res.err_msg): alert_succ(res.err_msg,function () {
window.location.href = res.data
})
return false;
});
return false;
})
});
layui.use(['form', 'table', 'laydate'], function(){
var form = layui.form;
var table = layui.table;
var laydate = layui.laydate;
laydate.render({
elem: '#start_time' //指定元素
});
laydate.render({
elem: '#end_time' //指定元素
});
var renderTable = function () {
table.render({
id: 'list'
,elem: '#pool'
,url: '/api/ApiInquiryListPool' //数据接口
,method:'post'
,cellMinWidth: 80 //全局定义常规单元格的最小宽度
,page: true //开启分页
,where: {
type: 1
}
,cols: [[ //表头
{title: '序号', type: 'numbers', fixed: 'left', width: 80}
,{field: 'inquiry_sn', title: '询价单号', width: 200}
,{field: 'goods_name', title: '询价型号', width: 200}
,{field: 'brand_name', title: '询价品牌', width: 150}
,{field: 'inquiry_number', title: '询价数量', width: 150}
,{field: 'target_price', title: '目标报价', width: 150}
,{field: 'create_name', title: '制单人', width: 150}
,{field: 'create_time', title: '询价时间', width: 170}
,{field: 'status_val', title: '状态', width: 120}
,{title: '操作', align:'center', fixed: 'right', toolbar: '#list_action', width: 218}
]]
,limit: 10
,limits: [10, 20, 50,]
});
};
renderTable();
form.on('submit(load)', function(data) {
//执行重载
table.reload('list', {
page: {
curr: 1
}
,where: data.field
});
return false;
});
// tool操作
table.on('tool(pool)', function(obj){ //注:tool是工具条事件名,test是table原始容器的属性lay-filter="对应的值"
var data = obj.data; //获得当前行数据
var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
var url = '';
var title = '';
var content = '';
var datax = {};
datax.id = data.id;
if(layEvent === 'take') {
url = '/api/ApiTakeInquiry';
title = '领取询价';
content = '确定领取该询价吗?';
}
layer.open({
title: title,
content: content,
btn: ['确认', '取消'],
yes: function(index) {
$.ajax({
url : url,
type: 'post',
data: datax,
dataType: 'json',
success: function(resp) {
if (resp.errcode == 0) {
layer.close(index);
layer.msg(resp.errmsg);
renderTable(); // 重新加载table
return false;
}
layer.msg(resp.errmsg);
},
error: function(err) {
console.log(err)
}
})
layer.msg(title+'中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
return false;
},
cancel: function(index) {
layer.close(index);
}
})
});
});
\ No newline at end of file
layui.use(['table','form','element','layer'], function() {
var table = layui.table;
var element = layui.element;
var form = layui.form;
table.render({
elem: '#list'
,url:'/api/ApiOperationLog'
,method:'post'
,cellMinWidth: 80 //全局定义常规单元格的最小宽度
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
},where:{
relevance_type:$("#relevance_type").val()
}
,loading:true
,first: true //不显示首页
,last: false //不显示尾页
,cols: [[
{field:'operation_id', title: 'ID',width:'5%',align:'center'}
,{field:'operation_type_name', title: '动作',width:'5%',align:'center'}
,{field:'relevance_type_name', title: '类型',width:'15%',align:'center'}
,{field:'relevance_id', title: '关联ID',width:'10%',align:'center'}
,{field:'relevance_sn', title: '关联单号',width:'10%',align:'center'}
,{field:'content', title: '内容',width:'25%',align:'center'}
,{field:'user_id_name', title: '操作人',width:'8%',align:'center'}
,{field:'create_time', title: '操作时间',width:'12%',align:'center'}
,{field:'extend1', title: '附加备注',width:'10%',align:'center'}
]]
,id:'DeliveryList'
,page:{
}
});
form.on('checkbox(*)', function(data){
var type=$(this).data('type');
var value='';
$('input:checkbox:checked').each(function(){
var obj=$(this).data('type');
if(obj==type){
value +=$(this).val()+',';
}
});
console.log(type)
console.log(value)
$("input[name="+type+"]").val(value);
});
element.on('collapse(where)', function(data){
if(data.show==true){
$(data.title).html('查询条件 (点击收起)<i class="layui-icon layui-colla-icon"></i>');
}else{
$(data.title).html('查询条件 (点击展开)<i class="layui-icon layui-colla-icon"></i>');
}
});
form.on('submit(load)', function(data){
form.render();
var data=data.field
//执行重载
table.reload('DeliveryList', {
page: {
curr: 1
}
,where: data
});
return false;
});
})
layui.config({
}).extend({
xmSelect: '/js/plugins/xmSelect/xm-select'
}).use(['form','upload','table',"xmSelect"], function() {
var form = layui.form
,upload = layui.upload
,table = layui.table;
var xmSelect = layui.xmSelect;
//sku搜索
var skuSelect = xmSelect.render({
el: '#skuSelect',
autoRow: false,
radio:true,
toolbar: { show: false },
remoteSearch: true,
filterable: true,
clickClose: true,
data:$("#sku_init").val() == "" ? []:JSON.parse($("#sku_init").val()) ,
remoteMethod: function(val, cb, show){
//这里如果val为空, 则不触发搜索
if(!val || val.length <3 ){
return cb([]);
}
$.ajax({
url: '/api/ApiSkuList',
type: 'get',
data: {
k: val,
},
dataType: 'json',
timeout: 10000,
success: function (res) {
cb(res)
},
error: function () {
return layer.msg('网络错误,请重试', {icon: 5});
}
});
}
,on: function (data) {
var arr = data.arr
if (arr.length > 0){
console.log(data.arr[0].name)
$("#sku_s").val(data.arr[0].name);
}
}
})
//品牌搜索
var brandSelect = xmSelect.render({
el: '#brandSelect',
autoRow: false,
radio:true,
toolbar: { show: false },
remoteSearch: true,
filterable: true,
clickClose: true,
data:$("#brand_init").val() == "" ? []:JSON.parse($("#brand_init").val()),
remoteMethod: function(val, cb, show){
//这里如果val为空, 则不触发搜索
if(!val){
return cb([]);
}
$.ajax({
url: '/api/ApiBrandList',
type: 'get',
data: {
k: val,
},
dataType: 'json',
timeout: 10000,
success: function (res) {
cb(res)
},
error: function () {
return layer.msg('网络错误,请重试', {icon: 5});
}
});
}
,on: function (data) {
var arr = data.arr
if (arr.length == 0){
console.log("数组为空")
}else {
var json = [];
var j = {};
j.brand_id = data.arr[0].value;
j.brand_name = data.arr[0].name;
json.push(j);
var brand = JSON.stringify(json);
console.log(brand)
$("#brand_s").val(brand);
}
}
})
//指定采购,多选
var purSelect = xmSelect.render({
el: '#purSelect',
autoRow: true,
radio:false,
toolbar: { show: false },
remoteSearch: true,
filterable: true,
clickClose: true,
data: $("#pur_init").val() == "" ? []:JSON.parse($("#pur_init").val()) ,
remoteMethod: function(val, cb, show){
//这里如果val为空, 则不触发搜索
if(!val){
return cb([]);
}
$.ajax({
url: '/api/ApiUserList',
type: 'get',
data: {
k: val,
},
dataType: 'json',
timeout: 10000,
success: function (res) {
cb(res)
},
error: function () {
return layer.msg('网络错误,请重试', {icon: 5});
}
});
},
on: function(data){
var arr = data.arr
if (arr.length == 0){
console.log("数组为空")
}else {
var json = [];
for ( var i = 0; i <arr.length; i++){
var j = {};
j.uid = arr[i].value;
j.user_name = arr[i].name;
json.push(j);
}
var pur = JSON.stringify(json);
console.log(pur)
$("#pur_s").val(pur);
}
},
})
//提交(新增修改)
$(".sumbit").on('click',function () {
var data = {
"inquiry_id":$("#inquiry_id").val(),
"inquiry_items_id":$("#inquiry_items_id").val(), //存在则修改
"sku_s":$("#sku_s").val(),
"brand_s":$("#brand_s").val(),
"batch":$("#batch").val(),
"delivery_time":$("#delivery_time").val(),
"inquiry_number":$("#inquiry_number").val(),
"target_price":$("#target_price").val(),
"pur_s":$("#pur_s").val(),
}
var res = ajax("/api/ApiAddInquiry", data)
if(res.errcode >0 ){
alert_err(res.errmsg)
}else{
alert_succ(res.errmsg,function () {
window.parent.layer.closeAll('iframe')
})
}
return false;
})
});
layui.use(['form', 'element'], function(){
var form = layui.form;
var element = layui.element;
//sku搜索
var skuSelect = xmSelect.render({
el: '#skuSelect',
autoRow: false,
radio:true,
toolbar: { show: false },
remoteSearch: true,
filterable: true,
clickClose: true,
data: $("#sku_init").val() == "" ? [] : JSON.parse($("#sku_init").val()) ,
remoteMethod: function(val, cb, show){
//这里如果val为空, 则不触发搜索
if(!val){
return cb([]);
}
$.ajax({
url: '/api/ApiSkuList',
type: 'get',
data: {
k: val,
},
dataType: 'json',
timeout: 10000,
success: function (res) {
cb(res)
},
error: function () {
return layer.msg('网络错误,请重试', {icon: 5});
}
});
}
,on: function (data) {
var arr = data.arr
if (arr.length == 0){
console.log("数组为空")
}else {
console.log(data.arr)
console.log(data.arr[0].name)
$("#goods_name").val(data.arr[0].name);
}
}
})
//品牌搜索
var brandSelect = xmSelect.render({
el: '#brandSelect',
autoRow: false,
radio:true,
toolbar: { show: false },
remoteSearch: true,
filterable: true,
clickClose: true,
data: $("#brand_init").val() == "" ? [] : JSON.parse($("#brand_init").val()),
remoteMethod: function(val, cb, show){
//这里如果val为空, 则不触发搜索
if(!val){
return cb([]);
}
$.ajax({
url: '/api/ApiBrandList',
type: 'get',
data: {
k: val,
},
dataType: 'json',
timeout: 10000,
success: function (res) {
cb(res)
},
error: function () {
return layer.msg('网络错误,请重试', {icon: 5});
}
});
}
,on: function (data) {
var arr = data.arr
if (arr.length == 0){
console.log("数组为空")
}else {
// var json = [];
// var j = {};
// j.brand_id = data.arr[0].value;
// j.brand_name = data.arr[0].name;
// json.push(j);
// var brand = JSON.stringify(json);
// console.log(brand)
$("#brand_id").val(data.arr[0].value);
$("#brand_name").val(data.arr[0].name);
}
}
})
// 供应商搜索
var supplierSelect = xmSelect.render({
el: '#supplierSelect',
autoRow: false,
radio:true,
toolbar: { show: false },
remoteSearch: true,
filterable: true,
clickClose: true,
data: $("#supplier_init").val() == "" ? [] : JSON.parse($("#supplier_init").val()),
remoteMethod: function(val, cb, show){
//这里如果val为空, 则不触发搜索
if(!val){
return cb([]);
}
$.ajax({
url: '/api/ApiSupplierList',
type: 'get',
data: {
k: val,
},
dataType: 'json',
timeout: 10000,
success: function (res) {
cb(res)
},
error: function () {
return layer.msg('网络错误,请重试', {icon: 5});
}
});
}
,on: function (data) {
var arr = data.arr
if (arr.length == 0){
console.log("数组为空")
}else {
$("#supplier_id").val(data.arr[0].value);
$("#supplier_name").val(data.arr[0].name);
}
}
})
// 监听币种
form.on('select(currency)', function(data) {
if (data.value == 2) {
$('.price-section').hide();
} else {
$('.price-section').show();
}
})
// 单价校验
$('.price').keyup(function() {
var val = $(this).val();
var reg = /^\d{0,6}(\.\d{0,6})?$/g;
if (!val) return false;
if(!(reg.test(val))){//判断输入是否合法
if (isNaN(parseFloat(val))) {
layer.msg('只能是数字和小数组成');
$(this).val('');
} else {
$(this).val(parseFloat($(this).val()).toFixed(6));
}
return false;
}
if (val < 0) {
layer.msg('只能是正整数');
$(this).val('');
return false;
}
if (val > 999999.999999) {
val = 999999.999999;
}
if (val.length > 13) {
val = val.slice(0, 13);
}
$(this).val(val);
var currency = $('.currency').val();
if (currency == 1) { // 人民币
var tax_rate = parseFloat($('.tax-rate').text());
var tax_price = parseFloat(val * (1 + tax_rate)).toFixed(6);
$('.price_rmb').val(tax_price);
}
})
// 报价有效期
$('.effect_days').keyup(function() {
var val = $(this).val();
var reg = /\d/;
if (!val) return false;
if (!(reg.test(val))) {
layer.msg('只能是数字');
$(this).val('');
return false;
}
})
// 采购费校验
$('.price_other').keyup(function() {
var val = $(this).val();
var reg = /^\d{0,10}(\.\d{0,2})?$/g;
if (!val) return false;
if(!(reg.test(val))){//判断输入是否合法
if (isNaN(parseFloat(val))) {
layer.msg('只能是数字和小数组成');
$(this).val('');
} else {
$(this).val(parseFloat($(this).val()).toFixed(2));
}
return false;
}
if (val < 0) {
layer.msg('只能是正整数');
$(this).val('');
return false;
}
if (val > 9999999999.99) {
val = 9999999999.99;
}
if (val.length > 13) {
val = val.slice(0, 13);
}
$(this).val(val);
})
// 撤销报价
$('.cancel-quote').click(function() {
var id = $(this).data('id');
layer.open({
area: ['300px'],
title: '撤销报价',
content: '<textarea class="layui-textarea" name="cancel_reason" id="cancel_reason" placeholder="撤销原因"></textarea>',
btn: ['确认', '取消'],
yes: function(index) {
var cancel_reason = $('#cancel_reason').val();
if (!cancel_reason) {
layer.tips('请填写撤销原因', $('#cancel_reason'));
return false;
}
$.ajax({
url : '/api/ApiCancelQuote',
type: 'post',
data: {id: id, cancel_reason: cancel_reason},
dataType: 'json',
success: function(resp) {
if (resp.errcode == 0) {
layer.close(index);
layer.msg(resp.errmsg);
window.location.reload();
return false;
}
layer.msg(resp.errmsg);
},
error: function(err) {
console.log(err)
}
})
layer.msg('撤销报价中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
return false;
},
cancel: function(index) {
layer.close(index);
}
})
})
});
\ No newline at end of file
layui.use(['form', 'table', 'laydate'], function(){
var form = layui.form;
var table = layui.table;
var laydate = layui.laydate;
laydate.render({
elem: '#start_time' //指定元素
});
laydate.render({
elem: '#end_time' //指定元素
});
var renderTable = function () {
table.render({
id: 'list'
,elem: '#list'
,url: '/api/ApiQuoteList' //数据接口
,method:'post'
,cellMinWidth: 80 //全局定义常规单元格的最小宽度
,page: true //开启分页
,where: {
type: 1
}
,cols: [[ //表头
{title: '序号', type: 'numbers', fixed: 'left', width: 80}
,{field: 'inquiry_sn', title: '询价单号', width: 200}
,{field: 'goods_name', title: '询价型号', width: 200}
,{field: 'brand_name', title: '询价品牌', width: 150}
,{field: 'inquiry_number', title: '询价数量', width: 150}
,{field: 'quote_sn', title: '报价单号', width: 200}
,{field: 'supplier_name', title: '供应商名称', width: 240}
,{field: 'price', title: '报价价格', width: 150}
,{field: 'quote_number', title: '报价数量', width: 150}
,{field: 'create_time', title: '报价时间', width: 170}
,{field: 'status_val', title: '状态', width: 120}
,{title: '操作', align:'center', fixed: 'right', toolbar: '#list_action', width: 218}
]]
,limit: 10
,limits: [10, 20, 50,]
});
};
renderTable();
form.on('submit(load)', function(data) {
//执行重载
table.reload('list', {
page: {
curr: 1
}
,where: data.field
});
return false;
});
// tool操作
table.on('tool(list)', function(obj){ //注:tool是工具条事件名,test是table原始容器的属性lay-filter="对应的值"
var data = obj.data; //获得当前行数据
var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
var url = '';
var title = '';
var content = '';
var datax = {};
datax.id = data.id;
if(layEvent === 'cancel') {
url = '/api/ApiCancelQuote';
title = '撤销报价';
content = '<textarea class="layui-textarea" name="cancel_reason" id="cancel_reason" placeholder="撤销原因"></textarea>';
}
layer.open({
area: ['300px'],
title: title,
content: content,
btn: ['确认', '取消'],
yes: function(index) {
if(layEvent === 'cancel') {
var cancel_reason = $('#cancel_reason').val();
if (!cancel_reason) {
layer.tips('请填写撤销原因', $('#cancel_reason'));
return false;
}
datax.cancel_reason = cancel_reason;
}
$.ajax({
url : url,
type: 'post',
data: datax,
dataType: 'json',
success: function(resp) {
if (resp.errcode == 0) {
layer.close(index);
layer.msg(resp.errmsg);
renderTable(); // 重新加载table
return false;
}
layer.msg(resp.errmsg);
},
error: function(err) {
console.log(err)
}
})
layer.msg(title+'中...', {icon: 16, time: 0, shade: 0.3}); // 阻止重复提交
return false;
},
cancel: function(index) {
layer.close(index);
}
})
});
});
\ No newline at end of file
layui.use(['table','form','element','layer','laydate'], function(){
var table = layui.table;
var element = layui.element;
var form = layui.form;
var laydate = layui.laydate;
table.render({
elem: '#list'
,url:'/api/ApiSupplierAccountList'
,method:'post'
,cellMinWidth: 80 //全局定义常规单元格的最小宽度
,request: {
pageName: 'p' //页码的参数名称,默认:page
,limitName: 'limit' //每页数据量的参数名,默认:limit
}
,loading:true
,first: true //不显示首页
,last: false //不显示尾页
,cols: [[
{field:'id', title: 'ID',width:70,align:'center'}
,{field:'mobile', title: '账号',align:'center'}
,{field:'password_raw', title: '密码',align:'center'}
,{field:'status_name', title: '状态',width:70,align:'center'}
,{field:'supplier_code', title: '自营供应商编码',align:'center'}
,{field:'supplier_name', title: '自营供应商名称',align:'center'}
,{field:'supplier_com_code', title: '联营供应商编码',align:'center'}
,{field:'supplier_com_name', title: '联营供应商名称',align:'center'}
,{field:'create_time', title: '创建时间',width:180,align:'center'}
,{field:'cahe', title: '操作',width:200,templet:'#cahe',align:'center', fixed: 'right'}
]]
,id:'SupplierList'
,page:{
}
});
form.on('submit(load)', function(data){
form.render();
var data=data.field
//执行重载
table.reload('SupplierList', {
page: {
curr: 1
}
,where: data
});
return false;
});
form.on('checkbox(*)', function(data){
var stockup_type='';
var pay_type='';
var status='';
var self='';
$('input:checkbox:checked').each(function(){
var obj=$(this).data('type');
if(obj=='stockup_type'){
stockup_type +=$(this).val()+',';
}
if(obj=='pay_type'){
pay_type +=$(this).val()+',';
}
if(obj=='status'){
status +=$(this).val()+',';
}
if(obj=='self'){
self +=$(this).val()+',';
}
})
$("input[name=stockup_type]").val(stockup_type);
$("input[name=pay_type]").val(pay_type);
$("input[name=status]").val(status);
$("input[name=self]").val(self);
});
element.on('collapse(where)', function(data){
if(data.show==true){
$(data.title).html('查询条件 (点击收起)<i class="layui-icon layui-colla-icon"></i>');
}else{
$(data.title).html('查询条件 (点击展开)<i class="layui-icon layui-colla-icon"></i>');
}
});
laydate.render({
elem: '#end_time'
,type:'datetime'
,format:'yyyy-MM-dd HH:mm'
});
laydate.render({
elem: '#start_time'
,type:'datetime'
,format:'yyyy-MM-dd HH:mm'
});
//新增供应商账号
$('.addAccount').click(function(){
layer.open({
scrollbar: false,
type:2
,area: ['500px', '500px']
,title: '新增供应商账号'
,content: '/web/PureAddSupplierAccount'
});
return false;
});
});
/*
重置密码
*/
function resetPassword(account_id) {
alert_confirm("确定重置此账号密码?",function () {
var data = {
'account_id':account_id,
}
var res = ajax('/api/ApiSupplierResetPassword',data)
if(res.errcode >0 ){
alert_err(res.errmsg)
}else{
alert_succ(res.errmsg,function () {
// parent.window.location.href = "/web/SupplierAccountList"
})
}
return false;
})
}
/*
禁用或启动账号
*/
function updateStatus(account_id,status) {
var msg = status ? "确定启动此账号?" : "确定禁用此账号?";
alert_confirm(msg,function () {
var data = {
'account_id':account_id,
'status':status,
}
var res = ajax('/api/ApiSupplierUpdateStatus',data)
if(res.errcode >0 ){
alert_err(res.errmsg)
}else{
alert_succ(res.errmsg,function () {
parent.window.location.href = "/web/SupplierAccountList"
})
}
return false;
})
}
/*
修改供应商手机号
*/
function editAccount(account_id) {
layer.open({
type:2
,area: ['500px', '450px']
,title: '修改供应商账号'
,content: '/web/PureEditSupplierAccount?account_id='+account_id
});
return false;
}
/**
* Created by yemxing on 2018/3/22.
*/
layui.use(['form','upload'], function(){
var form = layui.form
,upload = layui.upload;
form.on('radio(receipt_type)', function(data){
var type=data.value;
if(type==1){
$('#receipt_type_block').html($('#receipt_type_1').html());
}else{
$('#receipt_type_block').html($('#receipt_type_2').html());
}
});
form.on('select(pay_type)', function(data){
var type=data.value;
var html='';
if(type!=3){
html=$('#pay_type_'+type).html();
}
$('#pay_type_block').html(html);
form.render();
});
form.on('submit(load)',function(data){
var status=$(data.elem).data('status');
if(!status || (status!=-1 && status!=1)){
layer.msg('推送状态出错');
return false;
}
data.field['channel[status]']=status;
var url='/api/ApiAddSupplier';
if(data.field['supplier_id']) url='/api/ApiSaveSupplier';
var res=ajax(url,data.field);
if(!res) {
layer.msg('网络错误,请重试',{icon:6});
}else{
if(res.errcode==0){
layer.msg(res.errmsg,{icon:6});
}else{
layer.msg(res.errmsg,{icon:6});
}
}
return false;
})
// 保存、停用时
$('.changeStatus').click(function(){
var data = $('form').serialize();
var supplier_id = $(this).data('id');
var status = $(this).data('status');
data = data+'&supplier_id='+supplier_id+'&status='+status;
url='/api/ApiChangeSupplier';
var res=ajax(url, data);
if(!res) {
layer.msg('网络错误,请重试',{icon:6});
}else{
if(res.errcode==0){
layer.msg(res.errmsg,{icon:6});
}else{
layer.msg(res.errmsg,{icon:6});
}
}
return false;
})
});
$('#receipt_type_block').html($('#receipt_type_'+$(".receipt_type:checked").val()).html());
$('#pay_type_block').html($('#pay_type_'+$(".pay_type option:selected").val()).html());
$('#advance_proportion').on('input propertychange',function(){
$(this).val(parseInt($(this).val()));
if($(this).val()>100){
$(this).val(100);
}
if($(this).val()<0){
$(this).val(0);
}
$('#advance_proportion_s').html(100-$(this).val()+'%');
});
\ No newline at end of file
layui.use(['form', 'table', 'laydate'], function(){
var form = layui.form;
var table = layui.table;
var laydate = layui.laydate;
laydate.render({
elem: '#start_time' //指定元素
});
laydate.render({
elem: '#end_time' //指定元素
});
var renderTable = function () {
table.render({
id: 'list'
,elem: '#take'
,url: '/api/ApiInquiryListPool' //数据接口
,method:'post'
,cellMinWidth: 80 //全局定义常规单元格的最小宽度
,page: true //开启分页
,where: {
type: 2
}
,cols: [[ //表头
{title: '序号', type: 'numbers', fixed: 'left', width: 80}
,{field: 'inquiry_sn', title: '询价单号', width: 200}
,{field: 'goods_name', title: '询价型号', width: 200}
,{field: 'brand_name', title: '询价品牌', width: 150}
,{field: 'inquiry_number', title: '询价数量', width: 150}
,{field: 'target_price', title: '目标报价', width: 150}
,{field: 'create_name', title: '制单人', width: 150}
,{field: 'create_time', title: '询价时间', width: 170}
,{field: 'assign_type_val', title: '指定/领取', width: 120}
,{field: 'self_quote', title: '我的报价', width: 200}
,{field: 'status_val', title: '状态', width: 120}
,{title: '操作', align:'center', fixed: 'right', toolbar: '#list_action', width: 218}
]]
,limit: 10
,limits: [10, 20, 50,]
});
};
renderTable();
form.on('submit(load)', function(data) {
//执行重载
table.reload('list', {
page: {
curr: 1
}
,where: data.field
});
return false;
});
});
\ No newline at end of file
......@@ -65,9 +65,9 @@
<div class="table2">
<table>
<tr>
<td width="18%">客户型号 Cust PartNo</td>
<td width="18%">原厂型号 Mfr PartNo</td>
<td width="18%">品牌 Mfr Name</td>
<td width="13%">客户型号 Cust PartNo</td>
<td width="13%">原厂型号 Mfr PartNo</td>
<td >品牌 Mfr Name</td>
<td>报价(RMB含税)Quoted Price (RMB with 13%VAT,freight fee to factory and import fee )</td>
<td>报价(美金)QuotedPrice In USD</td>
<td>数量 Quantity</td>
......
<style>
legend{
width:auto;
border-bottom:none;
margin-bottom:auto
}
</style>
<fieldset class="layui-elem-field layui-field-title layui-box" style="margin-top: 0px;">
<legend><i class="layui-icon">&#xe705;</i> 基础信息</legend>
</fieldset>
<form class="layui-form" action="">
<input type="hidden" id="inquiry_id" value="<?= @$inquiry_id ?>">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label"><span style="color: red">*</span>询价客户</label>
<div class="layui-input-inline">
<input type="text" autocomplete="off" class="layui-input" value="" >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label"><span style="color: red">*</span>交货地</label>
<div class="layui-input-inline">
<select lay-ignore id="supplier_com_name" style="width: 150px;height: 38px;">
<option value="1">内地</option>
<option value="2">香港</option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">备注</label>
<div class="layui-input-inline">
<input type="hidden" >
<input type="text" autocomplete="off" class="layui-input" value="" >
</div>
</div>
</div>
<fieldset class="layui-elem-field layui-field-title layui-box" style="margin-top: 30px;">
<legend><i class="layui-icon">&#xe630;</i>&nbsp;询价物料</legend>
<div style="float: left">
<button type="button" class="layui-btn layui-btn-sm " id="addOne" data-id="">单个添加</button>
<button type="button" class="layui-btn layui-btn-sm" id="BatchAdd">批量添加</button>
<button type="button" hidden class="layui-btn layui-btn-sm" id="BatchAdd-Upload">批量添加</button>
<button type="button" class="layui-btn layui-btn-sm layui-btn-danger " data-id="All" id="deleteItems">清空列表</button>
<a href="/templet/add_inquiry.csv" class="layui-btn layui-btn-sm" data-id="">模板下载</a>
</div>
</fieldset>
<table class="layui-table" id="list"></table>
<hr>
<div class="layui-form-item">
<div class="layui-input-block " style="margin-left: 40%;">
<button lay-submit class="layui-btn sumbit" lay-filter="" data-status="1">提交</button>
</div>
</div>
</form>
<button class="layui-btn" id="load" style="display: none">重载表格</button>
<script type="text/html" id="cahe">
<a class="btn btn-xs btn-outline btn-warning HoldItems" data-id="@{{ d.picking_items_id }}"><strong>编辑</strong></a>
<a class="btn btn-xs btn-outline btn-warning DeleteItems" data-picking="@{{ d.picking_id }}" data-id="@{{ d.picking_items_id }}"><strong>删除</strong></a>
</script>
<style type="text/css">
.layui-col-md6 .layui-inline { width: 100%; }
.quote-info .layui-colla-content { min-height: 80px; }
.layui-colla-title{ margin: 0px !important; }
.quote-info label { width: 130px; font-weight: 600;}
.quote-info span { line-height: 38px; }
.quoteForm select, .quoteForm input, .quoteForm textarea{ width: 252px; }
@media screen and (min-width:960px) and (max-width: 1400px) {
.quote-info label { width: 80px; }
.quote-info span { float: left; width: 240px; }
.quote-info input { width: 200px !important; }
}
.show-elem { /*display: none;*/ }
.edit-elem { width: 68%; }
.xm-label-block span{ line-height: 26px !important; }
</style>
<div class="layui-collapse quote-info">
<div class="layui-colla-item">
<h2 class="layui-colla-title">询价信息</h2>
<div class="layui-colla-content layui-show">
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">询价型号:</label>
<span class="layui-text">{{ $inquiry_items_info['goods_name'] }}</span>
</div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">询价品牌:</label>
<span class="layui-text">{{ $inquiry_items_info['brand_name'] }}</span>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">询价数量:</label>
<span class="layui-text">{{ $inquiry_items_info['inquiry_number'] }}</span>
</div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">目标价:</label>
<span class="layui-text">
<?php
$currency_sign = $inquiry_info['currency'] == 1 ? '¥' : '$';
echo $currency_sign.$inquiry_items_info['target_price'];
?>
</span>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">交货地:</label>
<span class="layui-text">{{ $inquiry_info['delivery_place'] == 1 ? '内地' : '香港' }}</span>
</div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">交货时间:</label>
<span class="layui-text">{{ $inquiry_items_info['delivery_time'] }}</span>
</div>
</div>
</div>
</div>
</div>
<form class="layui-form layui-box quoteForm" method="post">
<input type="hidden" name="quote_info[inquiry_id]" value="{{ $inquiry_info['id'] }}">
<input type="hidden" name="quote_info[inquiry_sn]" value="{{ $inquiry_info['inquiry_sn'] }}">
<input type="hidden" name="quote_info[inquiry_items_id]" value="{{ $inquiry_items_info['id'] }}">
<div class="layui-colla-item">
<h2 class="layui-colla-title">报价信息</h2>
<div class="layui-colla-content layui-show">
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">报价型号:</label>
<div class="layui-input-inline">
<div id="skuSelect" style="width: 250px"></div>
<input type="hidden" id="goods_name" name="quote_info[goods_name]" value="" class="layui-input"/>
</div>
</div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">报价品牌:</label>
<div class="layui-input-inline ">
<div id="brandSelect" style="width: 250px"></div>
<input type="hidden" id="brand_id" name="quote_info[brand_id]" value="" required class="layui-input"/>
<input type="hidden" id="brand_name" name="quote_info[brand_name]" value="" class="layui-input"/>
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">供应商:</label>
<div class="layui-input-inline ">
<div id="supplierSelect" style="width: 250px"></div>
<input type="hidden" id="supplier_id" name="quote_info[supplier_id]" value="" class="layui-input"/>
<input type="hidden" id="supplier_name" name="quote_info[supplier_name]" value="" class="layui-input"/>
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">报价币种:</label>
<div class="layui-input-inline">
<select class="currency" name="quote_info[currency]" lay-verify="" lay-search lay-filter="currency">
<option value="1">人民币</option>
<option value="2">美元</option>
</select>
</div>
</div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">单价:</label>
<div class="layui-input-inline">
<input type="text" name="quote_info[price_origin]" value="" class="layui-input price" lay-verify="required">
</div>
</div>
</div>
</div>
<div class="layui-row price-section">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">税率:</label>
<span class="layui-text tax-rate">{{ Config('quote.quote_tax_rate') }}</span>
</div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">含税单价:</label>
<div class="layui-input-inline">
<input type="text" name="quote_info[price_rmb]" value="" class="layui-input price_rmb" readonly>
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">批次:</label>
<div class="layui-input-inline">
<input type="text" name="quote_info[batch]" value="" class="layui-input" lay-verify="required">
</div>
</div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">货期:</label>
<div class="layui-input-inline">
<input type="text" name="quote_info[delivery_time]" value="" class="layui-input" lay-verify="required">
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">采购费:</label>
<div class="layui-input-inline">
<input type="text" name="quote_info[price_other]" value="" class="layui-input price_other" lay-verify="required">
</div>
</div>
</div>
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">报价有效期:</label>
<div class="layui-input-inline">
<input type="text" name="quote_info[effect_days]" value="" class="layui-input effect_days">
</div>
<div class="layui-input-inline">
<span></span>
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label">备注:</label>
<div class="layui-input-inline">
<textarea name="quote_info[remark]" class="layui-textarea"></textarea>
</div>
</div>
</div>
</div>
</div>
<div style="margin: 20px auto; text-align: center;">
<button lay-submit lay-filter="save" class="layui-btn">新增报价</button>
</div>
</div>
</form>
</div>
\ No newline at end of file
<style>
legend{
width:auto;
border-bottom:none;
margin-bottom:auto
}
.nopoint{pointer-events: none}
.real_number{width:10% !important;}
.r2{width:99% !important;}
.display_none{display: none}
</style>
<input type="hidden" value="<?= $inquiry_id; ?>" id="inquiry_id">
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
<fieldset class="layui-elem-field layui-field-title layui-box" >
<legend>客户资料</legend>
</fieldset>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">公司名称</label>
<div class="layui-input-inline">
<input type="text" placeholder="" name="supplier_name" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">C.C</label>
<div class="layui-input-inline">
<input type="text" name="goods_name" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">FAX</label>
<div class="layui-input-inline">
<input type="text" name="brand_name" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">TEL</label>
<div class="layui-input-inline">
<input type="text" name="brand_name" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<fieldset class="layui-elem-field layui-field-title layui-box" >
<legend>公司资料</legend>
</fieldset>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">公司名称</label>
<div class="layui-input-inline">
<input type="text" placeholder="" name="supplier_name" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">C.C</label>
<div class="layui-input-inline">
<input type="text" name="goods_name" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">FAX</label>
<div class="layui-input-inline">
<input type="text" name="brand_name" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">TEL</label>
<div class="layui-input-inline">
<input type="text" name="brand_name" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<fieldset class="layui-elem-field layui-field-title layui-box" >
<legend>物料资料 </legend>
</fieldset>
<table class="layui-table" id="tb" lay-filter="parse-table-demo1">
<thead>
<tr>
<th><div style="width:120px!important">客户型号</div></th>
<th><div style="width:70px!important">原厂型号</div></th>
<th><div style="width:70px!important">品牌</div></th>
<th><div style="width:70px!important">数量</div></th>
<th><div style="width:70px!important">销售报价</div></th>
<th><div style="width:70px!important">金额</div></th>
<th><div style="width:70px!important">批次</div></th>
<th><div style="width:70px!important">类型</div></th>
</tr>
</thead>
<tbody >
<form id="forma">
@if(!empty($itemsArr) && is_array($itemsArr))
@foreach($itemsArr as $k=>$v)
<input type="hidden" name="items_{{$v['id']}}" value="{{$v['id']}}">
<input type="hidden" name="class_id2_{{$v['id']}}" value="{{$v['class_id2']}}">
<tr class=" {{'you'.$v['id']}}">
<td class="real_number">{{ @$v['goods_name']}}</td>
<td class="real_number"><input type="text" name="goods_name_pro_{{$v['id']}}" value="{{ @$v['goods_name']}}" class="r2" ></td>
<td class="real_number"><input type="text" name="brand_name_{{$v['id']}}" value="{{ @$v['brand_name']}}" class="r2"></td>
<td class="real_number"><input type="text" name="inquiry_number_{{$v['id']}}" value="{{ @$v['inquiry_number']}}" class="r2"></td>
<td class="real_number"><input type="text" name="quote_price_{{$v['id']}}" value="{{ @$v['quote_price']}}" class="r2"></td>
<td class="real_number"><input type="text" name="quote_price_count_{{$v['id']}}" value="{{ @$v['quote_price_count']}}" class="r2"></td>
<td class="real_number"><input type="text" name="batch_{{$v['id']}}" value="{{ @$v['batch']}}" class="r2"></td>
<td class="real_number"><input type="text" name="class_id2_name_{{$v['id']}}" value="{{ @$v['class_id2_name']}}" class="r2"></td>
</tr>
@endforeach
@endif
</form>
</tbody>
</table>
<div style="margin-top: 10px;margin-left: 200px;">
<button class="layui-btn" lay-submit="" id="submit" lay-filter="load">生成报价单</button>
</div>
</div>
\ No newline at end of file
<style>
.layui-form-select dl { max-height: 200px; }
</style>
<form class="layui-form layui-box" method="post">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">询价单号</label>
<div class="layui-input-inline">
<input type="text" name="inquiry_sn" placeholder="询价单号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">询价型号</label>
<div class="layui-input-inline">
<input type="text" name="goods_name" placeholder="询价型号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">询价品牌</label>
<div class="layui-input-inline">
<input type="text" name="brand_name" placeholder="询价品牌" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">报价单号</label>
<div class="layui-input-inline">
<input type="text" name="quote_sn" placeholder="报价单号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">报价状态</label>
<div class="layui-input-inline">
<select name="status" lay-verify="" lay-search>
<option value=""></option>
@if (Config('quote.quote_status'))
@foreach (Config('quote.quote_status') as $k => $v)
<option value="{{ $k }}">{{ $v }}</option>
@endforeach
@endif
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">报价制单人</label>
<div class="layui-input-inline">
<select name="create_uid" lay-verify="" lay-search>
<option value=""></option>
@if ($pur_list)
@foreach ($pur_list as $v)
<option value="{{ $v['userId'] }}">{{ $v['name'] }}</option>
@endforeach
@endif
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">报价时间</label>
<div class="layui-input-inline">
<input type="text" name="start_time" value="" autocomplete="off" placeholder="选择开始时间" class="layui-input" id="start_time" readonly>
</div>
<div class="layui-form-mid">-</div>
<div class="layui-input-inline">
<input type="text" name="end_time" value="" autocomplete="off" placeholder="选择结束时间" class="layui-input" id="end_time" readonly>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-btn-container" style="text-align: center; margin-top: 10px;">
<button lay-submit lay-filter="load" class="layui-btn" data-type="search">搜索</button>
</div>
</div>
</form>
<table id="list" lay-filter="list"></table>
<script type="text/html" id="list_action">
<a class="btn btn-xs btn-info" href="/web/QuoteDetails?id=@{{ d.id }}" target="_blank">报价详情</a>
</script>
<style>
legend{
width:auto;
border-bottom:none;
margin-bottom:auto
}
</style>
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
<input type="hidden" value="<?= $itemsDetail['id']; ?>" id="inquiry_id">
<ul class="layui-tab-title">
<li class="layui-this">询价信息</li>
</ul>
<div style="float: right;margin-bottom: 10px;">
<button type="button" class="layui-btn purchase-details-delete" id="updateItem" data-id="">修改</button>
<button type="button" class="layui-btn purchase-details-export" id="closeItem" data-id="">关闭询价</button>
</div>
<br/>
<div class="layui-tab-content" style="height: auto">
<div class="layui-tab-item layui-show">
<table class="layui-table" lay-size="sm">
<colgroup>
<col>
</colgroup>
<thead>
<tr>
<th>询价客户</th>
<th>交货地</th>
<th>询价时间</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ @$itemsDetail["inquiry_sn"] }}</td>
<td>{{ @$itemsDetail["goods_name"] }}</td>
<td>{{ @$itemsDetail["brand_name"] }}</td>
<td>{{ @$itemsDetail["brand_name"] }}</td>
</tr>
</tbody>
</table>
</div>
<div class="layui-tab-item ">
<table class="layui-table" id="inquiry_log"></table>
</div>
</div>
</div>
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
<ul class="layui-tab-title">
<li class="layui-this">询价物料</li>
</ul>
<div style="float: right;margin-bottom: 10px;">
<button type="button" class="layui-btn purchase-details-delete" id="addOne" data-id="">添加物料</button>
<button type="button" class="layui-btn purchase-details-export" id="AddReportOffer" data-id="">生成报价单</button>
<button type="button" class="layui-btn purchase-details-export" id="AddReportSale" data-id="">生成销售单</button>
</div>
<div class="layui-tab-content" style="height: auto;">
<div class="layui-tab-item layui-show">
<table class="layui-table" id="list"></table>
</div>
</div>
</div>
<!--主操作栏-->
<script type="text/html" id="main">
<a href="/web/InquiryItemsDetail?inquiry_items_id=@{{ d.id }}" class="btn btn-xs btn-outline btn-primary"><strong>查看详情</strong></a>
@{{# if(d.status_val == '待报价' ){ }}
<a class="btn btn-xs btn-outline btn-primary" onclick="urgePrice(@{{ d.id }})"><strong>催报价</strong></a>
@{{# } }}
<a class="btn btn-xs btn-outline btn-primary"onclick="inquiryClose(@{{ d.id }})" ><strong>关闭询价</strong></a>
</script>
<!--子操作栏-->
<script type="text/html" id="son">
<a href="/web/SaveSupplier?supplier_id=@{{ d.supplier_id }}" class="btn btn-xs btn-outline btn-primary"><strong>催报价</strong></a>
@{{# if(d.status_val=='待报价' ){ }}
<a href="/web/SaveSupplier?supplier_id=@{{ d.supplier_id }}" class="btn btn-xs btn-outline btn-primary"><strong>催报价</strong></a>
@{{# }else if(d.status=='-1' ){ }}
<a href="/web/SaveSupplier?supplier_id=@{{ d.supplier_id }}&type=view" class="btn btn-xs btn-outline btn-primary"><strong>查看</strong></a>
@{{# }else if(d.status=='2'){ }}
<a href="/web/SaveSupplier?supplier_id=@{{ d.supplier_id }}" class="btn btn-xs btn-outline btn-primary"><strong>关闭询价</strong></a>
@{{# } }}
</script>
\ No newline at end of file
{{--<div class="layui-tab layui-tab-card">--}}
{{--<ul class="layui-tab-title">--}}
{{--<li class="layui-this"><a href="/web/CloseInqury">我的询价</a></li>--}}
{{--<li><a href="/web/CloseInqury">已关闭询价</a></li>--}}
{{--<li>所有询价</li>--}}
{{--</ul>--}}
{{--<div class="layui-tab-content">--}}
<div class="layui-tab-item layui-show">
<form class="layui-form" id="form1">
<input type="hidden" name="types" value="<?= @$types; ?>" >
<div class="layui-collapse layui-box" lay-filter="where">
<div class="layui-colla-item">
<h2 class="layui-colla-title" style="margin: 0">查询条件 (点击收起)</h2>
<div class="layui-colla-content layui-show">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">询价单号</label>
<div class="layui-input-inline">
<input type="text" placeholder="" name="supplier_name" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">询价型号</label>
<div class="layui-input-inline">
<input type="text" name="goods_name" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">询价品牌</label>
<div class="layui-input-inline">
<input type="text" name="brand_name" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">询价客户</label>
<div class="layui-input-inline">
<input type="text" name="customer_name" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
<input type="hidden" name="status">
@if(!empty($status) && is_array($status))
@foreach($status as $k=>$v)
<input type="checkbox" lay-filter="*" data-type="status" value="{{$k}}" title="{{$v or '未知'}}">
@endforeach
@endif
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">询价时间</label>
<div class="layui-input-inline" style="width: 200px;">
<input type="text" name="start_time" id="start_time" value="" placeholder="开始时间" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid">-</div>
<div class="layui-input-inline" style="width: 200px;">
<input type="text" name="end_time" id="end_time" value="" placeholder="结束时间" autocomplete="off" class="layui-input">
</div>
</div>
</div>
</div>
</div>
</div>
<div style="margin-top: 10px">
<button class="layui-btn" lay-submit="" lay-filter="load">查询</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
<button class="layui-btn layui-btn-primary" id="export">导出</button>
</div>
</form>
<input type="hidden" id="AdminID" value="{{$userId or ''}}">
<table class="layui-table" id="list"></table>
<script>
var adminID=document.getElementById('AdminID').value;
</script>
<!--主操作栏-->
<script type="text/html" id="main">
<a href="/web/InquiryItemsDetail?inquiry_items_id=@{{ d.id }}" class="btn btn-xs btn-outline btn-primary"><strong>查看详情</strong></a>
@{{# if(d.status_val == '待报价' ){ }}
<a class="btn btn-xs btn-outline btn-primary" ><strong>催报价</strong></a>
@{{# } }}
<a class="btn btn-xs btn-outline btn-primary" ><strong>关闭询价</strong></a>
</script>
<!--子操作栏-->
<script type="text/html" id="son">
@{{# if(d.status_val=='待报价' ){ }}
<a href="/web/SaveSupplier?supplier_id=@{{ d.supplier_id }}" class="btn btn-xs btn-outline btn-primary"><strong>催报价</strong></a>
@{{# }else if(d.status=='-1' ){ }}
<a href="/web/SaveSupplier?supplier_id=@{{ d.supplier_id }}&type=view" class="btn btn-xs btn-outline btn-primary"><strong>查看</strong></a>
@{{# }else if(d.status=='2'){ }}
<a href="/web/SaveSupplier?supplier_id=@{{ d.supplier_id }}" class="btn btn-xs btn-outline btn-primary"><strong>关闭询价</strong></a>
@{{# } }}
</script>
{{--</div>--}}
{{--</div>--}}
</div>
<style>
.layui-form-select dl { max-height: 200px; }
</style>
<form class="layui-form layui-box" method="post">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">询价单号</label>
<div class="layui-input-inline">
<input type="text" name="inquiry_sn" placeholder="询价单号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">询价型号</label>
<div class="layui-input-inline">
<input type="text" name="goods_name" placeholder="询价型号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">询价品牌</label>
<div class="layui-input-inline">
<input type="text" name="brand_name" placeholder="询价品牌" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">制单人</label>
<div class="layui-input-inline">
<select name="create_uid" lay-verify="" lay-search>
<option value=""></option>
<optgroup label="在职">
@foreach ($sale_list as $k => $v)
@if ($v['status'] == 0)
<option value="{{ $v['userId'] }}">{{ $v['name'] }}</option>
@endif
@endforeach
</optgroup>
<optgroup label="离职">
@foreach ($sale_list as $k => $v)
@if ($v['status'] == 4)
<option value="{{ $v['userId'] }}">{{ $v['name'] }}</option>
@endif
@endforeach
</optgroup>
</select>
</div>
</div>
<!-- <div class="layui-inline">
<label class="layui-form-label">询价状态</label>
<div class="layui-input-inline">
<select name="status" lay-verify="" lay-search>
<option value=""></option>
@if (Config('inquiry.inquiry_item_status'))
@foreach (Config('inquiry.inquiry_item_status') as $k => $v)
<option value="{{ $k }}">{{ $v }}</option>
@endforeach
@endif
</select>
</div>
</div> -->
<div class="layui-inline">
<label class="layui-form-label">询价时间</label>
<div class="layui-input-inline">
<input type="text" name="start_time" value="" autocomplete="off" placeholder="选择开始时间" class="layui-input" id="start_time" readonly>
</div>
<div class="layui-form-mid">-</div>
<div class="layui-input-inline">
<input type="text" name="end_time" value="" autocomplete="off" placeholder="选择结束时间" class="layui-input" id="end_time" readonly>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-btn-container" style="text-align: center; margin-top: 10px;">
<button lay-submit lay-filter="load" class="layui-btn" data-type="search">搜索</button>
</div>
</div>
</form>
<table id="pool" lay-filter="pool"></table>
<script type="text/html" id="list_action">
@{{# if (d.status != 1) { }}
<a class="btn btn-xs btn-info" href="/web/QuoteDetails?inquiry_id=@{{ d.inquiry_id }}" target="_blank">报价详情</a>
@{{# } }}
<a class="btn btn-xs btn-success" lay-event="take">领取</a>
<a class="btn btn-xs btn-danger" href="/web/addQuote?inquiry_item_id=@{{ d.id }}" target="_blank">立即报价</a>
</script>
<style>
legend{
width:auto;
border-bottom:none;
margin-bottom:auto
}
</style>
<fieldset class="layui-elem-field layui-field-title layui-box" >
<legend><i class="layui-icon">&#xe705;</i> {{$title}}</legend>
</fieldset>
<form class="layui-form">
<div class="layui-collapse layui-box" lay-filter="where">
<div class="layui-colla-item">
<h2 class="layui-colla-title" style="margin: 0">查询条件 (点击收起)</h2>
<div class="layui-colla-content layui-show">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">类型</label>
<div class="layui-input-block">
<input type="hidden" name="relevance_type" id="relevance_type">
@if(!empty($relevance_type) && is_array($relevance_type))
@foreach($relevance_type as $k=>$v)
<input type="checkbox" lay-filter="*" data-type="relevance_type" value="{{$k}}" title="{{$v or '未知'}}">
@endforeach
@endif
</div>
</div>
</div>
</div>
</div>
</div>
<div style="margin-top: 10px">
<div style="float: left;">
<button class="layui-btn" lay-submit="" lay-filter="load">立即查询</button>
<button type="reset" class="layui-btn layui-btn-primary">重置条件</button>
</div>
</div>
</form>
<table class="layui-table" id="list"></table>
\ No newline at end of file
<!--生成付款申请单页面-->
<style>
legend{
width:auto;
border-bottom:none;
margin-bottom:auto
}
.nohand{ pointer-events: none;}
</style>
<form id="form1">
<div class="layui-tab layui-tab-brief layui-form" lay-filter="docDemoTabBrief" id="form1" >
<input type="hidden" value="<?= @$_GET['inquiry_id']; ?>" id="inquiry_id" name="inquiry_id">
<input type="hidden" id="sku_init" value="{{ $info["sku_init"] or "" }}">
<input type="hidden" id="brand_init" value="{{ $info["brand_init"] or "" }}">
<input type="hidden" id="pur_init" value="{{ $info["pur_init"] or "" }}">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label"><span class="red">*</span>SKU型号:</label>
<div class="layui-input-inline">
<div id="skuSelect" style="width: 250px"></div>
<input type="hidden" id="sku_s" select_value="" name="sku_s" value="" class="layui-input"/>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label"><span class="red">*</span>品牌:</label>
<div class="layui-input-inline">
<div id="brandSelect" style="width: 250px"></div>
<input type="hidden" id="brand_s" select_value="" name="brand_s" value="" class="layui-input"/>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label"><span class="red">*</span>批次要求:</label>
<div class="layui-input-inline">
<input type="text" id="batch" name="batch" lay-verify="required" value="{{ $info["batch"] or "" }}" placeholder="" autocomplete="off" class="layui-input " >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label"><span class="red">*</span>交货日期:</label>
<div class="layui-input-inline">
{{--<input type="text" lay-ignore style="width: 80px;float:left;" id="mobile" lay-verify="required" value="" placeholder="" autocomplete="off" class="layui-input " >--}}
{{--<select lay-ignore style="width: 100px;height:38px;float: right">--}}
{{--<option value="周"></option>--}}
{{--<option value="天"></option>--}}
{{--</select>--}}
<input type="text" id="delivery_time" name="delivery_time" lay-verify="required" value="{{ $info["delivery_time"] or "" }}" placeholder="" autocomplete="off" class="layui-input " >
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label"><span class="red">*</span>询价数量:</label>
<div class="layui-input-inline">
<input type="text" name="inquiry_number" lay-verify="required" value="{{ $info["inquiry_number"] or "" }}" placeholder="" autocomplete="off" class="layui-input " >
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">目标价:</label>
<div class="layui-input-inline">
<input type="text" name="target_price" lay-verify="required" value="{{ $info["target_price"] or "" }}" placeholder="" autocomplete="off" class="layui-input " >
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">指定采购:</label>
<div class="layui-input-inline">
<div id="purSelect" style="width: 250px"></div>
<input type="hidden" id="pur_s" select_value="" name="pur_s" value="" class="layui-input"/>
</div>
</div>
</div>
<br/>
<div class="layui-form-item">
<div class="layui-input-block " style="margin-left: 40%;">
<input name="account_id" id="account_id" value="{{ @$_GET['inquiry_items_id'] }}" type="hidden">
<button lay-submit class="layui-btn sumbit" lay-filter="" data-status="1">确定</button>
</div>
</div>
</form>
</div>
\ No newline at end of file
<style>
.layui-form-select dl { max-height: 200px; }
</style>
<form class="layui-form layui-box" method="post">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">询价单号</label>
<div class="layui-input-inline">
<input type="text" name="inquiry_sn" placeholder="询价单号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">询价型号</label>
<div class="layui-input-inline">
<input type="text" name="goods_name" placeholder="询价型号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">询价品牌</label>
<div class="layui-input-inline">
<input type="text" name="brand_name" placeholder="询价品牌" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">报价单号</label>
<div class="layui-input-inline">
<input type="text" name="quote_sn" placeholder="报价单号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">报价状态</label>
<div class="layui-input-inline">
<select name="status" lay-verify="" lay-search>
<option value=""></option>
@if (Config('quote.quote_status'))
@foreach (Config('quote.quote_status') as $k => $v)
<option value="{{ $k }}">{{ $v }}</option>
@endforeach
@endif
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">报价时间</label>
<div class="layui-input-inline">
<input type="text" name="start_time" value="" autocomplete="off" placeholder="选择开始时间" class="layui-input" id="start_time" readonly>
</div>
<div class="layui-form-mid">-</div>
<div class="layui-input-inline">
<input type="text" name="end_time" value="" autocomplete="off" placeholder="选择结束时间" class="layui-input" id="end_time" readonly>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-btn-container" style="text-align: center; margin-top: 10px;">
<button lay-submit lay-filter="load" class="layui-btn" data-type="search">搜索</button>
</div>
</div>
</form>
<table id="list" lay-filter="list"></table>
<script type="text/html" id="list_action">
<a class="btn btn-xs btn-info" href="/web/QuoteDetails?id=@{{ d.id }}" target="_blank">报价详情</a>
@{{# if (d.status != -1) { }}
<a class="btn btn-xs btn-danger" lay-event="cancel">撤销报价</a>
@{{# } }}
</script>
<form class="layui-form" action="/web/Runsql" method="post" style="font-size: 16px">
<input type="hidden" name="key" value="79***5599">
<div class="layui-form-item">
<label class="layui-form-label">sql:</label>
<div class="layui-input-block">
<textarea name="sql" style="width: 800px;height: 200px;" placeholder="请输入sql" class="layui-textarea">{{ $sql }} </textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">DB:</label>
<div class="layui-input-block">
<input name="db" type="text" value="{{ @$db }}">
</div>
</div>
<div style="margin-top: 10px;margin-bottom: 20px;">
<input type="submit" class="layui-btn" value="执行" style="margin-left: 430px;">
</div>
{{ dd($result) }}
</form>
<form class="layui-form">
<div class="layui-collapse layui-box" lay-filter="where">
<div class="layui-colla-item">
<h2 class="layui-colla-title" style="margin: 0">查询条件 (点击收起)</h2>
<div class="layui-colla-content layui-show">
<div class="layui-inline">
<label class="layui-form-label">创建时间:</label>
<div class="layui-input-inline" style="width: 200px;">
<input type="text" name="create_time1" value="" id="start_time" placeholder="开始时间" autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline" style="width: 200px;">
<input type="text" name="create_time2" id="end_time" value="" placeholder="结束时间" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">供应商名称</label>
<div class="layui-input-inline">
<input type="text" placeholder="支持模糊匹配" name="supplier_name" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">供应商编码</label>
<div class="layui-input-inline">
<input type="text" name="supplier_code" placeholder="支持模糊匹配" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">手机号</label>
<div class="layui-input-inline">
<input type="text" name="mobile" placeholder="支持模糊匹配" autocomplete="off" class="layui-input">
</div>
</div>
</div>
</div>
</div>
</div>
<div style="margin-top: 10px">
<button class="layui-btn" lay-submit="" lay-filter="load">立即查询</button>
<button type="reset" class="layui-btn layui-btn-primary">重置条件</button>
<button class="layui-btn addAccount">新增账号</button>
</div>
</form>
<table class="layui-table" id="list"></table>
<script type="text/html" id="cahe">
<button class="btn btn-xs btn-outline btn-success" onclick="editAccount(@{{ d.id }})"><strong>修改</strong></button>
<button class="btn btn-xs btn-outline btn-danger " onclick="resetPassword(@{{ d.id }})"><strong>重置密码</strong></button>
@{{# if(d.status=='1'){ }}
<button class="btn btn-xs btn-outline btn-warning" onclick="updateStatus(@{{ d.id }},0)"><strong>禁用</strong></button>
@{{# }else{ }}
<button class="btn btn-xs btn-outline btn-warning" onclick="updateStatus(@{{ d.id }},1)"><strong>启用</strong></button>
@{{# } }}
</script>
\ No newline at end of file
<style>
.layui-form-select dl { max-height: 200px; }
</style>
<form class="layui-form layui-box" method="post">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">询价单号</label>
<div class="layui-input-inline">
<input type="text" name="inquiry_sn" placeholder="询价单号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">询价型号</label>
<div class="layui-input-inline">
<input type="text" name="goods_name" placeholder="询价型号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">询价品牌</label>
<div class="layui-input-inline">
<input type="text" name="brand_name" placeholder="询价品牌" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">制单人</label>
<div class="layui-input-inline">
<select name="create_uid" lay-verify="" lay-search>
<option value=""></option>
<optgroup label="在职">
@foreach ($sale_list as $k => $v)
@if ($v['status'] == 0)
<option value="{{ $v['userId'] }}">{{ $v['name'] }}</option>
@endif
@endforeach
</optgroup>
<optgroup label="离职">
@foreach ($sale_list as $k => $v)
@if ($v['status'] == 4)
<option value="{{ $v['userId'] }}">{{ $v['name'] }}</option>
@endif
@endforeach
</optgroup>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">询价状态</label>
<div class="layui-input-inline">
<select name="status" lay-verify="" lay-search>
<option value=""></option>
@if (Config('inquiry.inquiry_item_status'))
@foreach (Config('inquiry.inquiry_item_status') as $k => $v)
<option value="{{ $k }}">{{ $v }}</option>
@endforeach
@endif
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">指定/领取</label>
<div class="layui-input-inline">
<select name="assign_type" lay-verify="" lay-search>
<option value=""></option>
<option value="1">指定</option>
<option value="2">领取</option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">询价时间</label>
<div class="layui-input-inline">
<input type="text" name="start_time" value="" autocomplete="off" placeholder="选择开始时间" class="layui-input" id="start_time" readonly>
</div>
<div class="layui-form-mid">-</div>
<div class="layui-input-inline">
<input type="text" name="end_time" value="" autocomplete="off" placeholder="选择结束时间" class="layui-input" id="end_time" readonly>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-btn-container" style="text-align: center; margin-top: 10px;">
<button lay-submit lay-filter="load" class="layui-btn" data-type="search">搜索</button>
</div>
</div>
</form>
<table id="take" lay-filter="take"></table>
<script type="text/html" id="list_action">
@{{# if (d.status != 1) { }}
<a class="btn btn-xs btn-info" href="/web/QuoteDetails?inquiry_id=@{{ d.inquiry_id }}" target="_blank">报价详情</a>
@{{# } }}
<a class="btn btn-xs btn-danger" href="/web/AddQuote?inquiry_item_id=@{{ d.id }}" target="_blank">立即报价</a>
</script>
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