浏览代码

前后:合同优化

dubch 4 年之前
父节点
当前提交
6fa86c8887

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

@@ -50,6 +50,7 @@ func (this *OilContractController) GetEntityList() {
 	Id := this.GetString("Id")
 	SupplierId := this.GetString("SupplierId")
 	SupplierName := this.GetString("SupplierName")
+	ImportSupplierName := this.GetString("ImportSupplierName")
 	Status := this.GetString("Status")
 	SettleStatus := this.GetString("SettleStatus")
 	ProjectName := this.GetString("ProjectName")
@@ -122,6 +123,10 @@ func (this *OilContractController) GetEntityList() {
 		where = where + " and SupplierName like '%" + SupplierName + "%'"
 	}
 
+	if ImportSupplierName != "" {
+		where = where + " and ImportSupplierName like '%" + ImportSupplierName + "%'"
+	}
+
 	if Status != "" {
 		where = where + " and Status=" + Status + " "
 	}
@@ -568,6 +573,7 @@ func (this *OilContractController) ImportExcel() {
 			svc.GetEntityByWhere(OilSupplierName, "SupplierName = '"+con.ImportSupplierName+"'", &supp)
 			if supp.Id > 0 {
 				con.SupplierId = supp.Id
+				con.SupplierName = supp.SupplierName
 			}
 			var org organize.Base_Organize
 			svc.GetEntityByWhere("Base_Organize", "FullName = '"+sheet.Rows[i].Cells[7].String()+"'", &org)
@@ -700,7 +706,7 @@ func (this *OilContractController) ImportUpdate() {
 	var err error
 	where := "1=1"
 	if Column == "ContractClass" {
-		if Id != "" {
+		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 {
@@ -710,7 +716,7 @@ func (this *OilContractController) ImportUpdate() {
 		_, err = utils.DBE.Query(sql)
 	}
 	if Column == "SupplierId" {
-		if Id != "" {
+		if Id != "0" {
 			where += " and Id = " + Id + " and ImportStatus = 0 and ImportSupplierName = '" + Class + "'"
 		} else {
 			where += " and ImportStatus = 0 and ImportSupplierName = '" + Class + "' and " + Column + " = 0"
@@ -722,7 +728,7 @@ func (this *OilContractController) ImportUpdate() {
 	if Column == "SecondUnit" {
 		var org organize.Base_Organize
 		svc.GetEntityByWhere("Base_Organize", "Id = "+Value, &org)
-		if Id != "" {
+		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
 		} else {
@@ -1205,3 +1211,17 @@ func (this *OilContractController) GetHandOnStatisticsList() {
 	this.Data["json"] = &dataInfo
 	this.ServeJSON()
 }
+
+// @Title 清空列表
+// @Description
+// @Success 200 {object} ErrorInfo
+// @router /deleteList [get]
+func (this *OilContractController) DeleteList() {
+	svc := contract.GetOilContractService(utils.DBE)
+	svc.DeleteEntityBytbl(OilContractName, "ImportStatus = 0")
+	var errinfo ErrorInfo
+	errinfo.Message = "清空成功"
+	errinfo.Code = 0
+	this.Data["json"] = &errinfo
+	this.ServeJSON()
+}

+ 6 - 0
src/dashoo.cn/frontend_web/src/api/oilcontract/contract.js

@@ -240,5 +240,11 @@ export default {
       method: 'post',
       data: params
     })
+  },
+  deleteList (myAxios) {
+    return myAxios({
+      url: '/contract/deleteList',
+      method: 'get'
+    })
   }
 }

+ 85 - 5
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-import/index.vue

@@ -269,7 +269,37 @@
       :visible.sync="dialogVisibleContract"
       :close-on-click-modal="false"
       width="80%">
-
+      <el-form ref="form" :inline="true" style="float: right; margin-top: -20px">
+        <el-form-item label="企业名称">
+          <el-input size="mini" clearable v-model="searchForm.ImportSupplierName" style="width: 150px;" placeholder="请输入企业名称"></el-input>
+        </el-form-item>
+        <el-form-item label="合同编号">
+          <el-input size="mini" clearable v-model="searchForm.ContractNo" style="width: 150px;" placeholder="请输入合同编号"></el-input>
+        </el-form-item>
+        <el-form-item label="状态" style="width: 150px">
+          <el-select size="mini" v-model="searchForm.Status" placeholder="请选择" style="width: 100px" clearable>
+            <el-option label="全部" value="" key="01"></el-option>
+            <el-option label="未履行" :value="1" key="02"></el-option>
+            <el-option label="履行中" :value="2" key="03"></el-option>
+            <el-option label="履行完毕" :value="3" key="04"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="结算状态" style="width: 180px">
+          <el-select size="mini" v-model="searchForm.SettleStatus" placeholder="请选择" style="width: 110px" clearable>
+            <el-option label="全部" value="" key="01"></el-option>
+            <el-option label="未结算" value="1" key="02"></el-option>
+            <el-option label="阶段性结算" value="2" key="03"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-dropdown split-button type="primary" size="mini" @click="handleSearch1" @command="searchCommand1">
+            查询
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item command="clear">查询重置</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </el-form-item>
+      </el-form>
       <el-form :model="tableDataList" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
         <el-table
             :data="tableDataList.tableData"
@@ -283,13 +313,13 @@
           <el-table-column  prop="ContractClass"  min-width="140" label="选择类别" align="center" show-overflow-tooltip >
             <template slot-scope="scope">
               <el-form-item  style="margin-bottom: 0px;" :prop="'tableData.' + scope.$index + '.ContractClass'" :rules="rules.ContractClass">
-                <el-select size="mini" v-model="scope.row.ContractClass" placeholder="请选择" style="width: 100%" @change="allUpdate(scope.row.ContractClass,scope.row.Class,'ContractClass',scope.row.Id, scope.row.SupplierId)">
+                <el-select size="mini" v-model="scope.row.ContractClass" placeholder="请选择" style="width: 100%" @change="allUpdate(scope.row.ContractClass,scope.row.ClassName,'ContractClass',scope.row.Id, scope.row.SupplierId)">
                   <el-option label="供应商" value="01" key="01"></el-option>
                   <el-option label="承包商" value="02" key="02"></el-option>
                   <el-option label="服务商" value="03" key="03"></el-option>
                 </el-select>
               </el-form-item>
-              <el-button size="mini" type="primary" @click="allUpdate(scope.row.ContractClass,scope.row.Class,'ContractClass', 0, scope.row.SupplierId)">全部修改</el-button>
+              <el-button size="mini" type="primary" @click="allUpdate(scope.row.ContractClass,scope.row.ClassName,'ContractClass', 0, scope.row.SupplierId)">全部修改</el-button>
             </template>
           </el-table-column>
           <el-table-column  prop="ImportSupplierName"  min-width="250" label="企业名称" align="center" show-overflow-tooltip></el-table-column>
@@ -300,7 +330,7 @@
                     <el-option v-for="(item,index) of (SupplierNameDataFun(scope.row.ImportSupplierName,scope.$index, scope.row.ContractClass))" :key="index" :label="item.SupplierName" :value="item.Id"></el-option>
                  </el-select>
                </el-form-item>
-               <el-button size="mini" type="primary" @click="allUpdate(scope.row.SupplierId,scope.row.ImportSupplierName,'SupplierId', scope.row.SupplierId)">全部修改</el-button>
+               <el-button size="mini" type="primary" @click="allUpdate(scope.row.SupplierId,scope.row.ImportSupplierName,'SupplierId', 0, scope.row.SupplierId)">全部修改</el-button>
              </template>
            </el-table-column>
           <el-table-column  prop="Status"  min-width="120" label="选择合同状态" align="center" show-overflow-tooltip >
@@ -412,6 +442,7 @@
         </el-form>
 
       <div style="display: flex;justify-content: flex-end;margin-top: 16px;">
+        <el-button type="primary" :loading="uploadTrueClickLoading1" size="mini" @click="deleteList">清空列表</el-button>
         <el-button type="primary" :loading="uploadTrueClickLoading" size="mini" @click="uploadTrueClick">确 认</el-button>
       </div>
     </el-dialog>
@@ -556,6 +587,7 @@
         tableLoading: false, // 表格loading
         dialogLoading: false,
         uploadTrueClickLoading: false,
+        uploadTrueClickLoading1: false,
         rules: {
           name: [
             { required: true, message: '请输入名称', trigger: 'change' }
@@ -644,7 +676,8 @@
           ModifiedOn: '',
           ModifiedUserId: '',
           ModifiedBy: '',
-          ClassName:''
+          ClassName:'',
+          ImportSupplierName:''
         },
         formData: {
           Id: '',
@@ -959,17 +992,40 @@
           console.log('企业名称数据', res)
           if (value === '01') {
             this.SupplierNameData1 = res.data.items
+            let params = {
+              Id: 0,
+              SupplierName: '请选择'
+            }
+            this.SupplierNameData1.push(params)
           }
           if (value === '02') {
             this.SupplierNameData2 = res.data.items
+            let params = {
+              Id: 0,
+              SupplierName: '请选择'
+            }
+            this.SupplierNameData2.push(params)
           }
           if (value === '03') {
             this.SupplierNameData3 = res.data.items
+            let params = {
+              Id: 0,
+              SupplierName: '请选择'
+            }
+            this.SupplierNameData3.push(params)
           }
         }).catch(err => {
           console.error(err)
         })
       },
+      deleteList () {
+        this.uploadTrueClickLoading1 = true
+        api.deleteList(this.$axios).then(res => {
+          this.uploadTrueClickLoading1 = false
+          this.$message({type: 'success', message: '清空成功'})
+          this.initDatas1()
+        })
+      },
       uploadTrueClick () {
         api.saveImportExcel(this.$axios).then(res => {
           if (res.data.code == 0) {
@@ -1108,6 +1164,11 @@
         let _this = this
         this.$axios.get('/register/orgloginlist').then(res => {
           _this.secondUnitOptions = res.data.items
+          let params = {
+            Id: 0,
+            Fullname: '请选择'
+          }
+          _this.secondUnitOptions.push(params)
         }).catch(err => {
           console.log(err)
         })
@@ -1219,6 +1280,13 @@
           this.clearSearch()
         }
       },
+      searchCommand1 (command) {
+        if (command == 'search') {
+          this.dialogVisible = true
+        } else if (command == 'clear') {
+          this.clearSearch1()
+        }
+      },
       // 列表排序功能
       orderby (column) {
         if (column.order == 'ascending') {
@@ -1235,11 +1303,22 @@
         this.CreateOn = ''
         this.initDatas()
       },
+      clearSearch1 () {
+        Object.assign(this.searchForm, this.searchFormReset)
+        // this.searchForm = this.searchFormReset;
+        this.CreateOn = ''
+        this.initDatas1()
+      },
       handleSearch () {
         this.currentPage = 1
         this.dialogVisible = false
         this.initDatas()
       },
+      handleSearch1 () {
+        this.currentPage1 = 1
+        // this.dialogVisible = false
+        this.initDatas1()
+      },
       handleCurrentChange (value) {
         this.currentPage = value
         this.initDatas()
@@ -1308,6 +1387,7 @@
       },
       importExcelSelect () {
         this.dialogVisibleContract = true
+        this.currentPage1 = 1
         this.initDatas1()
       },
       beforeRemove () {