提交 4830e43a 编写于 作者: doc_wei's avatar doc_wei

feat: 采购合同转采购订单修改

上级 79326685
// 以下两个参数开启团队权限时有值
var objectId = '', objectKey = '';
// 根据以下两个参数判断:工作流的判断是否要根据serviceClassName的判断
var serviceClassName;
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery'], function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$;
var id = GetUrlParam("id");
// 采购合同转采购订单
AjaxPostUtil.request({url: sysMainMation.erpBasePath + "querySupplierContractTransById", params: {id: id}, type: 'json', method: 'GET', callback: function (json) {
let data = json.bean;
data.erpOrderItemList = data.supplierContractChildList
// 采购订单的【编辑布局】
dsFormUtil.initEditPageForStatic('content', 'FP2023042000002', data, {
savePreParams: function (params) {
params.xxx="123213213213213213213213"
},
saveData: function (params) {
// 保存数据
},
loadComponentCallback: function () {
$("div[controlType='supplier']").remove();
$("div[controlType='purchaseOrderFromType']").remove();
}
});
}});
});
\ No newline at end of file
......@@ -88,6 +88,9 @@ layui.config({
str += '<a class="layui-btn layui-btn-xs" lay-event="recovery">恢复</a>';
}
}
str += '<a class="layui-btn layui-btn-xs" lay-event="contractToOrder">转采购订单</a>';
return str;
}}
]],
......@@ -124,6 +127,8 @@ layui.config({
recovery(data);
} else if (layEvent === 'revoke') { //撤销
revoke(data);
} else if (layEvent === 'contractToOrder') { // 转采购订单
contractToOrder(data);
}
});
......@@ -153,6 +158,19 @@ layui.config({
}});
}
// 转采购订单
function contractToOrder(data) {
parent._openNewWindows({
url: "../../tpl/supplierContract/contractToOrder.html?id=" + data.id,
title: '转采购订单',
pageId: "contractToOrder",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
}
// 详情
function details(data) {
parent._openNewWindows({
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div id="content"></div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" type="button" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formSaveDraft" id="formSaveDraft">保存为草稿</button>`
<button class="winui-btn" lay-submit lay-filter="formWriteBean" id="formWriteBean">提交</button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/supplierContract/'}).use('contractToOrder');
</script>
</body>
</html>
\ No newline at end of file
......@@ -65,6 +65,15 @@ var dsFormUtil = {
{{/bean}}`, // Id转Mation取值转换后的展示(用户组件)
},
options: {
// 保存之前的回调函数
savePreParams: function (params) {},
// 保存数据的回调函数
saveData: null,
// 组件加载完成的回调函数
loadComponentCallback: function () {}
},
pageMation: {},
getBusinessData: function (businessId, serviceClassName, callback) {
......@@ -145,6 +154,11 @@ var dsFormUtil = {
dsFormUtil.loadComponent(showBoxId, dsFormContent);
}
});
if (typeof (dsFormUtil.options.loadComponentCallback) == "function") {
dsFormUtil.options.loadComponentCallback();
}
matchingLanguage();
form.render();
......@@ -152,6 +166,52 @@ var dsFormUtil = {
});
},
/**
* 加载动态表单(编辑操作---自定义数据)
*
* @param showBoxId 显示位置
* @param pageId 布局id/布局编码
* @param data 业务数据
* @param newOptions 配置参数
*/
initEditPageForStatic: function (showBoxId, pageId, data, newOptions) {
if (!isNull(newOptions)) {
for (var pro in newOptions) {
dsFormUtil.options[pro] = newOptions[pro];
}
}
dsFormUtil.getPageMation(pageId, function(pageMation) {
dsFormUtil.initEditPage(showBoxId, pageMation, data);
})
},
getPageMation: function (pageId, callback) {
AjaxPostUtil.request({url: reqBasePath + "dsformpage006", params: {id: pageId}, type: 'json', method: 'GET', callback: function (json) {
let pageMation = json.bean;
if (isNull(pageMation)) {
winui.window.msg("该布局信息不存在", {icon: 2, time: 2000});
return false;
} else {
if (pageMation.serviceBeanCustom.serviceBean.teamAuth) {
objectKey = GetUrlParam("objectKey");
objectId = GetUrlParam("objectId");
if (isNull(objectKey) || isNull(objectId)) {
winui.window.msg("请传入适用对象信息", {icon: 2, time: 2000});
return false;
} else {
if (typeof (callback) == "function") {
callback(pageMation);
}
}
} else {
if (typeof (callback) == "function") {
callback(pageMation);
}
}
}
}});
},
// 获取业务数据中实际的值
getValueDataFromBusinessForEdit: function (content, data) {
var attrDefinition = content.attrDefinition;
......@@ -320,17 +380,25 @@ var dsFormUtil = {
params["approvalId"] = approvalId;
}
// 发送请求
dsFormUtil.sendRequest({
businessApi: dsFormUtil.pageMation.businessApi,
params: params,
loadTable: false,
callback: function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
parent.refreshCode = '0';
}
});
if (typeof (dsFormUtil.options.savePreParams) == "function") {
dsFormUtil.options.savePreParams(params);
}
if (dsFormUtil.options.saveData != null && typeof (dsFormUtil.options.saveData) == "function") {
dsFormUtil.options.saveData(params);
} else {
// 发送请求
dsFormUtil.sendRequest({
businessApi: dsFormUtil.pageMation.businessApi,
params: params,
loadTable: false,
callback: function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
parent.refreshCode = '0';
}
});
}
},
/**
......
......@@ -116,7 +116,7 @@ var initTableChooseUtil = {
} else if (item.formType == 'textarea') {
tbodyStr += '<td><textarea style="height: 100px;" class="layui-textarea ' + className + '" value="' + value + '" id="' + tdId + '" win-verify="' + verify + '"></textarea></td>';
} else if (item.formType == 'chooseInput') {
tbodyStr += '<td><input type="text" class="layui-input ' + className + '" value="' + value + '" id="' + tdId + '" win-verify="' + verify + '" readonly="readonly"/>' +
tbodyStr += '<td class="input-add-icon"><input type="text" class="layui-input ' + className + '" value="' + value + '" id="' + tdId + '" win-verify="' + verify + '" readonly="readonly"/>' +
'<i class="fa fa-plus-circle input-icon add-icon ' + item.iconClassName + '"></i></td>';
} else if (item.formType == 'select') {
var modelHtml = isNull(item.modelHtml) ? "" : item.modelHtml;
......
......@@ -162,6 +162,7 @@
--tile-color: #0078D7;
--taskbar-btnhover-color: #195583;
--start-btn-color: #429CE3;
position: relative;
}
.winui-color32 {
......
......@@ -1517,7 +1517,7 @@ body .layer-ext-winconfirm .layui-layer-content {
.ver-center{
align-items: Center;
padding-top: 8px;
min-height: 32px;
min-height: 33px;
font-family: initial;
}
......@@ -6404,9 +6404,33 @@ body .layer-ext-winconfirm .layui-layer-content {
margin-left: 2px;
}
.input-icon{
.input-add-icon>input {
width: calc(100% - 30px);
border-radius: 0.25rem 0 0 0.25rem;
}
/* 当鼠标悬停在 input 上时,修改紧跟在其后的兄弟元素 i 的样式 */
.input-add-icon>input:hover + i {
border-color: #80bdff !important;
}
.input-add-icon>i {
position: absolute;
top: 0px;
right: 0px;
cursor: pointer;
color: gray;
height: 16px !important;
width: 16px;
padding: 6px;
border: 1px solid #e6e6e6;
border-left: 0px;
border-radius: 0 0.25rem 0.25rem 0;
}
.input-icon {
position: absolute;
top:8px;
top: 8px;
right: 8px;
cursor: pointer;
color: gray;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册