123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
-
- @{
- ViewBag.Title = "EditWindow";
- Layout = "~/Views/Shared/_MainLayoutPage.cshtml";
- }
- <style>
- table {
- width: 97%;
- }
- table td {
- padding: 5px 0px;
- /*border-bottom: solid 1px #EEE;*/
- }
- .layui-form-radio {
- margin: 0px;
- padding: 0px
- }
- .combobox-item {
- width: 1000px;
- }
- .combobox-item {
- width: 1000px;
- }
- </style>
- <form fit="true" class="layui-form" lay-filter="lteration" id="lteration">
- <input type="hidden" id="ID" name="ID" />
- <table>
- <tr>
- <td style="text-align: right; ">
- 标题:
- </td>
- <td>
- <input id="MC" name="MC" required autofocus class="easyui-textbox" style="width: 700px " />
- </td>
- </tr>
- <tr>
- <td style="text-align:right;">
- 有效日期:
- </td>
- <td>
- <input id="KSRJ" name="KSRJ" type="text" class="easyui-datebox" required style="width:120px">
- 至:
- <input id="JSRJ" name="JSRJ" type="text" class="easyui-datebox" required style="width:120px;" />
- <div class="layui-input-block" style="width:413px;margin-left:0px;float:right">
- <input type="radio" name="LX1" value="1" lay-filter="LX" title="一周">
- <input type="radio" name="LX1" value="2" lay-filter="LX" title="两周">
- <input type="radio" name="LX1" value="3" lay-filter="LX" title="一个月">
- <input type="radio" name="LX1" value="4" lay-filter="LX" title="两个月">
- <input type="radio" name="LX1" value="5" lay-filter="LX" title="三个月">
- <input type="radio" name="LX1" value="6" lay-filter="LX" title="半年">
- </div>
- </td>
- </tr>
- <tr style="margin-top:20px">
- <td style="text-align:right;width:105px">类型:</td>
- <td>
- <input id="LX" name="LX" required panelheight="300px" editable="false" class="easyui-combobox xmid" data-options="labelAlign:'right',limitToList:true,tipPosition:'top'" style="width:275px;" />
- </td>
- </tr>
- <tr style="margin-top:20px">
- <td style="text-align:right;width:105px">产品:</td>
- <td>
- <input id="CPID" name="CPID" required panelheight="275px" class="easyui-combobox" data-options="limitToList:true" style="width:275px;" />
- </td>
- </tr>
- <tr style="margin-top:20px">
- <td style="text-align:right;width:105px">项目:</td>
- <td>
- <input id="XMID" name="XMID" panelheight="200px" class="easyui-combobox" data-options="limitToList:true,tipPosition:'top'" style="width:275px;" />
- </td>
- </tr>
- <tr style="margin-top:20px">
- <td style="text-align:right;width:105px">渠道:</td>
- <td>
- <input id="QDID" name="QDID" panelheight="200px" class="easyui-combobox" data-options="limitToList:true,tipPosition:'top'" style="width:275px;" />
- </td>
- </tr>
- <tr style="margin-top:20px">
- <td style="text-align:right;width:105px">责任人:</td>
- <td>
- <input id="ZRRID" name="ZRRID" required panelheight="200px" class="easyui-combobox" data-options="limitToList:true,tipPosition:'top'" style="width:275px;" />
- </td>
- </tr>
- <tr style="margin-top:20px">
- <td style="text-align:right;width:105px">状态:</td>
- <td>
- <div class="layui-input-block" style="width:413px;margin-left:0px;float:left;margin-top:10px">
- <input type="radio" name="ZT" value="1" title="未完成">
- <input type="radio" name="ZT" value="2" title="未开始">
- <input type="radio" name="ZT" value="3" title="进行中">
- <input type="radio" name="ZT" value="4" title="已关闭">
- </div>
- </td>
- </tr>
- <tr>
- <td style="text-align:right;width: 105px">描述:</td>
- <td colspan="2">
- <textarea id="MS" name="MS" style="width:100%;height:140px;"></textarea>
- </td>
- </tr>
- </table>
- <div class="layui-input-inline" style="width: 300px;position: fixed;bottom: 10px;right: -150px">
- <a href="#" onclick="Confrim()" class="easyui-linkbutton c1"><i class="fa fa-pencil"></i> 确认</a>
- <a onclick="Close()" href="#" class="easyui-linkbutton c5"><i class="fa fa-power-off"></i> 关闭</a>
- </div>
- </form>
- <script type="text/javascript">
- $(function () {
- layui.use('form', function () {
- var form = layui.form;
- form.on('radio(LX)', function (data) {
- $.post("/Problem/GetDateRange?type=" + data.value, function (result) {
- if (result.state) {
- $("#KSRJ").datebox("setValue", result.Sdate)
- $("#JSRJ").datebox("setValue", result.Edate)
- }
- })
- });
- });
- $("#LX").combobox({
- method: 'post',
- url: "/Problem/GetBaseCode?type=2DDA172A-499A-40CC-BA6A-29AB0FAEEDCB",
- valueField: '代码',
- textField: '显示名'
- })
- $("#CPID").combobox({
- method: 'post',
- url: "/Product/GetAllProducts",
- valueField: 'ID',
- textField: '名称'
- })
- $("#XMID").combobox({
- url: '/Problem/GetProjectByInfo',
- valueField: 'ID',
- textField: '名称',
- limitToList: true,
- onChange: function (newValue, oldValue) {
- if (newValue.length == 36) {
- //项目所属的渠道
- $("#QDID").combobox({
- url: '/Problem/GetChannelByInfo/' + newValue,
- valueField: 'ID',
- textField: '名称',
- onLoadSuccess: function (data) {
- $("#QDID").combobox("setValue", data[0].ID);
- }
- })
- }
- }
- })
- $("#ZRRID").combobox({
- method: 'post',
- url: "/Problem/GetFKR",
- valueField: 'ID',
- textField: '姓名'
- })
- if (@ViewBag.type== 2) {
- $.post("/Lteration/GetDataById?id=" +"@ViewBag.id",function(data){
- $("#ID").val(data[0].ID)
- $("#MC").textbox("setValue",data[0].名称)
- $("#KSRJ").datebox("setValue", data[0].开始日期)
- $("#JSRJ").datebox("setValue", data[0].结束日期)
- $("#LX").combobox("setValue", data[0].类型)
- $("#CPID").combobox("setValue", data[0].产品ID)
- $("#XMID").combobox("setValue", data[0].项目ID)
- $("#QDID").combobox("setValue", data[0].渠道ID)
- $("#ZRRID").combobox("setValue", data[0].责任人ID)
- $("#MS").val(data[0].描述)
- layui.use(['form'], function () {
- var form = layui.form
- //表单赋值
- form.val('lteration', {
- "ZT": data[0].状态.toString()
- });
- form.render()
- })
- })
- }
- })
- function Confrim() {
- //执行提交验证
- var r = $('#lteration').form('validate');
- var url='/Lteration/Save?type=1'
- if (@ViewBag.type== 2) {
- url='/Lteration/Save?type=2'
- }
- if (r) { //post到后台
- var loading = ZLPMS.Loading3(0)
- var param = ZLPMS.FormToObject('lteration');
- if (param.ZT == null) {
- top.ZLPMS.Msg("请选择迭代状态", 3)
- ZLPMS.UnLoading(loading)
- return
- }
- $.post(url, param, function (data) {
- if (data == 1) {
- ZLPMS.UnLoading(loading)
- top.ZLPMS.Msg("保存成功", 1);
- ZLPMS.CloseTopWindow(true);
- } else {
- ZLPMS.UnLoading(loading)
- top.ZLPMS.Msg("保存失败,请联系管理员", 2);
- ZLPMS.CloseTopWindow(true);
- }
- });
- }
- }
- function Close() {
- ZLPMS.CloseTopWindow(true);
- }
- </script>
|