Commit 2a22a148 by yangzhi

fix:工单

parent ba44fab6
......@@ -16,7 +16,10 @@ export function workConfirmed(id) {
}
export function workAssigned(data) {
return axios.post('platform/platformWorkOrder/assign', data)
return axios.post(
'platform/platformWorkOrder/assign',
data,
)
}
export function startWorder(id, estimateCompleteTime) {
......@@ -32,12 +35,25 @@ export function archiveWorkOrder(id) {
})
}
// export function completeWorkOrder(id) {
// return axios.post('platform/platformWorkOrder/complete', {
// id: id,
// })
// }
export function completeWorkOrder(id) {
return axios.post('platform/platformWorkOrder/complete', {
id: id,
})
return axios.post(
'platform/platformWorkOrder/intoAcceptance',
{
id: id,
},
)
}
export function acceptanWorkOrder(data) {
return axios.post(
'platform/platformWorkOrder/acceptance',
data,
)
}
export function replyTocustomer(id, msg) {
return axios.post('platform/platformWorkOrderChat/add', {
msg: msg,
......@@ -73,6 +89,11 @@ export function closeForPending(id) {
},
)
}
export function close(id) {
return axios.post('platform/platformWorkOrder/close', {
id: id,
})
}
export function getInfo(id) {
return axios.get(
'platform/platformWorkOrder/get?id=' + id,
......
......@@ -3,7 +3,9 @@ import { mapState } from 'vuex'
const globalIndex = Math.random()
function getKey() {
return Math.random().toString().substr(3, 10)
return Math.random()
.toString()
.substr(3, 10)
}
export default {
name: 'my-table',
......@@ -86,6 +88,10 @@ export default {
type: Function,
default: () => {},
},
cellStyle: {
type: Function,
default: () => {},
},
highIds: {
// 高亮显示行
type: Array,
......@@ -168,8 +174,12 @@ export default {
// visibleMethod: this.visibleMethod
}
if (this.$props.customRightMenu?.name) {
const { code, name, prefixIcon, disabled } =
this.$props.customRightMenu
const {
code,
name,
prefixIcon,
disabled,
} = this.$props.customRightMenu
obj.body.options[0].push({
code,
name,
......@@ -310,8 +320,7 @@ export default {
this.$emit('selectionChange', arr)
} else if (this.keyCode === 'Control') {
this.$refs.vxetable.setCheckboxRow([row], true)
const arr1 =
this.$refs.vxetable.getCheckboxRecords()
const arr1 = this.$refs.vxetable.getCheckboxRecords()
this.$emit('selectionChange', arr1)
} else {
this.startIndex = $rowIndex
......@@ -560,6 +569,7 @@ export default {
loading={this.loading}
cell-class-name={this.cellClassName}
row-class-name={this.rowClassName}
cell-style={this.cellStyle}
onCurrent-change={this.currentChange}
onCheckbox-change={this.checkboxChange}
onCheckbox-all={this.checkboxAll}
......
......@@ -18,6 +18,7 @@ import {
Option,
Cascader,
Radio,
RadioGroup,
Menu,
Submenu,
MenuItem,
......@@ -48,6 +49,7 @@ const components = [
Option,
Cascader,
Radio,
RadioGroup,
Menu,
MenuItem,
Submenu,
......
......@@ -107,6 +107,36 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="参与人">
<el-select
style="width: 120px"
placeholder="请选择"
clearable
v-model="searchForm.participator"
>
<el-option
v-for="user in userList"
:key="user.id"
:label="user.realName"
:value="user.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="验收人">
<el-select
style="width: 120px"
placeholder="请选择"
clearable
v-model="searchForm.acceptanceUserId"
>
<el-option
v-for="user in userList"
:key="user.id"
:label="user.realName"
:value="user.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="优先级">
<el-select
style="width: 120px"
......@@ -164,6 +194,7 @@
:tableColumns="tableColumns"
:sourceData="sourceData"
:cellClassName="cellClassName"
:cellStyle="cellStyle"
>
</table-view>
</div>
......@@ -407,7 +438,7 @@
title="指派给"
:close-on-click-modal="false"
:visible.sync="assignVisible"
width="650px"
width="900px"
>
<el-form
:inline="true"
......@@ -415,7 +446,7 @@
:model="assignForm"
ref="assignForm"
:rules="assignFormRules"
label-width="110px"
label-width="130px"
>
<el-form-item label="负责人" prop="leaders">
<el-select
......@@ -510,6 +541,76 @@
>
</span>
</el-dialog>
<!-- 指派 -->
<el-dialog
title="验收"
:close-on-click-modal="false"
:visible.sync="acceptVisible"
width="800px"
>
<el-form
:inline="true"
size="mini"
:model="acceptForm"
ref="acceptForm"
:rules="acceptFormRules"
label-width="110px"
>
<el-form-item
label="验收结果"
prop="acceptanceResult"
>
<el-radio-group
v-model="acceptForm.acceptanceResult"
size="small"
style="width: 100%"
>
<el-radio
:label="item.value"
v-for="(item, index) in acceptanceResultList"
:key="index"
>{{ item.label }}</el-radio
>
</el-radio-group>
</el-form-item>
<el-form-item
label="验收意见"
prop="acceptanceContent"
:rules="[
{
required:
acceptForm.acceptanceResult == 'failure'
? true
: false,
message: '请填写',
trigger: 'blur',
},
]"
>
<el-input
type="textarea"
:autosize="{ minRows: 4 }"
style="width:400px"
placeholder="请输入内容"
v-model="acceptForm.acceptanceContent"
>
</el-input>
</el-form-item>
</el-form>
<span slot="footer">
<el-button
size="mini"
@click="acceptVisible = false"
>取消</el-button
>
<el-button
size="mini"
type="primary"
@click="submitAccept"
>确定</el-button
>
</span>
</el-dialog>
</div>
</template>
......@@ -527,11 +628,13 @@ import {
archiveWorkOrder,
completeWorkOrder,
replyTocustomer,
acceptanWorkOrder,
getOrderType,
resume,
pause,
reject,
closeForPending,
close,
getInfo,
} from '@/common/api/order'
import { getSystemUserList } from '@/common/api/system'
......@@ -546,6 +649,7 @@ import pauseWork from '@/assets/work/pause.png'
import resumetWork from '@/assets/work/resume.png'
import closetWork from '@/assets/work/close.png'
import updateWork from '@/assets/work/update.png'
import anceingWork from '@/assets/work/anceing.png'
export default {
name: 'task_center',
mixins: [pagination],
......@@ -636,6 +740,33 @@ export default {
completeVisible: false,
estimateCompleteTime: '',
currentItem: null,
acceptVisible: false,
acceptFormRules: {
acceptanceResult: [
{
required: true,
message: '请选择',
trigger: 'blur',
},
],
acceptanceContent: [
{
message: '请填入',
trigger: 'blur',
},
],
},
acceptForm: {},
acceptanceResultList: [
{
value: 'success',
label: '验收通过',
},
{
value: 'failure',
label: '验收不通过',
},
],
}
},
mounted() {
......@@ -708,16 +839,44 @@ export default {
},
{
label: '参与人',
key: 'fromBusiness',
key: 'participatorName',
width: 80,
},
{
label: '验收人',
key: 'acceptanceUserName',
width: 80,
},
{
label: '优先级',
key: 'priorityStatus',
width: 80,
width: 120,
render: item => {
if (item.orderStatus === 'TO_BE_ASSIGN') {
console.log(132)
if (
item.orderStatus === 'TO_BE_ASSIGN' &&
item.priorityStatus
) {
return (
<div style="padding:1px;height:30px">
<el-select
v-model={item.priorityStatus}
onChange={v => this.setStatus(item, v)}
>
<el-option
label="低"
value="1"
></el-option>
<el-option
label="中"
value="2"
></el-option>
<el-option
label="高"
value="3"
></el-option>
</el-select>
</div>
)
} else {
if (item.priorityStatus) {
return this.priorityStatusList.find(v => {
......@@ -851,7 +1010,7 @@ export default {
</span>
)}
{item.orderStatus === 'IN_PROGRESS' && (
<span title="完成" class="icon-view">
<span title="处理完成" class="icon-view">
<img
width="24"
height="24"
......@@ -860,6 +1019,16 @@ export default {
/>
</span>
)}
{item.orderStatus === 'ACCEPTANCEING' && (
<span title="已完成" class="icon-view">
<img
width="24"
height="24"
src={anceingWork}
onClick={() => this.anceing(item)}
/>
</span>
)}
{(item.orderStatus === 'PRE_HANDLING' ||
item.orderStatus === 'IN_COMPLETE') && (
<span title="关闭" class="icon-view">
......@@ -891,7 +1060,9 @@ export default {
},
},
methods: {
setStatus() {},
setStatus(data, i) {
console.log(data, i, 123)
},
handlePriorityStatus(data) {
if (data) {
return this.priorityStatusList.find(v => {
......@@ -962,6 +1133,24 @@ export default {
return 'order-grey'
}
},
cellStyle({ row, columnIndex }) {
if (
(row.orderStatus === 'PRE_HANDLING' ||
row.orderStatus === 'TO_BE_ASSIGN' ||
row.orderStatus === 'TO_BE_CONFIRMED' ||
row.orderStatus === 'IN_PROGRESS') &&
columnIndex === 16
) {
if (row.columnRenderColor) {
return {
backgroundColor: row.columnRenderColor,
color: 'white',
}
} else {
return { backgroundColor: 'white' }
}
}
},
async getOrderTypes() {
try {
const res = await getOrderType()
......@@ -1048,6 +1237,33 @@ export default {
this.rowId = item.id
this.currentItem = item
},
// 待验收完成
anceing(item) {
this.acceptVisible = true
this.currentItem = item
if (this.$refs.acceptForm) {
this.$refs.acceptForm.resetFields()
}
},
// 完成验收
submitAccept() {
this.$refs.acceptForm.validate(v => {
if (v) {
try {
acceptanWorkOrder({
id: this.currentItem.id,
...this.acceptForm,
}).then(res => {
if (res.code === 200) {
this.acceptVisible = false
this.getOrderTree()
this.getlist()
}
})
} catch (error) {}
}
})
},
// 提交分派
async submitAssign() {
this.$refs.assignForm.validate(v => {
......@@ -1154,13 +1370,23 @@ export default {
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
closeForPending(v.id).then(res => {
if (res.code === 200) {
this.$message.success('已关闭')
this.getlist()
this.getOrderTree()
}
})
if (this.statusCode === 'IN_COMPLETE') {
close(v.id).then(res => {
if (res.code === 200) {
this.$message.success('已关闭')
this.getlist()
this.getOrderTree()
}
})
} else {
closeForPending(v.id).then(res => {
if (res.code === 200) {
this.$message.success('已关闭')
this.getlist()
this.getOrderTree()
}
})
}
})
} catch {}
},
......
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