Explorar o código

前后:合同编号修改;列表字段

dubch %!s(int64=4) %!d(string=hai) anos
pai
achega
2b566fc328

+ 23 - 9
src/dashoo.cn/backend/api/controllers/oilcontract/contract.go

@@ -761,22 +761,22 @@ func (this *OilContractController) ImportUpdate() {
 	Column := this.GetString("Column")
 	Id := this.GetString("Id")
 	SupplierId := this.GetString("SupplierId")
-	SupplierName := this.GetString("SupplierName")
 
 	var supp supplier.OilSupplier
+	var con contract.OilContract
 	svc := supplier.GetOilSupplierService(utils.DBE)
 	svc.GetEntityById(SupplierId, &supp)
 	sql := ""
 	var err error
+	var errinfo ErrorInfo
 	where := "1=1"
 	if Column == "ContractClass" {
 		if Id != "0" {
 			where += " and Id = " + Id + " and ImportStatus = 0 and ClassName = '" + Class + "'"
-			sql = "update OilContract set SupplierName = '" + supp.SupplierName + "', " + Column + " = '" + Value + "' where " + where
 		} else {
 			where += " and ImportStatus = 0 and ClassName = '" + Class + "' and " + Column + " = ''"
-			sql = "update OilContract set " + Column + " = '" + Value + "' where " + where
 		}
+		sql = "update OilContract set " + Column + " = '" + Value + "' where " + where
 		_, err = utils.DBE.Query(sql)
 	}
 	if Column == "SupplierId" {
@@ -794,7 +794,7 @@ func (this *OilContractController) ImportUpdate() {
 		svc.GetEntityByWhere("Base_Organize", "Id = "+Value, &org)
 		if Id != "0" {
 			where += " and Id = " + Id + " and ImportStatus = 0 and ImportSecondUnit = '" + Class + "'"
-			sql = "update OilContract set SecondUnitName = '" + org.Fullname + "',SupplierName = '" + supp.SupplierName + "', " + Column + " = " + Value + " where " + where
+			sql = "update OilContract set SecondUnitName = '" + org.Fullname + "', " + Column + " = " + Value + " where " + where
 		} else {
 			//where += " and ImportStatus = 0 and ImportSecondUnit = '" + Class + "' and " + Column + " = 0"
 			where += " and ImportStatus = 0 and ImportSecondUnit = '" + Class + "'"
@@ -805,21 +805,35 @@ func (this *OilContractController) ImportUpdate() {
 
 	if Column == "Status" {
 		where += " and Id = " + Id + " and ImportStatus = 0"
-		sql := "update OilContract set SupplierName = '" + supp.SupplierName + "', " + Column + " = " + Value + " where " + where
+		sql := "update OilContract set " + Column + " = " + Value + " where " + where
 		_, err = utils.DBE.Query(sql)
 	}
-	if Column == "SupplierName" {
+	if Column == "ContractNo" {
+		svc.GetEntityByWhere("OilContract", "ContractNo = '" + Value + "' and Id != " + Id, &con)
+		if Value == "" {
+			errinfo.Message = "修改失败!合同编号不能为空"
+			errinfo.Code = -1
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+			return
+		}
+		if con.Id > 0 {
+			errinfo.Message = "修改失败!合同编号不能重复"
+			errinfo.Code = -1
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+			return
+		}
 		where += " and Id = " + Id + " and ImportStatus = 0"
-		sql := "update OilContract set SupplierName = '" + SupplierName + "', " + Column + " = " + Value + " where " + where
+		sql := "update OilContract set " + Column + " = '" + Value + "' where " + where
 		_, err = utils.DBE.Query(sql)
 	}
 	if Column == "SettleStatus" {
 		where += " and Id = " + Id + " and ImportStatus = 0"
-		sql := "update OilContract set SupplierName = '" + supp.SupplierName + "', " + Column + " = '" + Value + "' where " + where
+		sql := "update OilContract set " + Column + " = '" + Value + "' where " + where
 		_, err = utils.DBE.Query(sql)
 	}
 
-	var errinfo ErrorInfo
 	if err == nil {
 		errinfo.Message = "修改成功!"
 		errinfo.Code = 0

+ 8 - 5
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-basis/index.vue

@@ -84,10 +84,14 @@
             </el-button>
           </template>
         </el-table-column>
-
         <el-table-column v-for="column in tableColumns" :key="column.Id"
-                         v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="140"
-                         :label="column.label" align="center" show-overflow-tooltip>
+                         v-if="column.prop == 'SupplierName' || column.prop == 'SecondUnitName' || column.prop == 'ContractName' || column.prop == 'ContractNo'" :prop="column.prop" sortable :min-width="240" :label="column.label" align="center" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <div>{{ columnFun(scope.row[column.prop], column.prop) }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column v-for="column in tableColumns" :key="column.Id"
+                         v-if="column.prop != 'CreateOn' && column.prop != 'SupplierName' && column.prop != 'SecondUnitName' && column.prop != 'ContractName' && column.prop != 'ContractNo'" :prop="column.prop" sortable :min-width="140" :label="column.label" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
             <div v-if="column.prop !== 'Status'">{{ columnFun(scope.row[column.prop], column.prop) }}</div>
             <div v-if="column.prop === 'Status'">
@@ -273,8 +277,7 @@ export default {
               break
           }
         } else if (index === 'StartDate' || index === 'EndDate' || index === 'SubmitDate') {
-          let timeString = this.timeStyle(item)
-          console.log(timeString, item, '123请问')
+          let timeString = this.jstimehandle(item)
           return timeString
         } else {
           return item

+ 8 - 4
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-goods/index.vue

@@ -83,10 +83,14 @@
             </el-button>
           </template>
         </el-table-column>
-
         <el-table-column v-for="column in tableColumns" :key="column.Id"
-                         v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="140"
-                         :label="column.label" align="center" show-overflow-tooltip>
+                         v-if="column.prop == 'SupplierName' || column.prop == 'SecondUnitName' || column.prop == 'ContractName' || column.prop == 'ContractNo'" :prop="column.prop" sortable :min-width="240" :label="column.label" align="center" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <div>{{ columnFun(scope.row[column.prop], column.prop) }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column v-for="column in tableColumns" :key="column.Id"
+                         v-if="column.prop != 'CreateOn' && column.prop != 'SupplierName' && column.prop != 'SecondUnitName' && column.prop != 'ContractName' && column.prop != 'ContractNo'" :prop="column.prop" sortable :min-width="140" :label="column.label" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
             <div v-if="column.prop !== 'Status'">{{ columnFun(scope.row[column.prop], column.prop) }}</div>
             <div v-if="column.prop === 'Status'">
@@ -270,7 +274,7 @@ export default {
               break
           }
         } else if (index === 'StartDate' || index === 'EndDate' || index === 'SubmitDate') {
-          return this.timeStyle(item)
+          return this.jstimehandle(item)
         } else {
           return item
         }

+ 35 - 17
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-import/index.vue

@@ -46,7 +46,7 @@
               <el-option label="服务商" value="03" key="04"></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="上报时间">
+          <el-form-item label="创建时间">
             <el-date-picker size="mini" style="width: 180px" v-model="CreateOn" type="daterange" range-separator="至"
                             start-placeholder="开始" end-placeholder="结束"></el-date-picker>
           </el-form-item>
@@ -89,9 +89,14 @@
             <el-button type="text" size="small" :disabled="!evaluateBoolean || scope.row.Status === 3" style="margin-left:3px"  icon="el-icon-edit-outline  " @click="onNavigateEvaluate(scope.row)">评价</el-button>
           </template>
         </el-table-column>
-
         <el-table-column v-for="column in tableColumns" :key="column.Id"
-                         v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable :min-width="140" :label="column.label" align="center" show-overflow-tooltip>
+                         v-if="column.prop == 'SupplierName' || column.prop == 'SecondUnitName' || column.prop == 'ContractName' || column.prop == 'ContractNo'" :prop="column.prop" sortable :min-width="240" :label="column.label" align="center" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <div>{{tableFun(column.prop,scope.row[column.prop])}}</div>
+          </template>
+        </el-table-column>
+        <el-table-column v-for="column in tableColumns" :key="column.Id"
+                         v-if="column.prop != 'CreateOn' && column.prop != 'SupplierName' && column.prop != 'SecondUnitName' && column.prop != 'ContractName' && column.prop != 'ContractNo'" :prop="column.prop" sortable :min-width="140" :label="column.label" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
             <div>{{tableFun(column.prop,scope.row[column.prop])}}</div>
           </template>
@@ -113,9 +118,9 @@
         <el-row>
 
           <el-col :span="12">
-            <el-form-item label="生成时间">
+            <el-form-item label="创建时间">
               <el-date-picker size="mini" v-model="CreateOn" type="daterange" style="width:100%" range-separator="至"
-                              start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
+                              start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
             </el-form-item>
           </el-col>
 
@@ -288,7 +293,11 @@
           <el-input size="mini" clearable v-model="searchForm.ContractNo" style="width: 150px;" placeholder="请输入合同编号"></el-input>
         </el-form-item>
         <el-form-item label="项目建设单位">
-          <el-input size="mini" clearable v-model="searchForm.ImportUnitName" style="width: 150px;" placeholder="请输入项目建设单位"></el-input>
+          <el-select filterable size="mini" v-model="searchForm.ImportSecondUnit" placeholder="请选择" style="width: 100%">
+            <el-option v-for="item in secondUnitOptions" :key="item.Id" :label="item.Fullname" :value="item.Id"
+                       style="width: 100%">
+            </el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="状态" style="width: 150px">
                   <el-select size="mini" v-model="searchForm.Status" placeholder="请选择" style="width: 100px" clearable>
@@ -356,8 +365,9 @@
           <el-table-column  prop="ContractNo"  min-width="200" label="合同编号" align="center" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-form-item  style="margin-bottom: 0px;" :prop="'tableData.' + scope.$index + '.ContractNo'" :rules="rules.ContractNo">
-                <el-input size="mini" v-model="scope.row.ContractNo" style="width:100%" placeholder="请输入" @blur="allUpdate(scope.row.SupplierId,scope.row.ImportSupplierName,'ContractNo',scope.row.Id, scope.row.SupplierId)"></el-input>
+                <el-input size="mini" v-model="scope.row.ContractNo" style="width:100%" placeholder="请输入" @blur.prevent=""></el-input>
               </el-form-item>
+              <el-button size="mini" type="primary" @click="allUpdate(scope.row.ContractNo,scope.row.ContractNo,'ContractNo',scope.row.Id,scope.row.SupplierId)">修改</el-button>
             </template>
           </el-table-column>
           <!--          <el-table-column  prop="SettleStatus"  min-width="110" label="结算状态" align="center" show-overflow-tooltip >-->
@@ -673,6 +683,7 @@
         searchForm: {
           Id: '',
           SupplierId: '',
+          ImportSecondUnit: '',
           SupplierName: '',
           ContractName: '',
           ProjectName: '',
@@ -786,32 +797,32 @@
           {
             prop: 'SupplierName',
             label: '企业名称',
-            width: 100,
+            width: 400,
             sort: true
           },
           {
             prop: 'SecondUnitName',
             label: '项目建设单位',
-            width: 100,
+            width: 120,
             sort: true
           },
 
           {
             prop: 'ContractName',
             label: '合同名称',
-            width: 100,
+            width: 300,
             sort: true
           },
           {
             prop: 'ClassName',
             label: '合同类别',
-            width: 100,
+            width: 80,
             sort: true
           },
           {
             prop: 'Status',
             label: '履行状态',
-            width: 100,
+            width: 70,
             sort: true
           },
           // {
@@ -823,7 +834,7 @@
           {
             prop: 'ContractClass',
             label: '企业类别',
-            width: 100,
+            width: 60,
             sort: true
           },
 
@@ -1097,10 +1108,17 @@
           this.contractSelete(value)
         }
         api.importUpdate(params, this.$axios).then(res => {
-          this.$message({
-            type: 'success',
-            message: res.data.message
-          })
+          if (res.data.code === 0) {
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
           this.initDatas1()
         })
       },

+ 8 - 3
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-service/index.vue

@@ -85,8 +85,13 @@
         </el-table-column>
 
         <el-table-column v-for="column in tableColumns" :key="column.Id"
-                         v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="140"
-                         :label="column.label" align="center" show-overflow-tooltip>
+                         v-if="column.prop == 'SupplierName' || column.prop == 'SecondUnitName' || column.prop == 'ContractName' || column.prop == 'ContractNo'" :prop="column.prop" sortable :min-width="240" :label="column.label" align="center" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <div>{{ columnFun(scope.row[column.prop], column.prop) }}</div>
+          </template>
+        </el-table-column>
+        <el-table-column v-for="column in tableColumns" :key="column.Id"
+                         v-if="column.prop != 'CreateOn' && column.prop != 'SupplierName' && column.prop != 'SecondUnitName' && column.prop != 'ContractName' && column.prop != 'ContractNo'" :prop="column.prop" sortable :min-width="140" :label="column.label" align="center" show-overflow-tooltip>
           <template slot-scope="scope">
             <div v-if="column.prop !== 'Status'">{{ columnFun(scope.row[column.prop], column.prop) }}</div>
             <div v-if="column.prop === 'Status'">
@@ -271,7 +276,7 @@ export default {
               break
           }
         } else if (index === 'StartDate' || index === 'EndDate' || index === 'SubmitDate') {
-          let timeString = this.timeStyle(item)
+          let timeString = this.jstimehandle(item)
           return timeString
         } else {
           return item