Commit 40f9e02f by qinjianhui

feat: 添加新增

parent 767df67c
......@@ -6025,8 +6025,7 @@
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"lodash.camelcase": {
"version": "4.3.0",
......
......@@ -18,7 +18,8 @@
"vue-router": "^3.5.1",
"vuex": "^3.6.2",
"vxe-table": "^3.5.9",
"xe-utils": "^3.5.7"
"xe-utils": "^3.5.7",
"lodash": "~4.17.20"
},
"devDependencies": {
"@babel/core": "^7.12.16",
......
window.apiHostSetting = {
VUE_APP_API_URL: '',
VUE_APP_BASE_URL: '',
VUE_APP_ZIMG_URL: `${location.origin}${location.host.indexOf('test') !== -1 || location.protocol === 'http:' ? '/erpimg/' : ''}`,
}
......@@ -6,7 +6,5 @@ export function uploadImg(file, params = {}) {
for (const key in otherParams) {
from.append(key, otherParams[key])
}
return axios.post(url || 'upload/fileUpload/images', from, {
headers: { 'content-type': 'multipart/form-data' },
})
return axios.post(url || 'platform/upload/fileUpload/images', from)
}
\ No newline at end of file
......@@ -132,7 +132,7 @@ export default {
}
</script>
<style scoped>
.editor_toolbar >>> .panel_menu li:hover {
.editor_toolbar::v-deep .panel_menu li:hover {
background: #efefef;
}
</style>
......@@ -6,6 +6,9 @@ import element from '@/common/components/element-ui.js'
import vxeTable from '@/common/components/vxeTable.js'
import './common/style/index.scss'
import Directives from './utils/directives'
import { filePath, zImgPath } from './utils/commonUtil'
import md5 from 'js-md5'
import _ from 'lodash'
// import { getToken } from '@/utils/auth'
Vue.config.productionTip = false
......@@ -14,6 +17,48 @@ Vue.use(Directives)
Vue.use(element)
Vue.use(vxeTable)
const clientWidth = document.body.clientWidth
const dpi = _.add(
_.ceil(_.divide(clientWidth / 1920)) + 0.5,
)
let imagePath = ''
if (
md5(location.host) === '42f2b26039d7fd526b8a1d50bb329cbc'
) {
localStorage.setItem('locationHost', location.host)
imagePath = zImgPath
} else if (zImgPath.indexOf('/erpimg') !== -1) {
imagePath = zImgPath
} else {
imagePath = 'https://image.jomalls.com/'
}
Vue.prototype.setimgUrl = (url, options = {}) => {
const { w, h, ...others } = options
let query = ''
if (w) {
query += query
? '&w='
: 'w=' + _.floor(_.multiply(dpi * w))
}
if (h) {
query += query
? '&h='
: 'h=' + _.floor(_.multiply(dpi * h))
}
for (const key in others) {
query += `${query ? '&' : ''}${key}=${options[key]}`
}
if (!url) return ''
if (/((http|https):)?\/\/([^/]+)/i.test(url)) {
return url
} else if (url.indexOf('/') === -1) {
return imagePath + url + (query ? '?' : '') + query
} else {
return filePath + url
}
}
router.afterEach((to, from) => {
if (to.path === '/login') return
store.commit('tags/add', {
......
function getStaticPath() {
if (!/(http|https):\/\/([^/]+)/i.test(window.apiHostSetting.VUE_APP_BASE_URL)) {
return location.origin + window.apiHostSetting.VUE_APP_BASE_URL
}
return window.apiHostSetting.VUE_APP_BASE_URL
}
// zimg图片服务器地址
export const zImgPath = window.apiHostSetting.VUE_APP_ZIMG_URL
// 文件存储路径地址
export const filePath = getStaticPath() + 'upload/erp'
export function delChildren(list, callback, name) {
const key = name || 'children'
function recursive(list, callback, index) {
for (const iterator of list) {
callback && callback(iterator, index)
if (iterator.children.length > 0) {
recursive(iterator.children, callback, index + 1)
} else {
delete iterator[key]
}
}
}
recursive(list, callback, 0)
return list
}
\ No newline at end of file
<template>
<el-dialog
:title="isEdit ? '编辑' : '新增'"
:visible.sync="visible"
:visible.sync="editDialog"
width="905px"
:close-on-click-modal="false"
:before-close="() => $emit('update:editDialog', false)"
......@@ -13,250 +13,91 @@
ref="editForm"
label-width="110px"
>
<el-form-item label="任务编码">
<el-form-item label="工单编码">
<el-input
style="width: 164px"
v-model="editForm.taskNumber"
v-model="editForm.orderNo"
disabled
placeholder="系统自动生成"
></el-input>
</el-form-item>
<el-form-item
prop="taskType"
prop="orderType"
required
label="任务类型"
label="工单类型"
>
<el-select
style="width: 164px"
filterable
v-model="editForm.taskType"
placeholder="请选择"
v-model="editForm.orderType"
@change="getMode"
placeholder="请选择"
>
<el-option
v-for="(item, index) in selectOptions.taskType"
:key="index"
:label="item.desc"
:value="item.name"
v-for="order in orderTypes"
:key="order.key"
:value="order.key"
:label="order.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item
required
prop="taskModule"
label="任务模块"
prop="module"
label="工单模块"
v-if="
editForm.orderType === 'BUG' ||
editForm.orderType === 'DEMAND'
"
>
<el-cascader
v-if="editForm.taskType === 'TECHNOLOGY'"
style="width: 164px"
v-model="editForm.taskModule"
v-model="editForm.module"
:props="{
emitPath: false,
label: 'name',
value: 'id',
}"
:options="technologyList"
@change="onChangeType"
:show-all-levels="false"
></el-cascader>
<el-select
v-else
style="width: 164px"
v-model="editForm.taskModule"
value-key=""
placeholder="请选择"
>
<el-option
v-for="(item, index) in designList"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="负责人"
prop="taskLeader"
required
>
<el-cascader
style="width: 164px"
v-model="editForm.taskLeader"
:props="{ emitPath: false }"
:options="employee"
:show-all-levels="false"
></el-cascader>
</el-form-item>
<el-form-item
label="验收人"
prop="taskAcceptanceUser"
required
>
<el-cascader
style="width: 164px"
v-model="editForm.taskAcceptanceUser"
:props="{ emitPath: false }"
:options="employee"
:show-all-levels="false"
></el-cascader>
</el-form-item>
<el-form-item label="抄送人">
<el-cascader
style="width: 164px"
v-model="editForm.ccUsers"
:props="{ emitPath: false, multiple: true }"
:options="employee"
:show-all-levels="false"
></el-cascader>
</el-form-item>
<el-form-item
v-if="editForm.taskType === 'TECHNOLOGY'"
label="紧急程度"
prop="emergencyLevel"
required
class="form_item"
>
<el-radio-group v-model="editForm.emergencyLevel">
<el-radio
v-for="(
item, index
) in selectOptions.emergencyLevel"
:key="index"
:label="item.name"
:title="item.desc"
>
<svg
t="1627697200171"
class="icon"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="629"
width="18"
height="18"
>
<path
:fill="setColor(index)"
d="M444.970667 850.090667l151.978666-64.512a85.290667 85.290667 0 0 1-151.978666 64.512z m231.765333-760.746667c89.002667 48.597333 155.818667 111.018667 199.765333 187.178667 43.946667 76.117333 64.64 165.205333 62.250667 266.581333a32 32 0 0 1-64-1.536c2.133333-90.069333-15.872-167.552-53.674667-233.045333-37.802667-65.536-95.957333-119.850667-175.018666-163.029334a32 32 0 1 1 30.72-56.192z m-390.4 188.629333a248.490667 248.490667 0 0 1 324.266667 117.162667l4.181333 8.917333 54.954667 123.392 72.448 62.72c3.968 3.413333 7.381333 7.381333 11.349333 13.824l2.517333 4.906667a53.333333 53.333333 0 0 1-27.178666 70.357333L288.213333 874.24A53.333333 53.333333 0 0 1 213.333333 825.472l-0.042666-99.968-52.992-119.082667A248.405333 248.405333 0 0 1 286.293333 277.973333z m380.288-34.986666c41.258667 22.442667 74.325333 55.210667 98.816 97.621333 24.490667 42.453333 36.309333 87.466667 35.157333 134.442667a32 32 0 1 1-64-1.578667c0.853333-35.029333-7.893333-68.437333-26.581333-100.864-18.688-32.384-43.264-56.661333-74.026667-73.472a32 32 0 0 1 30.634667-56.192z"
p-id="630"
></path>
</svg>
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="重要程度"
v-if="editForm.taskType === 'TECHNOLOGY'"
prop="importanceLevel"
required
class="form_item"
>
<el-radio-group v-model="editForm.importanceLevel">
<el-radio
v-for="(
item, index
) in selectOptions.importanceLevel"
:key="index"
:title="item.desc"
:label="item.name"
>
<svg
t="1627697337193"
class="icon"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="937"
width="18"
height="18"
>
<path
:fill="setColor(index)"
d="M858.1 315l-119 85.9c-15.8 11.4-37.8 7.7-49-8.2L541.6 181.8c-13.9-19.8-43.3-19.7-57.2 0.1L337.8 392.5c-11.1 15.9-33.1 19.7-48.9 8.4l-119.6-85.5c-25.5-18.2-60.2 3.8-54.6 34.6l68.9 380c3 16.6 17.5 28.7 34.3 28.7h598.3c17.1 0 31.7-12.4 34.4-29.3l62.3-380.7c5.1-30.5-29.6-51.9-54.8-33.7zM513.7 620.6c-43.1 0-78-34.9-78-78s34.9-78 78-78 78 34.9 78 78-34.9 78-78 78z"
p-id="938"
></path>
</svg>
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="优先级"
class="form_item"
v-if="editForm.taskType === 'TECHNOLOGY'"
prop="priorityLevel"
required
>
<el-radio-group v-model="editForm.priorityLevel">
<el-radio
v-for="(
item, index
) in selectOptions.priorityLevel"
:key="index"
:label="item.name"
:title="item.desc"
>
<svg
t="1627697676079"
class="icon"
viewBox="0 0 1024 1024"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="1266"
width="18"
height="18"
>
<path
d="M215.4 160.6H177c-8.9 0-16 7.2-16 16V849c0 8.9 7.2 16 16 16h38.4c8.9 0 16-7.2 16-16V176.7c0.1-8.9-7.1-16.1-16-16.1zM848.1 236c-189 152.5-378-180.6-567.1-28.2-8.8 7.1-16 21.3-16 30.1v430.9c0 8.9 7.2 9 16 1.9 189-152.5 378.1 180.7 567.1 28.2 8.9-7.1 16-21.3 16-30.1V237.9c0.1-8.8-7.1-9-16-1.9z"
:fill="setColor(index)"
p-id="1267"
></path>
</svg>
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="期望完成日期"
prop="expectedCompletionTime"
prop="expectCompleteTime"
required
>
<el-date-picker
style="width: 164px"
v-model="editForm.expectedCompletionTime"
value-format="yyyy-MM-dd"
type="date"
:picker-options="pickerOption"
v-model="editForm.expectCompleteTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
default-time="23:59:59"
placeholder="选择日期"
></el-date-picker>
</el-form-item>
<br />
<el-form-item label="任务标题">
<el-form-item label="工单标题">
<el-input
style="width: 732px"
v-model="editForm.taskTitle"
placeholder="任务标题"
v-model="editForm.title"
placeholder="工单标题"
></el-input>
</el-form-item>
<br />
<v-editor
height="400px"
ref="wangeditor"
placeholder="任务内容"
v-model="editForm.taskContent"
placeholder="工单内容"
v-model="editForm.content"
filename="files"
></v-editor>
</el-form>
<span slot="footer">
<el-button
v-if="isEmpId"
size="mini"
type="warning"
@click="goback"
>
返 回
</el-button>
<el-button
size="mini"
@click="$emit('update:editDialog', false)"
>
......@@ -299,10 +140,6 @@ export default {
type: Boolean,
default: false,
},
selectOptions: {
type: Object,
default: () => ({}),
},
isEdit: {
type: Boolean,
default: false,
......@@ -311,37 +148,12 @@ export default {
type: Array,
default: () => [],
},
},
computed: {
visible: {
get() {
return this.editDialog
},
set(val) {
this.$emit('update:editDialog', val)
},
},
isEmpId() {
const { empId } = this.$route.query
return !!empId
},
taskTypes() {
if (this.selectOptions.taskType) {
return this.selectOptions.taskType
}
return []
},
modeList() {
const { taskType } = this.editForm
if (taskType === 'DESIGN') {
return this.designList
}
if (taskType === 'TECHNOLOGY') {
return this.technologyList
}
return []
orderTypes: {
type: Array,
default: () => [],
},
},
computed: {},
watch: {
editDialog(val) {
if (val) {
......@@ -351,67 +163,16 @@ export default {
})
}
},
editForm(newval, old) {
if (newval !== old) {
this.getMode(newval.taskType, true)
}
},
},
methods: {
getMode(code, clear) {
if (!clear) {
this.$set(this.editForm, 'taskModule', '')
}
if (code === 'TECHNOLOGY') {
if (this.technologyList.length === 0) {
axios.get('sysMenu/getAllMenus').then((res) => {
this.technologyList = delChildren(res.data)
const otherList = { id: '-1', name: '其他任务' }
this.technologyList.push(otherList)
})
}
this.$set(this.editForm, 'emergencyLevel', 'URGENT')
this.$set(
this.editForm,
'importanceLevel',
'IMPORTANT',
)
this.$set(this.editForm, 'priorityLevel', 'DURING')
} else {
axios.post('financeTaskSpendNorm/taskPersonalCenter', {
taskType: code,
}).then((res) => {
this.designList = res.data
})
delete this.editForm.emergencyLevel
delete this.editForm.importanceLevel
delete this.editForm.priorityLevel
}
},
goback() {
this.$emit('update:editDialog', false)
this.$router.go(-1)
},
setColor(index) {
if (index === 0) {
return '#F54D66'
}
if (index === 1) {
return '#FDC834'
}
if (index === 2) {
return '#5DE088'
}
},
onSubmit() {
this.$refs.editForm.validate((v) => {
if (v) {
let url = ''
if (this.isEdit) {
url = 'financeTaskManagement/update'
url = 'platform/platformWorkOrder/update'
} else {
url = 'financeTaskManagement/add'
url = 'platform/platformWorkOrder/add'
}
delete this.editForm.createTime
axios.post(url, this.editForm).then((res) => {
......@@ -422,14 +183,45 @@ export default {
}
})
},
getMode(code) {
if (code === 'BUG' || code === 'DEMAND') {
if (this.technologyList.length === 0) {
axios.get('sysSaasMenu/getAllMenus').then((res) => {
this.technologyList = delChildren(res.data)
const otherList = { id: -1, name: '其他任务' }
this.technologyList.push(otherList)
})
}
}
},
// 递归
findRecursive(items, fn) {
for (const item of items) {
if (fn(item)) return item
if (item.children) {
const found = this.findRecursive(
item.children,
fn,
)
if (found) return found
}
}
},
onChangeType(v) {
const foundItem = this.findRecursive(
this.technologyList,
(e) => e.id === v,
)
this.$emit('onChangeModule', foundItem)
},
},
}
</script>
<style scoped>
.form_item >>> .el-radio {
.form_item::v-deep .el-radio {
margin-right: 13px;
}
.form_item >>> .el-radio svg {
.form_item::v-deep .el-radio svg {
vertical-align: text-bottom;
}
</style>
......@@ -115,6 +115,14 @@
查询
</el-button>
</el-form-item>
<el-form-item v-if="statusCode === 'PRE_HANDLING'">
<el-button
type="success"
size="mini"
@click="addData"
>新增</el-button
>
</el-form-item>
</el-form>
<div class="table-wrap" v-loading="loading">
<table-view
......@@ -145,8 +153,8 @@
width="900px"
@close="getlist()"
>
<div class="step-bar">
<!-- step-pass 已经完成,step-active当前步骤 -->
<!-- <div class="step-bar">
step-pass 已经完成,step-active当前步骤
<div
class="step step-after"
:class="{
......@@ -194,7 +202,7 @@
>
<span>已归档</span>
</div>
</div>
</div> -->
<div class="content" v-loading="detailLoading">
<div class="detail_list">
<div class="item_wrap">
......@@ -328,7 +336,14 @@
</div>
</div>
</el-dialog>
<edit
:editDialog.sync="editDialog"
@onSubmit="onSubmit"
@onChangeModule="onChangeModule"
:editForm="editForm"
:orderTypes="orderTypes"
:isEdit="isEdit"
ref="edit"></edit>
<!-- 指派 -->
<el-dialog
title="指派给"
......@@ -369,6 +384,7 @@
import tableView from '@/common/components/base/tableView.vue'
import ChooseTimePeriod from '../../components/base/chooseTimePeriod.vue'
import pagination from '../../mixins/pagination'
import Edit from './edit.vue'
import axios from '../../common/api/axios'
import {
getOrderTree,
......@@ -394,6 +410,7 @@ export default {
components: {
ChooseTimePeriod,
tableView,
Edit,
},
data() {
const userInfo = localStorage.getItem('userinfo')
......@@ -418,7 +435,7 @@ export default {
selections: [],
is_tab: '1',
statusCode: 'PRE_HANDLING',
searchForm: { timeProp: 'create_time', sign: 1 },
searchForm: { timeProp: 'create_time' },
isEdit: false,
sourceData: [],
currentRowId: '',
......@@ -436,6 +453,8 @@ export default {
userList: [],
orderTypes: [],
chatRecord: [],
cloneForm: {},
editDialog: false,
}
},
mounted() {
......@@ -443,6 +462,9 @@ export default {
this.getlist()
this.getSystemUserList()
this.getOrderTypes()
this.cloneForm = JSON.parse(
JSON.stringify(this.editForm),
)
},
computed: {
...mapState(['deptStaff']),
......@@ -459,13 +481,21 @@ export default {
<span>{item.title}</span>
{item.sign === 1 &&
item.orderStatus === 'PRE_HANDLING' && (
<i class="el-icon-info" title="待回复"></i>
<i
class="el-icon-info"
title="待回复"
></i>
)}
</span>
),
},
{ label: '工单编号', key: 'orderNo', width: 110 },
{ label: '工单模块', key: 'moduleName', width: 110, align: 'left' },
{
label: '工单模块',
key: 'moduleName',
width: 110,
align: 'left',
},
{
label: '工单类型',
key: 'orderTypeTxt',
......@@ -495,8 +525,16 @@ export default {
key: 'createTime',
width: 130,
},
{ label: '期望完成时间', key: 'expectCompleteTime', width: 130 },
{ label: '完成时间', key: 'completeTime', width: 130 },
{
label: '期望完成时间',
key: 'expectCompleteTime',
width: 130,
},
{
label: '完成时间',
key: 'completeTime',
width: 130,
},
{
label: '操作',
fixed: 'right',
......@@ -505,7 +543,7 @@ export default {
render: (item) => (
<span>
{(item.orderStatus === 'PRE_HANDLING' ||
item.orderStatus === 'IN_PROGRESS') && (
item.orderStatus === 'IN_COMPLETE') && (
<span
title="详情"
class="icon-view icon-tools-view"
......@@ -550,7 +588,12 @@ export default {
)}
{item.orderStatus === 'IN_PROGRESS' && (
<span title="完成" class="icon-view">
<img width="24" height="24" src={completeWork} onClick={() => this.complete(item)}/>
<img
width="24"
height="24"
src={completeWork}
onClick={() => this.complete(item)}
/>
</span>
)}
</span>
......@@ -560,6 +603,24 @@ export default {
},
},
methods: {
addData() {
this.editForm = JSON.parse(
JSON.stringify(this.cloneForm),
)
this.isEdit = false
// this.editForm = { taskAcceptanceUser: this.employeeId }
this.editDialog = true
this.$refs.editForm &&
this.$refs.editForm.resetFields()
},
onChangeModule(item) {
this.$set(this.editForm, 'moduleName', item.name)
},
onSubmit() {
this.editDialog = false
this.getlist()
this.getOrderTree()
},
cellClassName({ row, columnIndex }) {
if (
(row.orderStatus === 'TO_BE_ASSIGN' ||
......@@ -931,10 +992,10 @@ export default {
.detail_list .item .value {
color: #222;
}
.form_item >>> .el-radio {
.form_item::v-deep .el-radio {
margin-right: 13px;
}
.form_item >>> .el-radio svg {
.form_item::v-deep .el-radio svg {
vertical-align: text-bottom;
}
.detail_btn {
......
......@@ -4,5 +4,32 @@ module.exports = defineConfig({
devServer: {
port: 8082,
host: '',
proxy: {
'/api/': {
target: 'http://192.168.31.244',
headers: {
Host: 'local.local.cn',
Origin: 'http://local.local.cn/',
},
},
'/erpimg/': {
target: 'http://192.168.31.99:4869',
pathRewrite: {
'^/erpimg/': '',
},
headers: {
Host: 'local.local.cn',
Origin: 'http://local.local.cn/',
},
},
'/ws/': {
target: 'http://192.168.31.244',
headers: {
Host: 'local.local.cn',
Origin: 'http://local.local.cn/',
},
ws: true,
},
},
},
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment