d5cfac56 by renchao@pashanhoo.com

style:材料申请

1 parent e4dcb128
/*
* @Description: 材料信息
* @Autor: renchao
* @LastEditTime: 2023-09-13 15:56:03
* @LastEditTime: 2023-09-18 16:03:16
*/
import request from '@/utils/request'
let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl'))
......@@ -157,3 +157,17 @@ export function getClmxList (bsmSj) {
}
})
}
/**
* @description: 补录材料目录
* @param {*} data
* @author: renchao
*/
export function repairInitClml (data) {
return request({
url: SERVER.SERVERAPI + '/rest/ywbl/clxx/repairInitClml',
method: 'post',
params: {
repair: data.bsmRepair
}
})
}
\ No newline at end of file
......
......@@ -28,7 +28,7 @@ export function getXtParamsByYwh (ywh) {
*/
export function getBlParamsByYwh (ywh, bsmQlxx) {
return request({
url: SERVER.SERVERAPI + '​/rest​/ywbl​/djyw​/getBlParamsByYwh',
url: SERVER.SERVERAPI + '/rest/ywbl/djyw/getBlParamsByYwh',
method: 'get',
params: {
ywh: ywh,
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-07 15:04:46
* @LastEditTime: 2023-09-18 16:49:25
-->
<template>
<dialogBox title="新建材料信息" width="20%" isMain v-model="myValue" @closeDialog="closeDialog" @submitForm="handleSubmit"
......@@ -24,6 +24,13 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="材料编码" prop="clbm">
<el-input v-model="ruleForm.clbm"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</dialogBox>
</template>
......@@ -40,6 +47,7 @@
ruleForm: {
cllx: "",
clmc: "",
clbm: ""
},
rules: {
cllx: [
......@@ -47,14 +55,17 @@
],
clmc: [
{ required: true, message: '请输入材料名称', trigger: 'blur' }
],
clbm: [
{ required: true, message: '请输入材料编码', trigger: 'blur' }
]
}
}
},
watch: {
value (val) {
this.myValue = val;
},
this.myValue = val
}
},
methods: {
/**
......@@ -66,6 +77,7 @@
this.ruleForm = {
cllx: "",
clmc: "",
clbm: ""
}
},
/**
......@@ -79,6 +91,7 @@
this.ruleForm = {
cllx: "",
clmc: "",
clbm: ""
}
this.$emit("input", false);
} else {
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-15 10:09:10
* @LastEditTime: 2023-09-18 16:57:31
-->
<template>
<div class="clxx">
......@@ -62,9 +62,7 @@
import imagePreview from "./dialog/imagePreview.vue";
import clxxAddDialog from "./dialog/clxxAddDialog.vue";
import clxxDetailDialog from "./dialog/clxxDetailDialog.vue";
import { getCompanyMaterialList, addCompanyMaterial, getFileListByBsmMaterial } from "@/api/company.js";
import { saveClml, getClmxList } from "@/api/clxx.js";
import { repairInitClml } from "@/api/djbRepair.js";
import { repairInitClml, saveClml } from "@/api/clxx.js";
export default {
components: { clxxAddDialog, imagePreview, clxxDetailDialog },
props: {
......@@ -100,7 +98,7 @@
watch: {
workFresh: {
handler (newValue, oldValue) {
this.clmlInitList()
if (newValue) this.clmlInitList()
},
deep: true,
immediate: true
......@@ -168,7 +166,7 @@
clmlInitList (type) {
// 1:列表初始化 2:新增材料
return new Promise((resolve) => {
getCompanyMaterialList(this.formData.bsmCompany).then((res) => {
repairInitClml(this.$parent).then((res) => {
if (res.code == 200) {
resolve(res.code);
if (res.result && res.result.length > 0) {
......@@ -244,12 +242,7 @@
* @author: renchao
*/
addSave (data) {
let obj = {
bsmCompany: this.formData.bsmCompany,
clmc: data.clmc,
cllx: data.cllx
};
addCompanyMaterial(obj).then(async (res) => {
saveClml({ ...data, bsmSldy: this.$parent.bsmRepair, bsmSlsq: this.$parent.bsmSlsq }).then(async (res) => {
if (res.code == 200) {
let res = await this.clmlInitList(2);
if (res == 200)
......@@ -290,7 +283,6 @@
store.dispatch("user/reWorkFresh", false);
ywPopupDialog("申请材料目录", "xxba/components/clxx/dialog/clxxDetailDialog", {
data: this.tableData,
bsmCompany: this.formData.bsmCompany
}, "60%", true, false)
},
//设置tableData
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-15 09:31:37
* @LastEditTime: 2023-09-18 16:32:42
*/
//流程环节操作按钮
export function getForm (tabName) {
......@@ -82,7 +82,7 @@ export function getForm (tabName) {
form = require("@/views/djbworkflow/djbBook/components/blxxtabs/cfdj.vue");
break;
case "clxx":
form = require("@/views/djbworkflow/djbBook/components/clxx/index.vue");
form = require("@/views/djbworkflow/components/clxx/index.vue");
break;
case "spyj":
form = require("@/views/djbworkflow/djbBook/spyj.vue");
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-15 15:38:53
-->
<template>
<div class="clmlmx-box">
<lb-table :column="column" :key="key" row-key="bsmMaterial" ref="listTable" :heightNumSetting="true" :calcHeight="500" :pagination="false"
:data="tableData">
</lb-table>
<div class="text-center">
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSubmit" :loading="loading">保存</el-button>
</div>
</div>
</template>
<script>
import store from '@/store/index.js'
import Sortable from 'sortablejs'
import { ywPopupCacel } from "@/utils/popup.js";
import { editCompanyMaterialList } from "@/api/company.js";
export default {
props: {
formData: {
type: Object,
default: () => {
return {}
}
}
},
data () {
return {
loading: false,
sortable: null,
column: [
{
label: "材料名称",
render: (h, scope) => {
return (
<el-input value={scope.row.clmc} onInput={(val) => { scope.row.clmc = val }}></el-input>
)
}
},
{
label: "材料编码",
render: (h, scope) => {
return (
<el-input value={scope.row.clbm} onInput={(val) => { scope.row.clbm = val }}></el-input>
)
}
},
{
label: "材料类型",
width: "110",
render: (h, scope) => {
return (
<el-select value={scope.row.cllx}
onChange={(val) => { scope.row.cllx = val }}>
{
store.getters.dictData['A40'].map(option => {
return (
<el-option label={option.dname} value={option.dcode}></el-option>
)
})
}
</el-select>
)
}
},
{
label: "页数",
width: "80",
render: (h, scope) => {
if (scope.row.count && scope.row.count > 0) {
return (
<div>
<span>{scope.row.count}</span>
</div>
);
} else {
return (
<div>
<span>0</span>
</div>
);
}
},
},
{
label: "操作",
width: "100",
render: (h, scope) => {
return (
<el-button
type="text"
icon="el-icon-delete"
disabled={scope.row.count != 0}
onClick={() => {
this.handleDelete(scope.$index, scope.row);
}}
>
删除
</el-button>
)
}
}
],
key: 0,
tableData: []
}
},
mounted () {
this.initSort()
this.tableData = _.cloneDeep(this.formData.data)
},
beforeDestroy () {
if (this.sortable) {
this.sortable.destroy();
}
},
watch: {
'formData.data': {
handler: function (val, oldVal) {
this.tableData = _.cloneDeep(val)
},
immediate: true,
deep: true
}
},
methods: {
handleCancel () {
ywPopupCacel()
},
handleSubmit () {
this.loading = true
store.dispatch('user/reWorkFresh', false)
editCompanyMaterialList(this.tableData, this.formData.bsmCompany).then(res => {
this.loading = false
if (res.code == 200) {
this.$message({
message: '保存成功',
type: 'success'
})
store.dispatch('user/reWorkFresh', true)
ywPopupCacel()
}
}).catch(() => {
this.loading = false
})
},
/**
* @description: 材料目录删除
* @param {*} index
* @param {*} row
* @author: renchao
*/
handleDelete (index, row) {
this.$confirm('此操作将永久删除该 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.tableData.splice(index, 1);
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
initSort () {
const el = this.$refs.listTable.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0]
this.sortable = Sortable.create(el, {
ghostClass: 'sortable-ghost',
setData: function (dataTransfer) {
dataTransfer.setData('Text', '')
},
onEnd: evt => {
const targetRow = this.tableData.splice(evt.oldIndex, 1)[0];
this.tableData.splice(evt.newIndex, 0, targetRow);
}
})
}
}
}
</script>
<style scoped lang='scss'>
@import "~@/styles/mixin.scss";
.clmlmx-box {
margin: 0 auto;
.title {
text-align: center;
height: 60px;
line-height: 60px;
border: 1px solid #dfe6ec;
font-size: 20px;
background: #81d3f81a;
margin-bottom: -1px;
}
}
</style>
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-18 14:42:14
* @LastEditTime: 2023-09-18 15:48:15
-->
<template>
<div class="tableBox">
......@@ -97,6 +97,7 @@
<script>
import Router from '@/router'
import { datas } from "../qlxxFormData.js";
import { ywPopupDialog } from "@/utils/popup.js";
import printTemplate from "../components/printTemplate.vue";
import { getXtParamsByYwh, getBlParamsByYwh } from '@/api/djyw'
export default {
......@@ -234,8 +235,7 @@
} else {
getBlParamsByYwh(ywh, bsmQlxx).then(res => {
let data = res.result
const { href } = Router.resolve('/workFrameView?bsmSlsq=' + data.bsmSlsq + '&bestepid=' + data.bestepid + '&bsmBusiness=' + data.bsmBusiness + '&type=jdcx')
window.open(href, `urlname${data.bsmSlsq}`)
ywPopupDialog("材料信息", "registerBook/components/clxx/index", data, "60%", true, false)
})
}
}
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-15 10:02:12
* @LastEditTime: 2023-09-18 16:28:16
-->
<template>
<div class="clxx">
......@@ -167,7 +167,6 @@
//type 1:列表初始化 2:新增材料
return new Promise((resolve) => {
this.unitData = this.$parent.unitData;
console.log(this.$parent.unitData, 'this.$parent.unitData;');
var formdata = new FormData();
formdata.append("bsmSlsq", this.$parent.bsmSlsq);
if (this.$route.query.sqywbm == "DJBBL") {
......