lining пре 6 година
родитељ
комит
0285107352

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

@@ -660,4 +660,19 @@ func (this *PaymentInfoController) AddPayInfo() {
 		this.Data["json"] = &errinfo
 		this.ServeJSON()
 	}
+}
+
+// @Title 获取字典列表
+// @Description get user by token
+// @Success 200 {object} map[string]interface{}
+// @router /dictlist [get]
+func (this *PaymentInfoController) GetDictList() {
+	dictList := make(map[string]interface{})
+	svcPerm := permission.GetPermissionService(utils.DBE)
+	isallowdel  := svcPerm.IsAuthorized(this.User.Id, "oil_supplier.PaymentInfo.CanDelete")
+	dictList["IsAllowDel"] = isallowdel
+	var datainfo DataInfo
+	datainfo.Items = dictList
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
 }

+ 6 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/paymentinfo.js

@@ -66,5 +66,11 @@ export default {
       method: 'post',
       params: params
     })
+  },
+  getDictList (myAxios) {
+    return myAxios({
+      url: '/paymentinfo/dictlist',
+      method: 'GET'
+    })
   }
 }

+ 1 - 1
src/dashoo.cn/frontend_web/src/components/workflow/wfmultihistory.vue

@@ -32,7 +32,7 @@
         </template>
       </el-table-column>
     </el-table>
-    <div style="margin-top:5px; text-align: center;">
+    <div style="margin-top:4px; text-align: center;">
       <img :src="baseurl + 'workflow/historyimg/' + entryinfo.instance +'?t='+(new Date()).getTime() " v-if="entryinfo.instance">
     </div>
   </div>

+ 35 - 20
src/dashoo.cn/frontend_web/src/pages/oilsupplier/paymentinfo/index.vue

@@ -44,9 +44,17 @@
             <router-link :to="'/oilsupplier/paymentinfo/' + scope.row.Id + '/operation'">
               <el-button type="primary" plain title="查看详情" size="mini">查看</el-button>
             </router-link>
-
-            <el-button v-if="authUser.Profile.IsCompanyUser != '1'" plain type="plain" title="删除" style="margin-left:10px"
-                       size="mini" @click="deleteEntityConfirm(scope.row)">删除</el-button>
+            <el-button type="danger" style="margin-left:10px" size="mini" @click="deleteEntity(scope.row)" v-if="isAllowDel">删除</el-button>
+            <!--<el-popover placement="top" title="提示" trigger="click" v-if="isAllowDel">-->
+              <!--<el-alert title="" description="确认要删除吗?" type="warning" :closable="false">-->
+              <!--</el-alert>-->
+              <!--<br />-->
+              <!--<div style="text-align: right; margin: 0">-->
+                <!--<el-button type="primary" size="mini" @click="deleteEntity(scope.row)">删除</el-button>-->
+              <!--</div>-->
+              <!--<el-button slot="reference" plain type="danger" title="删除" style="margin-left:10px"-->
+                         <!--size="mini">删除</el-button>-->
+            <!--</el-popover>-->
           </template>
         </el-table-column>
 
@@ -152,6 +160,7 @@
 
     data () {
       return {
+        isAllowDel: false,
         payVisible: false,
         dialogVisible: false,
         delevisble: false,
@@ -239,7 +248,7 @@
       Object.assign(this.searchFormReset, this.searchForm)
       // 查询列表
       this.initDatas()
-      // this.getDictOptions()
+      this.getDictOptions()
     },
     methods: {
       savePayInfo () {
@@ -313,7 +322,7 @@
         api.getDictList(this.$axios).then(res => {
           // this.dictOptions.customerList = res.data.items['customerList']
           // this.dictOptions.projectList = res.data.items['projectList']
-
+          this.isAllowDel = res.data.items['IsAllowDel']
         }).catch(err => {
           console.error(err)
         })
@@ -378,21 +387,27 @@
         })
       },
       deleteEntity (row) {
-        api.deleteEntity(row.Id, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            this.initDatas()
-            this.$message({
-              type: 'success',
-              message: res.data.message
-            })
-          } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
-          }
-        }).catch(err => {
-          console.error(err)
+        this.$confirm('此操作将永久删除该数据,删除后将不需要缴费直接到待入库中, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          api.deleteEntity(row.Id, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              this.initDatas()
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          }).catch(err => {
+            console.error(err)
+          })
         })
       },