Parcourir la source

现场考察报告

lining il y a 5 ans
Parent
commit
a10f446d51

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

@@ -24,7 +24,7 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
 	"dashoo.cn/backend/api/business/paymentinfo"
 	. "dashoo.cn/backend/api/controllers"
-	"dashoo.cn/business2/permission"
+	"dashoo.cn/business3/permission"
 	"dashoo.cn/utils"
 	//"wayne-master/src/backend/util/integer"
 )

+ 7 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -4,6 +4,7 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
 	"dashoo.cn/backend/api/business/oilsupplier/supplierscenefile"
 	"dashoo.cn/backend/api/business/register"
+	"dashoo.cn/business3/parameter"
 	"encoding/json"
 	"fmt"
 	"github.com/tealeg/xlsx"
@@ -1418,6 +1419,12 @@ func (this *OilSupplierController) GetDictListByStatus() {
 		dictList["MgrUnit"] = false
 	}
 
+	//是否需要现场考察报告
+	paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
+	isInvestigate := paramSvc.GetBaseparameterMessage("GFGL1", "paramset", "isInvestigate")
+	dictList["isInvestigate"] = isInvestigate
+
+
 	var datainfo DataInfo
 	datainfo.Items = dictList
 	this.Data["json"] = &datainfo

+ 36 - 37
src/dashoo.cn/backend/api/controllers/setting/paramset.go

@@ -1,12 +1,10 @@
 package setting
 
 import (
-	"encoding/json"
-	"fmt"
-
 	. "dashoo.cn/backend/api/controllers"
-	"dashoo.cn/business2/parameter"
+	"dashoo.cn/business3/parameter"
 	"dashoo.cn/utils"
+	"encoding/json"
 )
 
 // 系统参数设置
