|
@@ -0,0 +1,301 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <div class="my-title">{{ !id ? "新增" : "修改" }}</div>
|
|
|
+ <el-form
|
|
|
+ :model="dataForm"
|
|
|
+ :rules="dataRule"
|
|
|
+ ref="dataForm"
|
|
|
+ label-width="160px"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="沟通信息">
|
|
|
+ <el-select
|
|
|
+ v-model="dataForm.coId"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in coOption"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.coCode + ' (' + item.customerName + ')'"
|
|
|
+ :value="item.coCode"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="项目名称">
|
|
|
+ <el-input placeholder="项目名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="项目类别">
|
|
|
+ <el-select
|
|
|
+ v-model="dataForm.type"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in productTypeOption"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="备注">
|
|
|
+ <el-input
|
|
|
+ v-model="dataForm.remark"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入备注"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="关联BOM物料清单">
|
|
|
+ <el-select
|
|
|
+ v-model="dataForm.productId"
|
|
|
+ remote
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ :remote-method="productIdQueryHandle"
|
|
|
+ :loading="productSearchLoading"
|
|
|
+ @change="productIdChangeHandle"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in productIdOption"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div>
|
|
|
+ <div class="title">沟通物料明细</div>
|
|
|
+ <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.attachListVo || scope.row.attachListVo.length === 0
|
|
|
+ "
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="attachDetails(scope.row.attachListVo)"
|
|
|
+ >查看</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
|
|
|
+ style="color: red"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="removeWorkInfoItem(scope.$index)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="onChose">取消</el-button>
|
|
|
+ <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { getCoCode } from '@/api/cus'
|
|
|
+import { getProductList, getProductAllDetail } from '@/api/product'
|
|
|
+import { productTypeOption, taskTypeOption, rankTypeOption } from '@/utils/enums'
|
|
|
+export default {
|
|
|
+ name: 'quoted-add-or-update',
|
|
|
+ components: {},
|
|
|
+ props: {},
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ id: 0,
|
|
|
+ coOption: [], // 沟通编码下拉数据
|
|
|
+ productTypeOption: productTypeOption,
|
|
|
+ taskTypeOption: taskTypeOption,
|
|
|
+ rankTypeOption: rankTypeOption,
|
|
|
+ productIdOption: [], // 物料下拉数据
|
|
|
+ productSearchLoading: false,
|
|
|
+ dataForm: {
|
|
|
+ quotedPriceProductParamsList: [], // 报价物料清单
|
|
|
+ workInfoList: []
|
|
|
+ },
|
|
|
+ dataRule: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {},
|
|
|
+ computed: {},
|
|
|
+ created () {
|
|
|
+ this.getCoCode()
|
|
|
+ this.getProductList()
|
|
|
+ },
|
|
|
+ mounted () {},
|
|
|
+ activated () {},
|
|
|
+ methods: {
|
|
|
+ init (id) {
|
|
|
+ this.id = id || 0
|
|
|
+ },
|
|
|
+ onChose () {
|
|
|
+ this.$emit('onChose')
|
|
|
+ },
|
|
|
+ getCoCode () {
|
|
|
+ getCoCode().then(({ data }) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.coOption = data.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async getProductList (productName) {
|
|
|
+ let params = {
|
|
|
+ current: 1,
|
|
|
+ size: 20,
|
|
|
+ productName: productName
|
|
|
+ }
|
|
|
+ await getProductList(params).then(({ data }) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.productIdOption = []
|
|
|
+ data.data.records.forEach((item) => {
|
|
|
+ this.productIdOption.push({
|
|
|
+ label: item.productName,
|
|
|
+ value: item.productId
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async productIdQueryHandle (queryVal) {
|
|
|
+ this.productSearchLoading = true
|
|
|
+ await this.getProductList(queryVal)
|
|
|
+ this.productSearchLoading = false
|
|
|
+ },
|
|
|
+ productIdChangeHandle (val) {
|
|
|
+ getProductAllDetail(val).then(({ data }) => {
|
|
|
+ if (data && data.code === '200') {
|
|
|
+ this.dataForm.quotedPriceProductParamsList = []
|
|
|
+ this.productList = data.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ removeWorkInfoItem (index) {
|
|
|
+ this.dataForm.workInfoList.splice(index, 1)
|
|
|
+ },
|
|
|
+ dataFormSubmit () {}
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.title {
|
|
|
+ padding: 10px 0;
|
|
|
+}
|
|
|
+</style>
|