123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- @using LeaRun.Application.Entity.InstallManage
- @{
- ViewBag.Title = "添加产品";
- Layout = "~/Views/Shared/_Form.cshtml";
- List<InstallMaterialTypeEntity> lstType = ViewBag.databaseType as List<InstallMaterialTypeEntity>;
- List<InstallMaterialGoodsEntity> lstGoods = ViewBag.databaseGoods as List<InstallMaterialGoodsEntity>;
- //List<InstallMaterialGoodsEntity> lstGoodsTemp = null;
- List<InstallMaterialUnitEntity> lstUnit = ViewBag.databaseUnit as List<InstallMaterialUnitEntity>;
- }
- <script>
- var keyValue = request('keyValue');
- $(function () {
- //function checkField(d) {
- // $("#myGoodsSpec").val(我是传奇);
- // //alert("规格型号是 " + d);
- //}
- initControl();
- });
- //初始化控件
- function initControl() {
- //材料名称
- $("#name").ComboBox({
- description: "==请选择110==",
- height: "200px",
- });
- //材料型号
- $("#Version").ComboBox({
- description: "==请选择110==",
- height: "200px",
- });
- //单位
- $("#unit").ComboBox({
- description: "==请选择110==",
- height: "200px",
- });
- //材料类别
- $("#Type").ComboBox({
- description: "==请选择110==",
- height: "200px",
- });
- $("#myGoodsName").ComboBox({
- description: "==请选择==",
- height: "200px",
- });
- //获取表单 界面加载的时候从数据库取得数据加载到界面
- //if (!!keyValue) {
- // $.SetForm({
- // url: "../../InstallManage/Dudget/GetBudgetDetail",
- // //param: { keyValue: keyValue },
- // success: function (data) {
- // $("#form1").SetWebControls(data);
- // }
- // })
- //}
- }
- //保存表单;
- function AcceptClick() {
- if (!$('#form1').Validform()) {
- return false;
- }
- var postData = $("#form1").GetWebControls(keyValue);
- postData["TraceUserName"] = $("#TraceUserId").attr('data-text');
- $.SaveForm({
- url: "../../InstallManage/Dudget/SaveForma?applyId=" + keyValue,
- param: postData,
- loading: "正在保存数据...",
- success: function () {
- //var a = document.getElementById('Form').contentWindow.document;
- //var b = a.getElementById('gridTableForm');
- ////$(b).trigger("reloadGrid");
- //var c = $(b);
- //c.context = a;
- //c.selector = '#gridTableForm';
- //c.trigger("reloadGrid");
- // $("#gridTableForm").trigger("reloadGrid");
- // console.log($("#gridTableForm").context.getElementById('gridTableForm'));
- $.currentIframe().$("#gridTableForm").trigger("reloadGrid");
- }
- })
- }
- </script>
- <script>
- function checkField(d) {
- $("#myGoodsSpec").val(d);
- //alert("规格型号是 " + d );
- }
- function MaterialClick(val) {
- //lstGoodsTemp = lstGoods;
- alert(lstGoods);
- }
- </script>
- <div style="margin-top: 20px; margin-right: 30px;">
- <table class="form">
- @*<tr>
- <td class="formTitle">客户名称<font face="宋体">*</font></td>
- <td class="formValue">
- <input id="FullName" type="text" onblur="$.ExistField(this.id,'../../CustomerManage/Customer/ExistFullName')" class="form-control" />
- </td>
- <td class="formTitle">客户简称<font face="宋体">*</font></td>
- <td class="formValue">
- <input id="ShortName" type="text" class="form-control" />
- </td>
- </tr>*@
- <tr>
- <td class="formTitle">材料类别<font face="宋体">*</font></td>
- <td class="formValue">
- <div id="Type" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull">
- <ul>
- @foreach (var item in lstType)
- {
- <li data-value="@item.MaterialId" onclick="MaterialClick('@item.MaterialId')">@item.Name</li>
- }
- </ul>
- </div>
- @*<div>
- <span>
- <select id="myType" required="required" style="width: 250px;">
- <option>==请选择==</option>
- @foreach (var item in lstType)
- {
- <option value="@item.MaterialId">@item.Name</option>
- }
- </select>
- </span>
- </div>*@
- </td>
- <td class="formTitle">材料名称<font face="宋体">*</font></td>
- <td class="formValue">
- <div id="name" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull">
- <ul>
- @foreach (var item in lstGoods)
- {
- <li data-value="@item.GoodId" mydata="@item.Specifications" onclick="checkField('@item.Specifications')">@item.Name</li>
- }
- </ul>
- </div>
- @*<select onclick="checkField(options[this.options.selectedIndex].getAttribute('mydata'))">
- @foreach (var item in lstGoods)
- {
- <option value="@item.GoodId" mydata="@item.Specifications">@item.Name</option>
- }
- </select>*@
- </td>
- </tr>
- <tr>
- <td class="formTitle">材料型号<font face="宋体">*</font>
- </td>
- <td class="formValue">
- <div>
- <span>
- <input type="text" name="myGoodsSpec" value="" id="myGoodsSpec" readonly="true" style="width: 260px; height: 28px;" />
- </span>
- </div>
- </td>
- <td class="formTitle">计量单位<font face="宋体">*</font></td>
- <td class="formValue">
- <div id="unit" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull">
- <ul>
- @foreach (var item in lstUnit)
- {
- <li data-value="@item.UnitId">@item.CalculateUnit</li>
- }
- </ul>
- </div>
- @*<div>
- <span>
- <select id="myUnit" required="required" style="width: 250px;">
- <option>==请选择==</option>
- @foreach (var item in lstUnit)
- {
- <option value="@item.UnitId">@item.CalculateUnit</option>
- }
- </select>
- </span>
- </div>*@
- </td>
- </tr>
- <tr>
- <td class="formTitle">数量</td>
- <td class="formValue">
- <input id="number" type="number" class="form-control" style="width: 260px;" />
- </td>
- <td class="formTitle">单价(元)</td>
- <td class="formValue">
- <input id="price" type="number" class="form-control" style="width: 260px;" />
- </td>
- </tr>
- <tr>
- <td class="formTitle">人工费(元)</td>
- <td class="formValue">
- <input id="LabourCost" type="number" class="form-control" style="width: 260px;" />
- </td>
- </tr>
- @*<tr>
- <td class="formTitle">公司情况</td>
- <td class="formValue" colspan='3'>
- <input id="CompanyDesc" type="text" class="form-control" />
- </td>
- </tr>
- <tr>
- <td class="formTitle">公司地址</td>
- <td class="formValue" colspan='3'>
- <input id="CompanyAddress" type="text" class="form-control" />
- </td>
- </tr>
- <tr>
- <td class="formTitle">所在省份</td>
- <td class="formValue">
- <div id="Province" type="select" class="ui-select"></div>
- </td>
- <td class="formTitle">所在城市</td>
- <td class="formValue">
- <div id="City" type="select" class="ui-select"></div>
- </td>
- </tr>
- <tr>
- <td class="formTitle">联系人<font face="宋体">*</font></td>
- <td class="formValue">
- <input id="Contact" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
- </td>
- <td class="formTitle">手机</td>
- <td class="formValue">
- <input id="Mobile" type="text" class="form-control" />
- </td>
- </tr>
- <tr>
- <td class="formTitle">电话</td>
- <td class="formValue">
- <input id="Tel" type="text" class="form-control" />
- </td>
- <td class="formTitle">传真</td>
- <td class="formValue">
- <input id="Fax" type="text" class="form-control" />
- </td>
- </tr>
- <tr>
- <td class="formTitle">QQ</td>
- <td class="formValue">
- <input id="QQ" type="text" class="form-control" />
- </td>
- <td class="formTitle">Email</td>
- <td class="formValue">
- <input id="Email" type="text" class="form-control" />
- </td>
- </tr>
- <tr>
- <td class="formTitle">微信</td>
- <td class="formValue">
- <input id="Wechat" type="text" class="form-control" />
- </td>
- <td class="formTitle">爱好</td>
- <td class="formValue">
- <input id="Hobby" type="text" class="form-control" />
- </td>
- </tr>*@
- <tr>
- <td class="formTitle">备注</td>
- <td class="formValue" colspan='3'>
- <textarea id="Description" class="form-control" style="height: 50px;"></textarea>
- </td>
- </tr>
- </table>
- </div>
|