@@ -15,7 +13,7 @@ type ParamSetController struct {
 }
 
 type ParamSerModel struct {
-	IsAutoPrintSample bool `json:"isAutoPrintSample"`
+	IsInvestigate     bool `json:"isInvestigate"`
 	IsGetBarCode      bool `json:"isGetBarCode"`
 	SFlupFrontDay     int  `json:"sFlupFrontDay"`
 	SFlupLastDay      int  `json:"sFlupLastDay"`
@@ -36,45 +34,46 @@ func (this *ParamSetController) ParamSetPost() {
 	var paramentitylist []baseparameter.Base_Parameter
 
 	svc := baseparameter.GetBaseparameterService(utils.DBE)
-	svc.DeleteParam(this.User.AccCode, "paramset") //删除所有的参数
+	AccCode := "GFGL1"
+	svc.DeleteParam(AccCode, "paramset") //删除所有的参数
 
-	var sisAutoPrintSample string
-	if model.IsAutoPrintSample {
-		sisAutoPrintSample = "true"
+	var sisInvestigate string
+	if model.IsInvestigate {
+		sisInvestigate = "true"
 	} else {
-		sisAutoPrintSample = "false"
+		sisInvestigate = "false"
 	}
-	paramentity.Categoryid = this.User.AccCode
+	paramentity.Categoryid = AccCode
 	paramentity.Parameterid = "paramset"
-	paramentity.Parametercode = "isAutoPrintSample"
-	paramentity.Parametercontent = sisAutoPrintSample
+	paramentity.Parametercode = "isInvestigate"
+	paramentity.Parametercontent = sisInvestigate
 	paramentity.Createuserid, _ = utils.StrTo(this.User.Id).Int()
 	paramentity.Createby = this.User.Realname
 	paramentitylist = append(paramentitylist, paramentity)
 
-	paramentity.Parametercode = "isGetBarCode"
-	fmt.Println(this.GetString("isGetBarCode"))
-	if model.IsGetBarCode {
-		paramentity.Parametercontent = "true"
-	} else {
-		paramentity.Parametercontent = "false"
-	}
-	paramentitylist = append(paramentitylist, paramentity)
-
-	paramentity.Parametercode = "sFlupFrontDay"
-	sFlupFrontDay := utils.ToStr(model.SFlupFrontDay)
-	paramentity.Parametercontent = sFlupFrontDay
-	paramentitylist = append(paramentitylist, paramentity)
-
-	paramentity.Parametercode = "sFlupLastDay"
-	sFlupLastDay := utils.ToStr(model.SFlupLastDay)
-	paramentity.Parametercontent = sFlupLastDay
-	paramentitylist = append(paramentitylist, paramentity)
-
-	paramentity.Parametercode = "sTestFrontDay"
-	sTestFrontDay := utils.ToStr(model.STestFrontDay)
-	paramentity.Parametercontent = sTestFrontDay
-	paramentitylist = append(paramentitylist, paramentity)
+	//paramentity.Parametercode = "isGetBarCode"
+	//fmt.Println(this.GetString("isGetBarCode"))
+	//if model.IsGetBarCode {
+	//	paramentity.Parametercontent = "true"
+	//} else {
+	//	paramentity.Parametercontent = "false"
+	//}
+	//paramentitylist = append(paramentitylist, paramentity)
+	//
+	//paramentity.Parametercode = "sFlupFrontDay"
+	//sFlupFrontDay := utils.ToStr(model.SFlupFrontDay)
+	//paramentity.Parametercontent = sFlupFrontDay
+	//paramentitylist = append(paramentitylist, paramentity)
+	//
+	//paramentity.Parametercode = "sFlupLastDay"
+	//sFlupLastDay := utils.ToStr(model.SFlupLastDay)
+	//paramentity.Parametercontent = sFlupLastDay
+	//paramentitylist = append(paramentitylist, paramentity)
+	//
+	//paramentity.Parametercode = "sTestFrontDay"
+	//sTestFrontDay := utils.ToStr(model.STestFrontDay)
+	//paramentity.Parametercontent = sTestFrontDay
+	//paramentitylist = append(paramentitylist, paramentity)
 
 	_, err := svc.InsertEntity(&paramentitylist)
 	var errinfo ErrorInfo
@@ -98,7 +97,7 @@ func (this *ParamSetController) ParamSetPost() {
 func (this *ParamSetController) ParamsetCheck() {
 	var paramentitylist []baseparameter.Base_Parameter
 	svc := baseparameter.GetBaseparameterService(utils.DBE)
-	paramentitylist = svc.GetBaseparameterbyid(this.User.AccCode, "paramset")
+	paramentitylist = svc.GetBaseparameterbyid("GFGL1", "paramset")
 	this.Data["json"] = &paramentitylist
 	this.ServeJSON()
 }

+ 18 - 14
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodsinfo.vue

@@ -693,19 +693,21 @@
         </el-col>
       </el-row>
     </el-form>
-    <el-row v-if="formData.OperType == '制造商' && formData.Grade == '2'" >
+    <!--打印内容结束-->
+    <!--endprint1-->
+    <el-row v-if="(isInvestigate) && (formData.OperType == '制造商' && formData.Grade == '2')" >
       <el-col :span="4">
-          <span>现场考察报告</span>
-          <el-button type="primary" style="margin-left: 10px;" plain size="mini" title="上传" @click="openDialog()" >上传
-          </el-button>
-          <!--<el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"-->
-          <!--:http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">-->
-          <!--<i class="el-icon-plus attach-uploader-icon"></i>-->
-          <!--&lt;!&ndash;<div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">请上传图片(大小为512KB-5MB),可上传多张图片&ndash;&gt;-->
-          <!--&lt;!&ndash;</div>&ndash;&gt;-->
-          <!--&lt;!&ndash;<div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType ==yasuoname">请上传压缩文件&ndash;&gt;-->
-          <!--&lt;!&ndash;</div>&ndash;&gt;-->
-          <!--</el-upload>-->
+        <span>现场考察报告</span>
+        <el-button type="primary" style="margin-left: 10px;" plain size="mini" title="上传" @click="openDialog()" >上传
+        </el-button>
+        <!--<el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"-->
+        <!--:http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">-->
+        <!--<i class="el-icon-plus attach-uploader-icon"></i>-->
+        <!--&lt;!&ndash;<div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">请上传图片(大小为512KB-5MB),可上传多张图片&ndash;&gt;-->
+        <!--&lt;!&ndash;</div>&ndash;&gt;-->
+        <!--&lt;!&ndash;<div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType ==yasuoname">请上传压缩文件&ndash;&gt;-->
+        <!--&lt;!&ndash;</div>&ndash;&gt;-->
+        <!--</el-upload>-->
       </el-col>
       <el-col :span="4">
         <div v-for="(tmpUrl, index) in scenefileurllist">
@@ -714,8 +716,6 @@
         </div>
       </el-col>
     </el-row>
-    <!--打印内容结束-->
-    <!--endprint1-->
     <el-dialog title="现场考察报告" :visible.sync="visible" top="5vh" width="900px">
       <el-form :model="SubfileForm" label-width="100px">
         <el-row>
@@ -772,6 +772,10 @@ export default {
     appendStatus: {
       type: Boolean,
       default: false
+    },
+    isInvestigate: {
+      type: Boolean,
+      default: false
     }
   },
   data () {

+ 5 - 5
src/dashoo.cn/frontend_web/src/components/oilsupplier/subfilelist.vue

@@ -196,6 +196,10 @@
       OperType: {
         type: String,
         default: ''
+      },
+      isInvestigate: {
+        type: Boolean,
+        default: false
       }
     },
     computed: {
@@ -482,7 +486,7 @@
               }
             }
           }
-          if (this.Grade === '2' && this.OperType === '制造商') {
+          if ((this.isInvestigate) && (this.Grade === '2' && this.OperType === '制造商')) {
             if (this.scenefile.Id == '' || this.scenefile.Id == '0') {
               this.$message({
                 type: 'warning',
@@ -541,7 +545,6 @@
         this.visible = true
       },
       openDialog (val) {
-        console.log(val, '==========')
         this.IsMust = true
         this.Title = '上传文件'
         this.SubfileForm.Id = val.Id
@@ -560,7 +563,6 @@
         this.SubfileForm.FileName = val.FileName
         this.SubfileForm.EffectDate = (this.jsEffectDate(val.EffectDate))
         this.SubfileForm.FileUrl = val.FileUrl
-        console.log(val.FileUrl, 'val.FileUrl')
         if (val.FileUrl !== '') {
           this.getwendanginfo(val.FileUrl)
         }
@@ -576,7 +578,6 @@
         let urlArr = iUrl.split('$')
         for (let idx in urlArr) {
           let exArr = urlArr[idx].split('|')
-          console.log(exArr, 'exArr')
           let params = {
             name: exArr[1],
             url: exArr[0]
@@ -612,7 +613,6 @@
                 } else {
                   option.action = `http://${res.data.publicUrl}/${res.data.fid}`
                 }
-                console.log(option.action, 'option.action')
                 _this.waituploads.push({
                   uid: option.file.uid,
                   url: res.data.publicUrl,

+ 4 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplier/_opera/goodsedit.vue

@@ -99,6 +99,7 @@
                         :dictData.sync="dictData"
                         :authUser="authUser"
                         :canUpdateSupplier="canUpdateSupplier"
+                        :isInvestigate="isInvestigate"
                         @selectcompany="changeFormData"
                         @inputcompany="inputCompany"
                         @initFDatas="initDatas"  >
@@ -324,6 +325,7 @@
                         :flag="flag"
                         :Grade="formData.Grade"
                         :OperType="formData.OperType"
+                        :isInvestigate="isInvestigate"
                         @close="selectAuditOrg"></subfile-list>
         </el-tab-pane>
 
@@ -581,6 +583,7 @@ export default {
       }
     }
     return {
+      isInvestigate: false,
       goodsloading: false,
       operType: '',
       allowpre: true,
@@ -1368,6 +1371,7 @@ export default {
         this.UnitOrgOptions = res.data.items['UnitOrgList']
         this.UnitOrg = res.data.items['Register'].CheckUnitId
         this.allorgunitOptions = res.data.items['Allunitorglist']
+        this.isInvestigate = res.data.items['isInvestigate'] === 'true'
         this.orgunitChange(this.UnitOrg)
         // this.auditerOptions = res.data.items['Auditer']
         // this.organizeOption = res.data.items['Organizes']

+ 21 - 44
src/dashoo.cn/frontend_web/src/pages/setting/paramset/index.vue

@@ -19,21 +19,21 @@
         </el-col>
         <el-col :span="8">
           <el-form :model="parameterform" label-width="200px" label-position="top">
-            <el-form-item label="样本编码是否自动生成 ">
-              <el-switch on-text="是" off-text="否" on-color="#13ce66" v-model="parameterform.isGetBarCode"></el-switch>
-            </el-form-item>
-            <el-form-item label="录入样本时是否自动打印标签 ">
-              <el-switch on-text="是" off-text="否" on-color="#13ce66" v-model="parameterform.isAutoPrintSample"></el-switch>
-            </el-form-item>
-            <el-form-item label="随访提前提醒天数 " prop="newpass" v-if="!yeartest">
-              <el-input-number v-model="parameterform.sFlupFrontDay" :min="0" style="width:100%"></el-input-number>
-            </el-form-item>
-            <el-form-item label="随访过期后仍提醒天数 " prop="checknewPass" v-if="!yeartest">
-              <el-input-number v-model="parameterform.sFlupLastDay" :min="0" style="width:100%"></el-input-number>
-            </el-form-item>
-            <el-form-item label="年检报告提前提醒天数 " prop="yearPass" v-if="yeartest">
-              <el-input-number v-model="parameterform.sTestFrontDay" :min="0" style="width:100%"></el-input-number>
+            <el-form-item label="是否需要现场考察报告 ">
+              <el-switch on-text="是" off-text="否" on-color="#13ce66" v-model="parameterform.isInvestigate"></el-switch>
             </el-form-item>
+            <!--<el-form-item label="录入样本时是否自动打印标签 ">-->
+              <!--<el-switch on-text="是" off-text="否" on-color="#13ce66" v-model="parameterform.isAutoPrintSample"></el-switch>-->
+            <!--</el-form-item>-->
+            <!--<el-form-item label="随访提前提醒天数 " prop="newpass" v-if="!yeartest">-->
+              <!--<el-input-number v-model="parameterform.sFlupFrontDay" :min="0" style="width:100%"></el-input-number>-->
+            <!--</el-form-item>-->
+            <!--<el-form-item label="随访过期后仍提醒天数 " prop="checknewPass" v-if="!yeartest">-->
+              <!--<el-input-number v-model="parameterform.sFlupLastDay" :min="0" style="width:100%"></el-input-number>-->
+            <!--</el-form-item>-->
+            <!--<el-form-item label="年检报告提前提醒天数 " prop="yearPass" v-if="yeartest">-->
+              <!--<el-input-number v-model="parameterform.sTestFrontDay" :min="0" style="width:100%"></el-input-number>-->
+            <!--</el-form-item>-->
           </el-form>
         </el-col>
       </el-row>
@@ -44,24 +44,19 @@
 <script>
   export default {
     name: 'paramset',
-    data() {
+    data () {
       return {
         parameterform: {
-          isAutoPrintSample: false,
-          isGetBarCode: false,
-          sFlupFrontDay: 5,
-          sFlupLastDay: 5,
-          sTestFrontDay: 10
+          isInvestigate: false
         },
         yeartest: false
       }
     },
-    created() {
-      this.yeartest = process.env.appclient == 'lims'
+    created () {
       this.initData()
     },
     methods: {
-      initData() {
+      initData () {
         let _this = this
         _this.$axios.get('paramset/getparamset', {})
           .then(res => {
@@ -69,31 +64,17 @@
             if (res.data && res.data.length > 0) {
               for (var i = 0; i < res.data.length; i++) {
                 switch (res.data[i].Parametercode) {
-                  case 'isGetBarCode':
-                    if (res.data[i].Parametercontent === 'true') {
-                      _this.parameterform.isGetBarCode = true
-                    }
-                    break
-                  case 'isAutoPrintSample':
+                  case 'isInvestigate':
                     if (res.data[i].Parametercontent === 'true') {
-                      _this.parameterform.isAutoPrintSample = true
+                      _this.parameterform.isInvestigate = true
                     }
                     break
-                  case 'sFlupFrontDay':
-                    _this.parameterform.sFlupFrontDay = parseInt(res.data[i].Parametercontent)
-                    break
-                  case 'sFlupLastDay':
-                    _this.parameterform.sFlupLastDay = parseInt(res.data[i].Parametercontent)
-                    break
-                  case 'sTestFrontDay':
-                    _this.parameterform.sTestFrontDay = parseInt(res.data[i].Parametercontent)
-                    break
                 }
               }
             }
           })
       },
-      submitForm(formName) {
+      submitForm (formName) {
         let _this = this
         _this.$axios.put('paramset/saveparamset', _this.parameterform)
           .then(res => {
@@ -103,10 +84,6 @@
                 type: 'success',
                 message: res.data.message
               })
-              this.parameterform.pass = ''
-              this.parameterform.newpass = ''
-              this.parameterform.checknewPass = ''
-              this.parameterform.yearPass = ''
             } else {
               _this.$message({
                 type: 'warning',