|
@@ -232,7 +232,7 @@ $(document).ready(function() {
|
|
|
if (projectInfo !== null) {
|
|
|
let parentID = projectInfo.data.ID;
|
|
|
// 获取当前的数据属性
|
|
|
- getProperty(parentID);
|
|
|
+ getProperty(projectInfo.data);
|
|
|
}
|
|
|
|
|
|
});
|
|
@@ -931,7 +931,7 @@ function GetTargetTreeNode(zTreeObj) {
|
|
|
*/
|
|
|
function getEngineeringHtml(engineeringList) {
|
|
|
let result = '<option>请选择对应的工程专业</option>';
|
|
|
- if (Object.keys(engineeringList).length <= 0) {
|
|
|
+ if (engineeringList.length <= 0) {
|
|
|
return result;
|
|
|
}
|
|
|
let engineeringObject = {};
|
|
@@ -951,50 +951,24 @@ function getEngineeringHtml(engineeringList) {
|
|
|
/**
|
|
|
* 远程获取项目属性数据
|
|
|
*
|
|
|
- * @param {Number} id
|
|
|
- * @return {Object}
|
|
|
+ * @param {Object} projectInfo
|
|
|
+ * @return {void}
|
|
|
*/
|
|
|
-function getProperty(id) {
|
|
|
- if (isSaving) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- id = parseInt(id);
|
|
|
- if (isNaN(id) || id <= 0) {
|
|
|
- return {};
|
|
|
+function getProperty(projectInfo) {
|
|
|
+ if (projectInfo.property === undefined) {
|
|
|
+ return;
|
|
|
}
|
|
|
-
|
|
|
- $.ajax({
|
|
|
- url: '/pm/api/getProjectProperty',
|
|
|
- type: 'post',
|
|
|
- data: {data: JSON.stringify({user_id: userID, id: id})},
|
|
|
- dataType: 'json',
|
|
|
- timeout: 5000,
|
|
|
- error: function() {
|
|
|
- isSaving = false;
|
|
|
- alert('操作失败!');
|
|
|
- },
|
|
|
- beforeSend: function() {
|
|
|
- isSaving = true;
|
|
|
- },
|
|
|
- success: function(response) {
|
|
|
- if (response.error === 0) {
|
|
|
- projectProperty = response.data;
|
|
|
- // 写入专业工程相关
|
|
|
- let engineeringHtml = getEngineeringHtml(projectProperty.engineeringList);
|
|
|
- $("#tender-engineering").html(engineeringHtml);
|
|
|
-
|
|
|
- // 填入计价规则
|
|
|
- let valuationHtml = '<option value="'+ projectProperty.valuation +'">'+ projectProperty.valuationName +'</option>';
|
|
|
- $("#tender-valuation").html(valuationHtml);
|
|
|
-
|
|
|
- // 选中计价方式
|
|
|
- $("input[name='tender_valuation_type']").attr('disabled', 'disabled').removeAttr('checked', 'checked');
|
|
|
- $("input[name='tender_valuation_type'][value='"+ projectProperty.valuationType +"']")
|
|
|
- .attr("checked", "checked").removeAttr('disabled', 'disabled');
|
|
|
-
|
|
|
- } else {
|
|
|
- alert(response.message);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ projectProperty = projectInfo.property;
|
|
|
+ // 写入专业工程相关
|
|
|
+ let engineeringHtml = getEngineeringHtml(projectProperty.engineeringList);
|
|
|
+ $("#tender-engineering").html(engineeringHtml);
|
|
|
+
|
|
|
+ // 填入计价规则
|
|
|
+ let valuationHtml = '<option value="'+ projectProperty.valuation +'">'+ projectProperty.valuationName +'</option>';
|
|
|
+ $("#tender-valuation").html(valuationHtml);
|
|
|
+
|
|
|
+ // 选中计价方式
|
|
|
+ $("input[name='tender_valuation_type']").attr('disabled', 'disabled').removeAttr('checked', 'checked');
|
|
|
+ $("input[name='tender_valuation_type'][value='"+ projectProperty.valuationType +"']")
|
|
|
+ .attr("checked", "checked").removeAttr('disabled', 'disabled');
|
|
|
}
|