MaiXinRong 6 часов назад
Родитель
Сommit
119f372242

+ 4 - 0
app/controller/sub_proj_controller.js

@@ -229,9 +229,13 @@ module.exports = app => {
             try {
                 const info = await this.ctx.service.subProjInfo.getInfo(ctx.subProject.id);
                 info.lx_tp = await this.ctx.service.budgetGu.getSumTp(ctx.subProject.budget_id);
+                if (info.lx_tp_unit === '万元') info.lx_tp = this.ctx.helper.div(info.lx_tp, 10000, 6);
                 info.cb_tp = await this.ctx.service.budgetGai.getSumTp(ctx.subProject.budget_id);
+                if (info.cb_tp_unit === '万元') info.cb_tp = this.ctx.helper.div(info.cb_tp, 10000, 6);
                 info.sgt_tp = await this.ctx.service.budgetYu.getSumTp(ctx.subProject.budget_id);
+                if (info.sgt_tp_unit === '万元') info.sgt_tp = this.ctx.helper.div(info.sgt_tp, 10000, 6);
                 info.zbys_tp = await this.ctx.service.budgetZb.getSumTp(ctx.subProject.budget_id);
+                if (info.zbys_tp_unit === '万元') info.zbys_tp = this.ctx.helper.div(info.zbys_tp, 10000, 6);
                 const renderData = {
                     info,
                     jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.subProject.info),

+ 1 - 0
app/service/sub_proj_permission.js

@@ -42,6 +42,7 @@ module.exports = app => {
                 info: {
                     view: { title: '查看', value: 1},
                     edit: { title: '编辑', value: 2 },
+                    editfile: { title: '编辑文件', value: 3 },
                 },
                 datacollect: {
                     view: { title: '查看', value: 1},

+ 56 - 7
app/view/sub_proj/info.ejs

@@ -134,7 +134,15 @@
                             <div class="col-3">
                                 <div class="form-group">
                                     <label for="">金额:</label>
-                                    <input type="text" class="form-control form-control-sm" name="lx_tp" value="<%- info.lx_tp %>" org="<%- info.lx_tp %>" maxlength="50" readonly>
+                                    <div class="input-group">
+                                        <input type="text" class="form-control form-control-sm" name="lx_tp" value="<%- info.lx_tp %>" org="<%- info.lx_tp %>" maxlength="50" readonly>
+                                        <div class="input-group-append">
+                                            <select class="input-group-text p-0" name="lx_tp_unit" style="font-size:0.75rem" value="<%- info.lx_tp_unit %>" org="<%- info.lx_tp_unit%>" onchange="changeInfo(this, false, true)" <% if (readOnly) { %>readOnly<% } %>>
+                                                <option value="元" <%if (info.lx_tp_unit === '元') { %>selected<% } %>>元</option>
+                                                <option value="万元" <%if (info.lx_tp_unit === '万元') { %>selected<% } %>>万元</option>
+                                            </select>
+                                        </div>
+                                    </div>
                                 </div>
                             </div>
                             <div class="col-12">
@@ -167,7 +175,15 @@
                             <div class="col-3">
                                 <div class="form-group">
                                     <label for="">金额:</label>
-                                    <input type="text" class="form-control form-control-sm" name="cb_tp" value="<%- info.cb_tp %>" org="<%- info.cb_tp %>" maxlength="50" readonly>
+                                    <div class="input-group">
+                                        <input type="text" class="form-control form-control-sm" name="cb_tp" value="<%- info.cb_tp %>" org="<%- info.cb_tp %>" maxlength="50" readonly>
+                                        <div class="input-group-append">
+                                            <select class="input-group-text p-0" name="cb_tp_unit" style="font-size:0.75rem" value="<%- info.cb_tp_unit %>" org="<%- info.cb_tp_unit%>" onchange="changeInfo(this, false, true)" <% if (readOnly) { %>readOnly<% } %>>
+                                                <option value="元" <%if (info.cb_tp_unit === '元') { %>selected<% } %>>元</option>
+                                                <option value="万元" <%if (info.cb_tp_unit === '万元') { %>selected<% } %>>万元</option>
+                                            </select>
+                                        </div>
+                                    </div>
                                 </div>
                             </div>
                             <div class="col-12">
@@ -200,7 +216,15 @@
                             <div class="col-3">
                                 <div class="form-group">
                                     <label for="">金额:</label>
-                                    <input type="text" class="form-control form-control-sm" name="sgt_tp" value="<%- info.sgt_tp %>" org="<%- info.sgt_tp %>" maxlength="50" readonly>
+                                    <div class="input-group">
+                                        <input type="text" class="form-control form-control-sm" name="sgt_tp" value="<%- info.sgt_tp %>" org="<%- info.sgt_tp %>" maxlength="50" readonly>
+                                        <div class="input-group-append">
+                                            <select class="input-group-text p-0" name="sgt_tp_unit" style="font-size:0.75rem" value="<%- info.sgt_tp_unit %>" org="<%- info.sgt_tp_unit%>" onchange="changeInfo(this, false, true)" <% if (readOnly) { %>readOnly<% } %>>
+                                                <option value="元" <%if (info.sgt_tp_unit === '元') { %>selected<% } %>>元</option>
+                                                <option value="万元" <%if (info.sgt_tp_unit === '万元') { %>selected<% } %>>万元</option>
+                                            </select>
+                                        </div>
+                                    </div>
                                 </div>
                             </div>
                             <div class="col-12">
@@ -233,7 +257,15 @@
                             <div class="col-3">
                                 <div class="form-group">
                                     <label for="">金额:</label>
-                                    <input type="text" class="form-control form-control-sm" name="pf_tp" value="<%- info.pf_tp %>" org="<%- info.pf_tp %>" maxlength="50" onblur="changeInfo(this, true)" <% if (readOnly) { %>readOnly<% } %>>
+                                    <div class="input-group">
+                                        <input type="text" class="form-control form-control-sm" name="pf_tp" value="<%- info.pf_tp %>" org="<%- info.pf_tp %>" maxlength="50" onblur="changeInfo(this, true)" <% if (readOnly) { %>readOnly<% } %>>
+                                        <div class="input-group-append">
+                                            <select class="input-group-text p-0" style="font-size:0.75rem" name="pf_tp_unit" value="<%- info.pf_tp_unit %>" org="<%- info.pf_tp_unit%>" onchange="changeInfo(this)" <% if (readOnly) { %>readOnly<% } %>>
+                                                <option value="元" <%if (info.pf_tp_unit === '元') { %>selected<% } %>>元</option>
+                                                <option value="万元" <%if (info.pf_tp_unit === '万元') { %>selected<% } %>>万元</option>
+                                            </select>
+                                        </div>
+                                    </div>
                                 </div>
                             </div>
                             <div class="col-12">
@@ -266,7 +298,15 @@
                             <div class="col-3">
                                 <div class="form-group">
                                     <label for="">金额:</label>
-                                    <input type="text" class="form-control form-control-sm" name="zb_tp" value="<%- info.zb_tp %>" org="<%- info.zb_tp %>" maxlength="50" onblur="changeInfo(this, true)" <% if (readOnly) { %>readOnly<% } %>>
+                                    <div class="input-group">
+                                        <input type="text" class="form-control form-control-sm" name="zb_tp" value="<%- info.zb_tp %>" org="<%- info.zb_tp %>" maxlength="50" onblur="changeInfo(this, true)" <% if (readOnly) { %>readOnly<% } %>>
+                                        <div class="input-group-append">
+                                            <select class="input-group-text p-0" name="pf_tp_unit" style="font-size:0.75rem" value="<%- info.pf_tp_unit %>" org="<%- info.pf_tp_unit%>" onchange="changeInfo(this)" <% if (readOnly) { %>readOnly<% } %>>
+                                                <option value="元" <%if (info.pf_tp_unit === '元') { %>selected<% } %>>元</option>
+                                                <option value="万元" <%if (info.pf_tp_unit === '万元') { %>selected<% } %>>万元</option>
+                                            </select>
+                                        </div>
+                                    </div>
                                 </div>
                             </div>
                             <div class="col-12">
@@ -326,7 +366,15 @@
                             <div class="col-3">
                                 <div class="form-group">
                                     <label for="">金额:</label>
-                                    <input type="text" class="form-control form-control-sm" name="jg_tp" value="<%- info.jg_tp %>" org="<%- info.jg_tp %>" maxlength="50" onblur="changeInfo(this, true)" <% if (readOnly) { %>readOnly<% } %>>
+                                    <div class="input-group">
+                                        <input type="text" class="form-control form-control-sm" name="jg_tp" value="<%- info.jg_tp %>" org="<%- info.jg_tp %>" maxlength="50" onblur="changeInfo(this, true)" <% if (readOnly) { %>readOnly<% } %>>
+                                        <div class="input-group-append">
+                                            <select class="input-group-text p-0" name="pf_tp_unit" style="font-size:0.75rem" value="<%- info.pf_tp_unit %>" org="<%- info.pf_tp_unit%>" onchange="changeInfo(this)" <% if (readOnly) { %>readOnly<% } %>>
+                                                <option value="元" <%if (info.pf_tp_unit === '元') { %>selected<% } %>>元</option>
+                                                <option value="万元" <%if (info.pf_tp_unit === '万元') { %>selected<% } %>>万元</option>
+                                            </select>
+                                        </div>
+                                    </div>
                                 </div>
                             </div>
                         </div>
@@ -417,7 +465,7 @@
             obj.value = obj.value.substr(0, obj.maxLength);
         }
     }
-    function changeInfo(obj, isNum = false) {
+    function changeInfo(obj, isNum = false, reload = false) {
         const field = obj.getAttribute('name');
         if (!field) return;
         if (obj.getAttribute('org') === obj.value) return;
@@ -435,6 +483,7 @@
         }
         postData('info/save', { updateData }, function (result) {
             obj.setAttribute('org', obj.value);
+            if (reload) window.location.reload();
         }, function () {
             obj.value = obj.getAttribute('org');
         });

+ 10 - 0
sql/update.sql

@@ -7,6 +7,16 @@
 -- 表结构
 ------------------------------------
 
+ALTER TABLE `zh_sub_project_info`
+ADD COLUMN `lx_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '立项-金额单位' AFTER `lx_tp`,
+ADD COLUMN `cb_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '初步-金额单位' AFTER `cb_tp`,
+ADD COLUMN `sg_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '施工许可批复-金额单位' AFTER `sg_tp`,
+ADD COLUMN `jg_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '交工-金额单位' AFTER `jg_tp`,
+ADD COLUMN `sgt_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '施工图-金额单位' AFTER `sgt_tp`,
+ADD COLUMN `pf_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '财评/造价站批复-金额单位' AFTER `pf_tp`,
+ADD COLUMN `zb_tp_unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '元' COMMENT '招标完成-金额单位' AFTER `zb_tp`;
+
+
 
 
 ------------------------------------