|
@@ -0,0 +1,255 @@
|
|
|
+<<template>
|
|
|
+ <div>
|
|
|
+ <div class="my-title">通知报价</div>
|
|
|
+ <el-form
|
|
|
+ :model="dataForm"
|
|
|
+ :rules="dataRule"
|
|
|
+ ref="dataForm"
|
|
|
+ label-width="160px"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-table :data="dataForm.workInfoList" border style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ label="序号"
|
|
|
+ type="index"
|
|
|
+ width="50"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="taskType"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ min-width="100"
|
|
|
+ width="120"
|
|
|
+ label="工单类型"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{
|
|
|
+ taskTypeOption.findIndex(
|
|
|
+ (t) => t.value == scope.row.taskType
|
|
|
+ ) > -1
|
|
|
+ ? taskTypeOption.find((t) => t.value == scope.row.taskType)
|
|
|
+ .label
|
|
|
+ : ""
|
|
|
+ }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="taskName"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ :show-tooltip-when-overflow="true"
|
|
|
+ label="工单名称"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="ranks"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ width="120"
|
|
|
+ label="级别"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{
|
|
|
+ rankTypeOption.findIndex((t) => t.value == scope.row.ranks) >
|
|
|
+ -1
|
|
|
+ ? rankTypeOption.find((t) => t.value == scope.row.ranks)
|
|
|
+ .label
|
|
|
+ : ""
|
|
|
+ }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="content"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ min-width="100"
|
|
|
+ label="工单内容"
|
|
|
+ :show-tooltip-when-overflow="true"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="receiver"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ width="150"
|
|
|
+ label="任务接收人"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.receiverName }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="attachListVo"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ width="150"
|
|
|
+ label="任务附件"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ :disabled="
|
|
|
+ !scope.row.attachList || scope.row.attachList.length === 0
|
|
|
+ "
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="attachDetails(scope.row.attachList)"
|
|
|
+ >查看</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="notes"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ :show-tooltip-when-overflow="true"
|
|
|
+ label="备注"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ fixed="right"
|
|
|
+ header-align="center"
|
|
|
+ align="center"
|
|
|
+ width="100"
|
|
|
+ label="操作"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="updateWorderHandle(scope.row)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ style="color: red"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="removeWorkInfoItem(scope.$index)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-row>
|
|
|
+ <el-row style="text-align: center; margin-top: 10px">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ @click="inBound"
|
|
|
+ ></el-button>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="onChose">取消</el-button>
|
|
|
+ <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <worder-add-or-update-dialog
|
|
|
+ v-if="worderVisible"
|
|
|
+ ref="worder"
|
|
|
+ @submit="addWorderItem"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import WorderAddOrUpdateDialog from '../worder/add-or-update-dialog'
|
|
|
+import {
|
|
|
+ taskTypeOption,
|
|
|
+ rankTypeOption
|
|
|
+} from '@/utils/enums'
|
|
|
+export default {
|
|
|
+ name: '',
|
|
|
+ components: {WorderAddOrUpdateDialog},
|
|
|
+ props: {},
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ stateOption: [
|
|
|
+ { label: '通过', value: 1 },
|
|
|
+ { label: '不通过', value: 2 }
|
|
|
+ ],
|
|
|
+ taskTypeOption: taskTypeOption,
|
|
|
+ rankTypeOption: rankTypeOption,
|
|
|
+ worderVisible: false,
|
|
|
+ dataForm: {
|
|
|
+ workInfoList: []
|
|
|
+ },
|
|
|
+ dataRule: {
|
|
|
+ state: [{required: true, message: '请选择', trigger: 'change'}]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {},
|
|
|
+ computed: {},
|
|
|
+ created () {},
|
|
|
+ mounted () {},
|
|
|
+ activated () {},
|
|
|
+ methods: {
|
|
|
+ onChose () {
|
|
|
+ this.$emit('onChose')
|
|
|
+ },
|
|
|
+ async init (id) {
|
|
|
+ this.dataForm.priceId = id
|
|
|
+ },
|
|
|
+ inBound () {
|
|
|
+ this.worderVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.worder.init(1)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addWorderItem (item) {
|
|
|
+ if (!item.recordId) {
|
|
|
+ item.recordId = Math.round(Math.random() * 1000000)
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.dataForm.workInfoList.findIndex(
|
|
|
+ (item1) => item1.recordId === item.recordId
|
|
|
+ ) === -1
|
|
|
+ ) {
|
|
|
+ this.dataForm.workInfoList.push({
|
|
|
+ ...item
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ removeWorkInfoItem (index) {
|
|
|
+ this.dataForm.workInfoList.splice(index, 1)
|
|
|
+ },
|
|
|
+ updateWorderHandle (row) {
|
|
|
+ this.worderVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.worder.init(1, row)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ dataFormSubmit () {
|
|
|
+ this.$refs['dataForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl(`/biz-service/WorkController/insertBatch`),
|
|
|
+ method: 'post',
|
|
|
+ data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId })
|
|
|
+ }).then(({ data }) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500,
|
|
|
+ onClose: () => {
|
|
|
+ this.onChose()
|
|
|
+ this.$emit('refreshDataList')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+</style>
|