2
3
dubch 4 лет назад
Родитель
Сommit
39067779fb

+ 1 - 1
src/dashoo.cn/backend/api/controllers/invoice/invoice.go

@@ -275,7 +275,7 @@ func (this *OilInvoiceController) UpdateIsInvoice() {
 	//	"','kptype':'1','message':'','payee':'" + paramSvc.GetBaseparameterMessage("INVOICE", "paramset", "InvoicePeople1") + "','checker':'" + paramSvc.GetBaseparameterMessage("INVOICE", "paramset", "InvoicePeople2") +
 	//	"','tsfs':'1','email':'" + entity.Email + "','qdbz':'0','qdxmmc':'','dkbz':'0','deptid':'','clerkid':'','invoiceLine':'p','cpybz':'','detail':["+paramsString+"]}}"
 
-	fmt.Println(string(paramsStr), "参数")
+	fmt.Println(string(paramsStr), "诺诺参数")
 	invoiceJson := invoice.Post(url, string(paramsStr), key)
 	fmt.Println(invoiceJson, "诺诺接口返回")
 	if invoiceJson.Status != "0000"{

+ 35 - 0
src/dashoo.cn/backend/api/controllers/oilcontract/contract.go

@@ -1267,3 +1267,38 @@ func (this *OilContractController) DeleteList() {
 	this.Data["json"] = &errinfo
 	this.ServeJSON()
 }
+
+// @Title 一键更新二级单位名称
+// @Description
+// @Success 200 {object} ErrorInfo
+// @router /updateUnitName/:Id [get]
+func (this *OilContractController) UpdateUnitName() {
+	Id := this.Ctx.Input.Param(":Id")
+	UnitId := this.GetString("UnitId")
+	ContractId := this.GetString("ContractId")
+	var errinfo ErrorInfo
+	if Id == "" || UnitId == ""{
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+	var model contract.OilContract
+	svc := contract.GetOilContractService(utils.DBE)
+	var org organize.Base_Organize
+	svc.GetEntityByWhere("Base_Organize", "Id = " + UnitId, &org)
+
+	model.SecondUnit ,_= strconv.Atoi(UnitId)
+	model.SecondUnitName = org.Fullname
+	where := "SecondUnit = " + Id
+	if ContractId != "" {
+		where += " and Id = " + ContractId
+	}
+	svc.UpdateEntityBywheretbl(OilContractName, &model, []string{"SecondUnit", "SecondUnitName"}, where)
+	errinfo.Message = "更新成功"
+	errinfo.Code = 0
+	this.Data["json"] = &errinfo
+	this.ServeJSON()
+}

+ 8 - 1
src/dashoo.cn/frontend_web/src/api/oilcontract/contract.js

@@ -260,5 +260,12 @@ export default {
       method: 'post',
       params: params
     })
-  }
+  },
+  updateUnitName (unitId, params, myAxios) {
+    return myAxios({
+      url: '/contract/updateUnitName/' + unitId,
+      method: 'get',
+      params: params
+    })
+  },
 }

+ 59 - 1
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-import/_opera/operation.vue

@@ -17,6 +17,7 @@
           <el-button type="primary" size="mini" v-if="succseButton && formData.Id!=0 && ![1, 2, 3].includes(formData.Status)" @click="onFinish">完结</el-button>
           <el-button type="primary" size="mini" v-if="successBoolean" @click="exportExcel">导出</el-button>
           <el-button type="primary" size="mini" :loading="addloading" @click="saveEntity">保存</el-button>
+          <el-button type="primary" size="mini" @click="updateName">修改二级单位</el-button>
           <router-link :to="'/oilcontract/contract-import'">
             <el-button type="primary" size="mini" plain style="margin-left: 8px">返回</el-button>
           </router-link>
@@ -454,6 +455,35 @@
       </el-form>
     </el-card>
 
+    <el-dialog
+      title="修改二级单位"
+      :visible.sync="dialogVisibleContract"
+      :close-on-click-modal="false"
+      width="80%">
+      <el-form :model="formData" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="二级单位" prop="SecondUnitName">
+              <el-input v-model="formData.SecondUnitName" placeholder="请输入" style="width: 50%" readonly></el-input>
+            </el-form-item>
+            </el-col>
+          <el-col :span="8">
+            <el-form-item label="新二级单位" prop="SecondUnitName">
+              <el-select filterable ref="issueFromSelect" v-model="NewUnitId" class="select_form"
+                                       placeholder="请选择二级单位" style="width: 50%;">
+                              <el-option v-for="item in orgOptions" :key="item.Id" :label="item.Fullname" :value="item.Id"
+                                         style="width: 100%;"></el-option>
+                            </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+
+      <div style="display: flex;justify-content: flex-end;margin-top: 16px;">
+        <el-button type="primary" :loading="updateLoading" size="mini" @click="updateUnitName(1)">修改</el-button>
+        <el-button type="primary" :loading="updateLoading1" size="mini" @click="updateUnitName()">批量修改</el-button>
+      </div>
+    </el-dialog>
 
 <!--    <el-dialog-->
 <!--      title="下发工单"-->
@@ -545,6 +575,9 @@ export default {
       issueFrom: {
         region: '',
       },
+      dialogVisibleContract: false,
+      updateLoading: false,
+      updateLoading1: false,
       orgOptions: [],
       issueVisible: false,//下发弹窗
       issueRules: {
@@ -697,8 +730,11 @@ export default {
       activeName: '1',
       serviceId: '',
       CurrencyOptions: [],
+      NewUnitId: '',
       formData: {
         Id: '',
+        SecondUnitName:'',
+        SecondUnit: '',
         SupplierId: '',
         SupplierName: '',
         Status: 1,
@@ -946,7 +982,29 @@ export default {
         console.error(err)
       })
     },
-
+    updateName() {
+      this.dialogVisibleContract = true
+    },
+    updateUnitName(val) {
+      if (val) {
+        this.updateLoading = true
+      } else {
+        this.updateLoading1 = true
+      }
+      let params = {
+        UnitId: this.NewUnitId,
+        ContractId: val? this.formData.Id : ""
+      }
+      api.updateUnitName(this.formData.SecondUnit, params, this.$axios).then(res => {
+        this.$message({
+          type: 'success',
+          message: res.data.message
+        })
+        this.initDatas()
+        this.updateLoading = false
+        this.updateLoading1 = false
+      })
+    },
     //保存信息
     saveEntity() {
       this.$refs['EntityForm'].validate((valid) => {