| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435 |
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DicPage.aspx.cs" Inherits="DicPage" %>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title></title>
- <script src="js/boot.js"></script>
- <link href="css/dic.css" rel="stylesheet" />
- <script src="js/dic.js"></script>
- <script type="text/javascript">
- var tree = null;
- var shopList = [];
- var productList = [];
- $(document).ready(function () {
- tree = mini.get("m_tree");
- $("#txtTreeKey").keydown(function (e) {
- if (e.which == 13) {
- tree_filter();
- }
- });
- if ($("#hPemShop").val() != "") mini.get("selPemShop").setValue($("#hPemShop").val());
- let txtShopDesign = mini.get("designPemShop");
- txtShopDesign.on("valuechanged", changeValue);
- postAjax("get_shop_list", "", function (data) {
- shopList = data;
- getDesignInfo();
- })
- postAjax("get_product_list", "", function (data) {
- productList = data;
- getDesignInfo();
- })
- });
- function onCloseClick(e) {
- var obj = e.sender;
- obj.setText("");
- obj.setValue("");
- }
- function tree_filter() {
- var key = $("#txtTreeKey").val();
- if (key == "") {
- tree.clearFilter();
- } else {
- key = key.toLowerCase();
- tree.filter(function (node) {
- //alert(node.name);
- var text = node.name ? node.name.toLowerCase() : "";
- if (text.indexOf(key) != -1) {
- return true;
- }
- });
- }
- }
- function importExcel() {
- openWin("出入库导入", "../reports/Imports.aspx?t=fitting_type", 420, 200, function (action) {
- if (action == "save") {
- resultShow("数据导入成功!", "view_search()");
- }
- });
- }
- function lineFn() {
- mini.get("txtLineSt").setValue(1);
- mini.get("txtLineEt").setValue(4);
- mini.get("win_line").show();
- }
- function saveLineFn() {
- var id = $("#hId").val();
- var st = mini.get("txtLineSt").getValue();
- var et = mini.get("txtLineEt").getValue();
- var prev = mini.get("txtPrev").getValue();
- getAjax("line_dic_item", "class=" + $("#hClass").val() + "&mId=" + id + "&st=" + st + "&et=" + et + "&prev=" + prev, function (data) {
- if (data != "") {
- var sArr = data.split('|');
- window.location = "DicPage.aspx?t=" + $("#hClass").val() + "&mId=" + id;
- //resultShow(sArr[1], "");
- } else {
- alert('保存失败!');
- }
- });
- }
- function codeFn() {
- var name = $("#hName").val();
- var id = $("#hId").val();
- $("#code_href").attr("href", "QRCode.aspx?text=" + name + "|" + id);
- $("#code_href")[0].click();
- }
- function saveFn_() {
- if (mini.get("selPemShop") != undefined && mini.get("selPemShop").getValue() != "id") $("#hPemShop").val(mini.get("selPemShop").getValue());
- saveFn();
- }
- function treeNodeSelFn_(e, node) {
- treeNodeSelFn(e, node);
- }
- function permsFn() {
- var id = $("#hId").val();
- if (id == "") {
- alert("找不到要生成的项!");
- return false;
- }
- getAjax("perms_dic_item", "mId=" + id, function (data) {
- if (data != "") {
- resultShow("加入权限完成");
- } else {
- alert('保存失败!');
- }
- });
- }
- var autoIdx = 0;
- function autoNextFn() {
- var list = importValueList;
- if (autoIdx >= list.length) {
- return;
- }
- var itemvalue = list[autoIdx];
- $("#txtName").val(itemvalue.text);
- $("#txtCode").val(itemvalue.value);
- autoIdx++;
- }
- var shop_list = []
- function changeValue(e) {
- let list = []
- let selecteds = e.selecteds;
- if ($("#txtShopDesign").nextAll().length > 0) {
- $("#txtShopDesign").nextAll().remove();
- }
- shop_list.forEach(item => {
- let index = selecteds.findIndex(e => item.shopId === e.id);
- if (index !== -1) {
- list.push({ id: item.id || "", shopId: item.shopId, designIds: item.designIds || "", shopName: item.shopName })
- selecteds?.splice(index, 1);
- }
- });
- selecteds?.forEach(item => {
- list.push({ id: "", shopId: item.id, designIds: item.ids || "", shopName: item.name })
- })
- shop_list = list;
- let html = ``;
- shop_list.forEach(item => {
- html += '<tr>';
- html += `<td class="td1">店铺:</td><td class="td2">${item.shopName}</td>
- <td class="td1">技能</td><td class="td2">
- <div id="design_${item.shopId}" class="mini-combobox" style="width: 300px;" popupwidth="300" textfield="name" valuefield="id" value="${item.designIds}" data='${JSON.stringify(productList)}' multiselect="true" showclose="true" onvaluechanged="desgingChange('${item.shopId}')"><div property="columns">
- <div header="全部" field="name"></div>
- </div></div>
- </td>`
- html += '</tr>';
- })
- $("#txtShopDesign").after(html);
- mini.parse(html)
- }
- function desgingChange(e) {
- let ids = mini.get("design_" + e).getValue();
- let index = shop_list.findIndex(item => item.shopId == e);
- shop_list[index].designIds = ids;
- }
- function saveShopDesign() {
- let id = $("#hId").val();
- let params = {
- type: 0,
- data: JSON.stringify(shop_list),
- tarId: id,
- }
- postAjax("save_dic_info", params, function (data) {
- resultShow(data);
- })
- }
- function getDesignInfo() {
- if (shopList.length == 0 || productList.length == 0) {
- return;
- }
- let id = $("#hId").val();
- let params = {
- type: 0,
- tarId: id
- }
- if ($("#txtShopDesign").nextAll().length > 0) {
- $("#txtShopDesign").nextAll().remove();
- }
- shop_list = [];
- postAjax("get_design_info", params, function (data) {
- resultShow(data);
- if (data.length > 0) {
- let list = [];
- data.map(item => {
- let index = list.findIndex(e => e.shopId == item.shopId);
- let info = null;
- if (index == -1) {
- let name = '';
- for (let i = 0; i < shopList.length; i++) {
- if (item.shopId == shopList[i].id) {
- name = shopList[i].name;
- break;
- }
- }
- info = { shopId: item.shopId, name: name, ids: [] };
- list.push(info);
- index = list.length - 1;
- } else {
- info = list[index];
- }
- if (item.designId != 0) {
- info.ids.push(item.designId);
- } else {
- info.id = item.ID;
- }
- list[index] = info;
- })
- let shopids = []
- list.map(item => {
- shop_list.push({ id: item.id || "", shopId: item.shopId, designIds: item.ids.join(",") || "", shopName: item.name })
- shopids.push(item.shopId);
- })
- mini.get("designPemShop").setValue(shopids.join(","));
- let html = ``;
- shop_list.forEach(item => {
- html += '<tr>';
- html += `<td class="td1">店铺:</td><td class="td2">${item.shopName}</td>
- <td class="td1">技能</td><td class="td2">
- <div id="design_${item.shopId}" class="mini-combobox" style="width: 300px;" popupwidth="300" textfield="name" valuefield="id" value="${item.designIds}" data='${JSON.stringify(productList)}' multiselect="true" showclose="true" onvaluechanged="desgingChange('${item.shopId}')"><div property="columns">
- <div header="全部" field="name"></div>
- </div></div>
- </td>`
- html += '</tr>';
- })
- $("#txtShopDesign").after(html);
- mini.parse(html);
- }
- })
- }
- </script>
- </head>
- <body>
- <div style="display: none">
- <input runat="server" type="hidden" id="hClass" />
- <input type="hidden" id="hId" />
- <input type="hidden" id="hName" />
- <input type="hidden" id="hParentId" />
- <input type="hidden" id="hPemShop" />
- <a id="code_href" target="_blank" href="#">提示</a>
- </div>
- <div class="mini-layout" style="width: 100%; height: 100%;">
- <div id="m_tree_div" runat="server" region="west" runat="server" showheader="true" showspliticon="true" bodystyle="padding-left:1px;" width="200" minwidth="100" maxwidth="350">
- <input id="txtTreeKey" type="text" style="width: 92%;" />
- <ul id="m_tree" class="mini-tree" showtreeicon="true" onnodeselect="treeNodeSelFn_" textfield="name" idfield="id" parentfield="pid" style="width: 100%; height: 100%;" expandonload="0" enablehottrack="false"></ul>
- </div>
- <div title="填写内容" showheader="true" showcollapsebutton="false" region="center">
- <div class="mini-toolbar" style="padding: 1px; border-top: 0; border-left: 0; border-right: 0;">
- <a id="btnAdd" class="mini-button" iconcls="icon-add" plain="true" onclick="addFn()">新增</a>
- <span class="separator"></span>
- <%--<a id="btnSave" class="mini-button" iconCls="icon-save" plain="true" onclick="saveFn()">保存</a>--%>
- <a id="btnSave" class="mini-button" iconcls="icon-save" plain="true" onclick="saveFn_()">保存</a>
- <a id="btnDel" class="mini-button" iconcls="icon-remove" plain="true" onclick="delFn()">删除</a>
- <a id="btnBuild" runat="server" class="mini-button" iconcls="icon-downgrade" plain="true" onclick="builderFn()">生成操作</a>
- <a id="btnPerm" runat="server" class="mini-button" iconcls="icon-downgrade" plain="true" onclick="permsFn()">加入权限</a>
- <a id="btnTrans" class="mini-button" iconcls="icon-filter" plain="true" onclick="transferFn()">转移</a>
- <%--<a id="btnNextValue" class="mini-button" iconCls="icon-filter" plain="true" onclick="autoNextFn()">自动填入下一个</a>--%>
- </div>
- <form id="form1" runat="server">
- <table class="m_tb" border="0" cellspading="0" cellspacing="0">
- <tr>
- <td class="td1">父级:</td>
- <td class="td2">
- <input type="text" disabled="disabled" id="txtParentName" /></td>
- </tr>
- <tr>
- <td class="td1">名称<font color="red">*</font>:</td>
- <td class="td2">
- <input type="text" id="txtName" /></td>
- </tr>
- <tr>
- <td class="td1">编号:</td>
- <td class="td2">
- <input type="text" id="txtCode" /></td>
- </tr>
- <tr>
- <td class="td1">排序:</td>
- <td class="td2">
- <input type="text" id="txtSort" style="width: 50px" /></td>
- </tr>
- <tr>
- <td class="td1">删除:</td>
- <td class="td2">
- <input type="checkbox" id="chkDel" style="width: auto" /></td>
- </tr>
- <tr id="selOld" runat="server" visible="false">
- <td class="td1">老客户订单:</td>
- <td class="td2">
- <input type="checkbox" id="OldOrder" style="width: auto" /></td>
- </tr>
- <tr>
- <td class="td1" valign="top">备注:</td>
- <td class="td2">
- <textarea id="txtMemo" rows="3" style="width: 250px" cols="30"></textarea></td>
- </tr>
- <tr id="trOperate" runat="server" visible="false">
- <td class="td1">动作:</td>
- <td class="td2">
- <input type="checkbox" id="chkOperate" style="width: auto" /></td>
- </tr>
- <tr id="trIcon" runat="server" visible="false">
- <td class="td1">图标样式:</td>
- <td class="td2">
- <input type="text" id="txtIcon" style="width: 250px;" /></td>
- </tr>
- <tr id="trTag" runat="server" visible="false">
- <td class="td1">标签:</td>
- <td class="td2">
- <input type="text" id="txtTag" style="width: 250px;" /></td>
- </tr>
- <tr id="trUrl" runat="server" visible="false">
- <td class="td1">地址:</td>
- <td class="td2">
- <input type="text" id="txtUrl" style="width: 250px;" /></td>
- </tr>
- <tr id="trHostFieldName" runat="server" visible="false">
- <td class="td1">主机楼字段名:</td>
- <td class="td2">
- <input type="text" id="txtHostFieldName" style="width: 250px;" /></td>
- </tr>
- <tr id="trHostName" runat="server" visible="false">
- <td class="td1">主机楼名称:</td>
- <td class="td2">
- <input type="text" id="txtHostName" style="width: 250px;" /></td>
- </tr>
- <tr id="trMaxStock" runat="server" visible="false">
- <td class="td1">最大库存:</td>
- <td class="td2">
- <input type="text" id="txtMaxStock" style="width: 250px;" /></td>
- </tr>
- <tr id="trWaringStock" runat="server" visible="false">
- <td class="td1">预警库存:</td>
- <td class="td2">
- <input type="text" id="txtWaringStock" style="width: 250px;" /></td>
- </tr>
- </table>
- <table id="selShop" class="p_tb" border="0" cellspading="0" cellspacing="12" runat="server" visible="false">
- <tr>
- <td class="td1">关联店铺:</td>
- <td class="td2">
- <div id="selPemShop" class="mini-combobox" style="width: 300px;" popupwidth="300" textfield="name" valuefield="id"
- url="../Handler/sync.ashx?t=get_sel_shop" value="id" multiselect="true" showclose="true" oncloseclick="onCloseClick">
- <div property="columns">
- <div header="店铺" field="name"></div>
- </div>
- </div>
- </td>
- </tr>
- </table>
- <table id="designTable" class="p_tb" border="0" cellspading="0" cellspacing="12" runat="server" visible="false" style="display: none">
- <tr id="txtShopDesign">
- <td class="td1">抢单权限:</td>
- <td class="td2">
- <div id="designPemShop" class="mini-combobox" style="width: 300px;" popupwidth="300" allowinput="true" textfield="name" valuefield="id"
- url="../Handler/sync.ashx?t=get_sel_shop" value="id" multiselect="true" showclose="true" oncloseclick="onCloseClick">
- <div property="columns">
- <div header="店铺" field="name"></div>
- </div>
- </div>
- </td>
- </tr>
- </table>
- <div id="transfer_win" class="mini-window" title="转移节点" style="width: 300px; height: 210px;">
- <div class="mini-toolbar" style="border-top: 0; border-left: 0; border-right: 0;">
- <a class="mini-button" iconcls="icon-save" plain="true" onclick="saveTransferFn()">保存</a>
- </div>
- <table class="win_tb" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="td1">转移节点:</td>
- <td class="td2">
- <web:DropDownList ID="selTrans" runat="server"></web:DropDownList>
- </td>
- </tr>
- <tr>
- <td class="td1">排序:</td>
- <td class="td2">
- <input type="text" id="txtTransSort" class="mini-spinner" minvalue="0" maxvalue="100" />
- </td>
- </tr>
- </table>
- </div>
- <div id="win_line" class="mini-window" title="生成" style="width: 300px; height: 210px;">
- <div class="mini-toolbar" style="border-top: 0; border-left: 0; border-right: 0;">
- <a class="mini-button" iconcls="icon-save" plain="true" onclick="saveLineFn()">保存</a>
- </div>
- <table class="win_tb" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="td1">前缀:</td>
- <td class="td2">
- <input type="text" id="txtPrev" class="mini-textbox" minvalue="0" maxvalue="100" />
- </td>
- </tr>
- <tr>
- <td class="td1">开始:</td>
- <td class="td2">
- <input type="text" id="txtLineSt" class="mini-spinner" minvalue="0" maxvalue="1000" />
- </td>
- </tr>
- <tr>
- <td class="td1">数量:</td>
- <td class="td2">
- <input type="text" id="txtLineEt" class="mini-spinner" minvalue="0" maxvalue="1000" />
- </td>
- </tr>
- </table>
- </div>
- </form>
- </div>
- </div>
- <asp:Literal ID="litTree" runat="server"></asp:Literal>
- </body>
- </html>
|