yusheng 2 anos atrás
pai
commit
35adc19cee

+ 12 - 0
src/api/saleManage/quotation.js

@@ -96,3 +96,15 @@ export async function getProductList(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+/**
+ * 提交
+ */
+export async function submit(data) {
+  const res = await request.post(`/bpm/quoteApprove/submit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 144 - 135
src/views/saleManage/businessOpportunity/components/headList.vue

@@ -1,53 +1,70 @@
 <template>
-    <el-dialog title="选择负责人" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"  top="5vh"
-        :close-on-press-escape="false" append-to-body width="80%">
-        <el-card shadow="never">
-            <ele-split-layout width="244px" allow-collapse :right-style="{ overflow: 'hidden' }">
-                <div class="ele-border-lighter split-layout-right-content">
-                    <DepartmentTree @handleNodeClick="handleNodeClick" :isFirstRefreshTable="false" ref="treeList" />
-                </div>
-                <!-- 表格 -->
-                <template v-slot:content>
-                    <ele-pro-table ref="table" :columns="columns" :datasource="datasource" row-key="id"
-                        height="calc(100vh - 350px)" class="dict-table" @cell-click="cellClick">
-                        <!-- 表头工具栏 -->
-                        <template v-slot:action="{ row }">
-                            <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
-                        </template>
-                    </ele-pro-table>
-                </template>
-            </ele-split-layout>
-
-
-
-
-
-
-
-        </el-card>
-
-        <div class="btns">
-            <el-button type="primary" size="small" @click="selected">选择</el-button>
-            <el-button size="small" @click="handleClose">关闭</el-button>
+  <el-dialog
+    :title="title"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    top="5vh"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+  >
+    <el-card shadow="never">
+      <ele-split-layout
+        width="244px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
+      >
+        <div class="ele-border-lighter split-layout-right-content">
+          <DepartmentTree
+            @handleNodeClick="handleNodeClick"
+            :isFirstRefreshTable="false"
+            ref="treeList"
+          />
         </div>
-
-    </el-dialog>
+        <!-- 表格 -->
+        <template v-slot:content>
+          <ele-pro-table
+            ref="table"
+            :columns="columns"
+            :datasource="datasource"
+            row-key="id"
+            height="calc(100vh - 350px)"
+            class="dict-table"
+            @cell-click="cellClick"
+          >
+            <!-- 表头工具栏 -->
+            <template v-slot:action="{ row }">
+              <el-radio class="radio" v-model="radio" :label="row.id"
+                ><i></i
+              ></el-radio>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </el-card>
+
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
 </template>
-  
-<script>
 
-import { getUserPage } from '@/api/system/organization';
-import DepartmentTree from '@/components/DepartmentTree';
-export default {
+<script>
+  import { getUserPage } from '@/api/system/organization';
+  import DepartmentTree from '@/components/DepartmentTree';
+  export default {
     components: {
-        DepartmentTree
+      DepartmentTree
     },
- 
+
     data() {
-        return {
-            currentIndex:0,
-            visible: false,
-            statusOptions: [
+      return {
+        currentIndex: 0,
+        title:'选择负责人',
+        visible: false,
+        statusOptions: [
           { value: 1, label: '全职' },
           { value: 2, label: '兼职' },
           { value: 3, label: '实习' },
@@ -55,23 +72,22 @@ export default {
           { value: 5, label: '试用' },
           { value: 6, label: '离职' }
         ],
-             columns: [
-
-                {
-                    action: 'action',
-                    slot: 'action',
-                    align: 'center',
-                    label: '选择'
-                },
-                {
-                    columnKey: 'index',
-                    label: '序号',
-                    type: 'index',
-                    width: 55,
-                    align: 'center',
-                    showOverflowTooltip: true,
-                    fixed: 'left'
-                },
+        columns: [
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            label: '选择'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
           {
             prop: 'name',
             label: '姓名',
@@ -115,105 +131,98 @@ export default {
               });
               return dom ? dom.label : '';
             }
-          },
-
-
-            ],
+          }
+        ],
 
-            radio: null,
-        }
+        radio: null
+      };
     },
 
-    watch: {
-
-    },
+    watch: {},
     methods: {
-        open(item,index=0) {
-            if (item) {
-                this.radio = item.id
-            }
-            this.currentIndex=index
-            this.visible = true
-        },
-
-
-        /* 表格数据源 */
-        datasource({ page, limit, where, order }) {
-            return getUserPage({
-                pageNum: page,
-                size: limit,
-                ...where
-            });
-        },
-
-
-        /* 刷新表格 */
-        reload(where) {
-            this.$refs.table.reload({ pageNum: 1, where: where  });
-        },
-
-        handleNodeClick(data, node) {
-            this.curNodeData = data;
-            this.reload({ groupId: data.id });
-        },
-
-
-        // 单击获取id
-        cellClick(row) {
-            this.current = row
-            this.radio = row.id
-        },
-        handleClose() {
-            this.visible = false
-            this.current = null
-            this.radio = ''
-        },
-
-        selected() {
-            if (!this.current) {
-                return this.$message.warning('请至少选择一项')
-            }
-            this.$emit('changeParent', this.current,this.currentIndex)
-            this.handleClose()
-        },
-
-
-
-
+      open(item, index = 0, title) {
+        if (item) {
+          this.radio = item.id;
+        }
+        this.currentIndex = index;
+        if (title) {
+          this.title = title;
+          this.radio = '';
 
+        }
+       
+        this.visible = true;
+      },
+
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getUserPage({
+          pageNum: page,
+          size: limit,
+          ...where
+        });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+
+      handleNodeClick(data, node) {
+        this.curNodeData = data;
+        this.reload({ groupId: data.id });
+      },
+
+      // 单击获取id
+      cellClick(row) {
+        this.current = row;
+        this.radio = row.id;
+      },
+      handleClose() {
+        this.visible = false;
+        this.current = null;
+        this.radio = '';
+      },
+
+      selected() {
+        if (!this.current) {
+          return this.$message.warning('请至少选择一项');
+        }
+        this.$emit('changeParent', this.current, this.currentIndex,this.title);
+        this.handleClose();
+      }
     }
-}
+  };
 </script>
-  
+
 <style lang="scss" scoped>
-.tree_col {
+  .tree_col {
     border: 1px solid #eee;
     padding: 10px 0;
     box-sizing: border-box;
     height: 500px;
     overflow: auto;
-}
+  }
 
-.table_col {
+  .table_col {
     padding-left: 10px;
 
     ::v-deep .el-table th.el-table__cell {
-        background: #f2f2f2;
+      background: #f2f2f2;
     }
-}
+  }
 
-.pagination {
+  .pagination {
     text-align: right;
     padding: 10px 0;
-}
+  }
 
-.btns {
+  .btns {
     text-align: center;
     padding: 10px 0;
-}
+  }
 
-.topsearch {
+  .topsearch {
     margin-bottom: 15px;
-}
+  }
 </style>
-  

+ 11 - 2
src/views/saleManage/contact/contactListAdmin.vue

@@ -98,8 +98,7 @@
               指派
             </el-link>
             <el-link
-            v-if="row.assignStatus === 1"
-
+              v-if="row.assignStatus === 1"
               type="warning"
               :underline="false"
               @click="setFree('', row)"
@@ -435,13 +434,23 @@
       assign(type, row) {
         let contactIds = [];
         let contactNames = [];
+        let isAssign = false;
         if (type == 'all') {
           contactIds = this.selection.map((item) => item.id);
           contactNames = this.selection.map((item) => item.name);
+          this.selection.forEach((item) => {
+            if (item.assignStatus === 1) {
+              isAssign = true;
+            }
+          });
         } else {
           contactIds = [row.id];
           contactNames = [row.name];
         }
+        if (isAssign) {
+          this.$message.warning('请先释放已指派的客户!');
+          return;
+        }
         this.$refs.assignDialogRef.open(contactIds, contactNames);
       },
       //释放

+ 468 - 441
src/views/saleManage/quotation/components/addDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <ele-modal
-  custom-class="ele-dialog-form long-dialog-form"
+    custom-class="ele-dialog-form long-dialog-form"
     :centered="true"
     v-if="visible"
     :visible.sync="visible"
@@ -9,268 +9,263 @@
     width="80%"
     @close="cancel"
   >
-  
-  <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-     
+    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
       <headerTitle title="基本信息"></headerTitle>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item
-              label="询价方名称"
-              prop="contactName"
-              style="margin-bottom: 22px"
-            >
-              <el-input
-                clearable
-                v-model="form.contactName"
-                @click.native="handParent"
-                placeholder="请输入"
-              />
-            </el-form-item>
-            <el-form-item
-              label="关联商机"
-              prop="opportunityId"
-              style="margin-bottom: 22px"
-            >
-               <el-select v-model="form.opportunityId" placeholder="请选择"  >
-                 <el-option
-                   v-for="item in businessList"
-                   :key="item.id"
-                   :label="item.name"
-                   :value="item.id">
-                 </el-option>
-               </el-select>
-            </el-form-item>
-            <el-form-item
-              label="询价方联系人"
-              prop="contactLinkName"
-              style="margin-bottom: 22px"
-            >
-            <el-select v-model="form.contactLinkName" placeholder="请选择"  @change="onchangeLink" @focus="selectFocus" >
-                 <el-option
-                   v-for="item in linkNameOptions"
-                   :key="item.id"
-                   :label="item.linkName"
-                   :value="item.id">
-                 </el-option>
-               </el-select>
-            </el-form-item>
-            <el-form-item
-              label="询价方电话"
-              prop="contactTel"
-              style="margin-bottom: 22px"
-            >
-              <el-input
-                clearable
-                :maxlength="20"
-                v-model="form.contactTel"
-                placeholder="请输入"
-              />
-            </el-form-item>
-            <el-form-item
-              label="询价方传真"
-              prop="contactFax"
-              style="margin-bottom: 22px"
-            >
-              <el-input
-                clearable
-                v-model="form.contactFax"
-                placeholder="请输入"
-              />
-            </el-form-item>
-            <el-form-item
-              label="	询价方Email"
-              prop="contactEmail"
-              style="margin-bottom: 22px"
-            >
-              <el-input
-                clearable
-                v-model="form.contactEmail"
-                placeholder="请输入"
-              />
-            </el-form-item>
-            <el-form-item
-              label="询价方地址"
-              prop="contactAddress"
-              style="margin-bottom: 22px"
+      <el-row>
+        <el-col :span="12">
+          <el-form-item
+            label="询价方名称"
+            prop="contactName"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              v-model="form.contactName"
+              @click.native="handParent"
+              placeholder="请输入"
+            />
+          </el-form-item>
+          <el-form-item
+            label="关联商机"
+            prop="opportunityId"
+            style="margin-bottom: 22px"
+          >
+            <el-select v-model="form.opportunityId" placeholder="请选择">
+              <el-option
+                v-for="item in businessList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item
+            label="询价方联系人"
+            prop="contactLinkName"
+            style="margin-bottom: 22px"
+          >
+            <el-select
+              v-model="form.contactLinkName"
+              placeholder="请选择"
+              @change="onchangeLink"
+              @focus="selectFocus"
             >
-              <el-input
-                clearable
-                v-model="form.contactAddress"
-                placeholder="请输入"
-              />
-            </el-form-item>
+              <el-option
+                v-for="item in linkNameOptions"
+                :key="item.id"
+                :label="item.linkName"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item
+            label="询价方电话"
+            prop="contactTel"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              :maxlength="20"
+              v-model="form.contactTel"
+              placeholder="请输入"
+            />
+          </el-form-item>
+          <el-form-item
+            label="询价方传真"
+            prop="contactFax"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              v-model="form.contactFax"
+              placeholder="请输入"
+            />
+          </el-form-item>
+          <el-form-item
+            label="	询价方Email"
+            prop="contactEmail"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              v-model="form.contactEmail"
+              placeholder="请输入"
+            />
+          </el-form-item>
+          <el-form-item
+            label="询价方地址"
+            prop="contactAddress"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              v-model="form.contactAddress"
+              placeholder="请输入"
+            />
+          </el-form-item>
           <el-form-item prop="askFile" label="询价单附件">
-                <fileUpload
-                  v-model="form.askFile"
-                  module="main"
-                  :showLib="false"
-                  :limit="1"
-                />
-              </el-form-item>
-          
-          </el-col>
+            <fileUpload
+              v-model="form.askFile"
+              module="main"
+              :showLib="false"
+              :limit="1"
+            />
+          </el-form-item>
+        </el-col>
 
+        <el-col :span="12">
+          <el-form-item
+            label="报价方名称"
+            prop="quoteName"
+            style="margin-bottom: 22px"
+          >
+            <el-input clearable v-model="form.quoteName" placeholder="请输入" />
+          </el-form-item>
 
+          <el-form-item
+            label="报价方联系人"
+            prop="quoteLinkName"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              v-model="form.quoteLinkName"
+              @click.native="handHead"
+              placeholder="请输入"
+            />
+          </el-form-item>
+          <el-form-item prop="quoteTel" label="报价方联系电话">
+            <el-input clearable v-model="form.quoteTel" placeholder="请输入" />
+          </el-form-item>
+          <el-form-item prop="quoteFax" label="报价方传真">
+            <el-input clearable v-model="form.quoteFax" placeholder="请输入" />
+          </el-form-item>
 
+          <el-form-item
+            label="报价方Email"
+            prop="quoteEmail"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              v-model="form.quoteEmail"
+              placeholder="请输入"
+            />
+          </el-form-item>
 
-          <el-col :span="12">
-            <el-form-item
-              label="报价方名称"
-              prop="quoteName"
-              style="margin-bottom: 22px"
-            >
-              <el-input
-                clearable
-                v-model="form.quoteName"
-                placeholder="请输入"
-              />
-            </el-form-item>
-
-            <el-form-item
-              label="报价方联系人"
-              prop="quoteLinkName"
-              style="margin-bottom: 22px"
-            >
-              <el-input
-                clearable
-                v-model="form.quoteLinkName"
-                @click.native="handHead"
-                placeholder="请输入"
-              />
-            </el-form-item>
-            <el-form-item prop="quoteTel" label="报价方联系电话">
-                <el-input
-                clearable
-                v-model="form.quoteTel"
-                placeholder="请输入"
-              />
-              </el-form-item>
-              <el-form-item prop="quoteFax" label="报价方传真">
-                <el-input
-                clearable
-                v-model="form.quoteFax"
-                placeholder="请输入"
-              />
-              </el-form-item>
+          <el-form-item
+            label="报价方地址"
+            prop="quoteAddress"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              clearable
+              v-model="form.quoteAddress"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
 
-              <el-form-item
-              label="报价方Email"
-              prop="quoteEmail"
-              style="margin-bottom: 22px"
-            >
-              <el-input
-                clearable
-                v-model="form.quoteEmail"
-                placeholder="请输入"
-              />
-            </el-form-item>
-
-            <el-form-item
-              label="报价方地址"
-              prop="quoteAddress"
-              style="margin-bottom: 22px"
-            >
-              <el-input
-                clearable
-                v-model="form.quoteAddress"
-                placeholder="请输入"
-              />
-            </el-form-item>
-
-          </el-col>
-        </el-row>
-
-
-
-      
-    
       <headerTitle title="报价单产品清单"></headerTitle>
-        <inventoryTable
-          ref="inventoryTable"
-          :delDetailIds="delDetailIds"
-        ></inventoryTable>
-        <el-row style="margin-top:20px">
-          <el-col :span="6">
-            <el-form-item prop="taxRate" label="税率">
-              <el-input
-                clearable
-                v-model="form.taxRate"
-                placeholder="请输入"
-              >
+      <inventoryTable
+        ref="inventoryTable"
+        :delDetailIds="delDetailIds"
+      ></inventoryTable>
+      <el-row style="margin-top: 20px">
+        <el-col :span="6">
+          <el-form-item prop="taxRate" label="税率">
+            <el-input clearable v-model="form.taxRate" placeholder="请输入">
               <template slot="append">%</template>
-              </el-input>
-              </el-form-item>
-            </el-col>
-          <el-col :span="6">
-            <el-form-item prop="deliveryDate" label="交货日期">
-                <el-date-picker
-                v-model="form.deliveryDate"
-                  value-format="yyyy-MM-dd"
-                  placeholder="请选择交货日期"
-                  type="date"
-                  style="width:150px"
-                  class="filter-item"
-                ></el-date-picker>
-              </el-form-item>
-            </el-col>
-            <el-col :span="6">
-            <el-form-item
-              label="结算方式"
-              prop="settlementMode"
-              style="margin-bottom: 22px"
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item prop="deliveryDate" label="交货日期">
+            <el-date-picker
+              v-model="form.deliveryDate"
+              value-format="yyyy-MM-dd"
+              placeholder="请选择交货日期"
+              type="date"
+              style="width: 150px"
+              class="filter-item"
+            ></el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item
+            label="结算方式"
+            prop="settlementMode"
+            style="margin-bottom: 22px"
+          >
+            <DictSelection
+              dictName="结算方式"
+              clearable
+              v-model="form.settlementMode"
             >
-            <DictSelection dictName="结算方式" clearable v-model="form.settlementMode">
-                </DictSelection>
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="是否接受拆单" prop="acceptUnpack" style="margin-bottom: 22px">
-              <el-select v-model="form.acceptUnpack" placeholder="请选择">
-               <el-option
-                 v-for="item in acceptUnpackoptions"
-                 :key="item.value"
-                 :label="item.label"
-                 :value="item.value">
-               </el-option>
-             </el-select>
-            </el-form-item>
-           
-          
-          
-          </el-col>
-        </el-row>
+            </DictSelection>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item
+            label="是否接受拆单"
+            prop="acceptUnpack"
+            style="margin-bottom: 22px"
+          >
+            <el-select v-model="form.acceptUnpack" placeholder="请选择">
+              <el-option
+                v-for="item in acceptUnpackoptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
     </el-form>
 
     <div slot="footer" class="footer">
       <el-button type="primary" @click="save">保存</el-button>
+      <el-button type="primary" @click="handHead('生产主管')">提交</el-button>
       <el-button @click="cancel">返回</el-button>
     </div>
-    
-    <parentList ref="parentRef" classType="1" @changeParent="changeParent"></parentList>
-    <head-list ref="headRef"  @changeParent="changePersonel"></head-list>
+
+    <parentList
+      ref="parentRef"
+      classType="1"
+      @changeParent="changeParent"
+    ></parentList>
+    <head-list ref="headRef" @changeParent="changePersonel"></head-list>
   </ele-modal>
 </template>
 
 <script>
-import { emailReg, phoneReg,numberReg } from 'ele-admin';
-import {acceptUnpackoptions} from '@/enum/dict';
-import inventoryTable from './inventoryTable.vue'
-import {categoryData} from 'element-china-category-data';
-import fileUpload from '@/components/upload/fileUpload';
-import {cityData} from 'ele-admin/packages/utils/regions';
-import dictMixins from '@/mixins/dictMixins';
-import deptSelect from '@/components/CommomSelect/dept-select.vue';
-import personSelect from '@/components/CommomSelect/person-select.vue';
-import parentList from '@/views/saleManage/contact/components/parentList.vue'
-import { getDetail, UpdateInformation, addInformation,deleteInformation,updateStatus} from '@/api/saleManage/quotation';
-import {getTableList} from '@/api/saleManage/businessOpportunity';
-import {getcontactlink} from '@/api/saleManage/businessFollow';
-import headList from '@/views/saleManage/businessOpportunity/components/headList.vue'
-import {copyObj} from '@/utils/util';
+  import { emailReg, phoneReg, numberReg } from 'ele-admin';
+  import { acceptUnpackoptions } from '@/enum/dict';
+  import inventoryTable from './inventoryTable.vue';
+  import { categoryData } from 'element-china-category-data';
+  import fileUpload from '@/components/upload/fileUpload';
+  import { cityData } from 'ele-admin/packages/utils/regions';
+  import dictMixins from '@/mixins/dictMixins';
+  import deptSelect from '@/components/CommomSelect/dept-select.vue';
+  import personSelect from '@/components/CommomSelect/person-select.vue';
+  import parentList from '@/views/saleManage/contact/components/parentList.vue';
+  import {
+    getDetail,
+    UpdateInformation,
+    addInformation,
+    submit
+  } from '@/api/saleManage/quotation';
+  import { getTableList } from '@/api/saleManage/businessOpportunity';
+  import { getcontactlink } from '@/api/saleManage/businessFollow';
+  import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
+  import { copyObj } from '@/utils/util';
 
-
-export default {
+  export default {
     props: {
       categoryTreeList: Array
     },
@@ -285,36 +280,36 @@ export default {
     },
     data() {
       let formDef = {
-          id:'',
-          acceptUnpack: null,
-          askFile: null,
-          contactAddress: '',
-          opportunityId:'',
-          contactEmail: '',
-          contactFax: '',
-          contactId: '',
-          contactLinkId: '',
-          contactLinkName: '',
-          contactName:'',
-          contactTel:'',
-          deliveryDate:'',
-          settlementMode:'',
-          settlementModeName:'',
-          quoteAddress:'',
-          quoteEmail:'',
-          quoteFax:'',
-          quoteLinkId:'',
-          quoteLinkName:'',
-          quoteName:'',
-          quoteTel:'',
-          taxRate:null,
-          totalPrice:null
-        };
-   
+        id: '',
+        acceptUnpack: null,
+        askFile: null,
+        contactAddress: '',
+        opportunityId: '',
+        contactEmail: '',
+        contactFax: '',
+        contactId: '',
+        contactLinkId: '',
+        contactLinkName: '',
+        contactName: '',
+        contactTel: '',
+        deliveryDate: '',
+        settlementMode: '',
+        settlementModeName: '',
+        quoteAddress: '',
+        quoteEmail: '',
+        quoteFax: '',
+        quoteLinkId: '',
+        quoteLinkName: '',
+        quoteName: '',
+        quoteTel: '',
+        taxRate: null,
+        totalPrice: null
+      };
+
       return {
-        payWayOptions:[],
-        delDetailIds:[],
-        linkNameOptions:[],
+        payWayOptions: [],
+        delDetailIds: [],
+        linkNameOptions: [],
         acceptUnpackoptions,
         visible: false,
         title: '',
@@ -326,7 +321,7 @@ export default {
         // removeLinkList: [],
         tableBankData: [],
         tableLinkData: [],
-        businessList:[],    //商机列表
+        businessList: [], //商机列表
         rules: {
           contactName: [
             { required: true, message: '请选择客户', trigger: 'change' }
@@ -341,7 +336,12 @@ export default {
             { required: true, message: '请选择是否接受', trigger: 'change' }
           ],
           contactTel: [
-            { required: true,pattern:numberReg,  message: '请输入联系电话', trigger: 'blur' }
+            {
+              required: true,
+              pattern: numberReg,
+              message: '请输入联系电话',
+              trigger: 'blur'
+            }
           ],
           deliveryDate: [
             { required: true, message: '请选择交货日期', trigger: 'change' }
@@ -356,7 +356,12 @@ export default {
             { required: true, message: '请输入报价方名称', trigger: 'blur' }
           ],
           quoteTel: [
-            { required: true,pattern:numberReg, message: '请输入报价方联系电话', trigger: 'blur' }
+            {
+              required: true,
+              pattern: numberReg,
+              message: '请输入报价方联系电话',
+              trigger: 'blur'
+            }
           ],
           quoteEmail: [
             { pattern: emailReg, message: '邮箱格式不正确', trigger: 'blur' }
@@ -368,10 +373,10 @@ export default {
             { pattern: numberReg, message: '请输入数字', trigger: 'blur' }
           ]
         },
-      
+        businessId: '',
         options: {
           cityData,
-          categoryData,
+          categoryData
         },
         // 提交状态
         loading: false,
@@ -381,229 +386,251 @@ export default {
         // 组织机构树形结构数据
         groupTreeData: [],
         // 组织机构平铺数据
-        groupData: [],
+        groupData: []
       };
     },
-  
-    methods: {
 
+    methods: {
       //获取详情
-      async getDetailData (id) {
+      async getDetailData(id) {
+        this.businessId = id;
         this.loading = true;
         const data = await getDetail(id);
         this.loading = false;
         if (data) {
-          this.$nextTick(()=>{
+          this.$nextTick(() => {
             this.form = data;
-            if(data.askFile !== ""){
-              this.$set(this.form,'askFile',[data?.askFile])
-           }
-            this.$refs.inventoryTable&&this.$refs.inventoryTable.putTableValue(data.quoteProductList)
-            this.getLinkInfo(data.contactId)
-            this.getBusinessList(data.contactName)
-          })
-          
-          
+            if (data.askFile !== '') {
+              this.$set(this.form, 'askFile', [data?.askFile]);
+            }
+            this.$refs.inventoryTable &&
+              this.$refs.inventoryTable.putTableValue(data.quoteProductList);
+            this.getLinkInfo(data.contactId);
+            this.getBusinessList(data.contactName);
+          });
         }
       },
 
-   //更新联系人数据
-   async getLinkInfo(contactId) {
-      const data = await getcontactlink({contactId});
-         if(data&&data?.length){
-           this.linkNameOptions=data
-         }
-    },
-  
-    selectFocus(){
-   if(this.linkNameOptions.length===0){
-    return this.$message.error('请先选择名称')
-   }
-    },
-    //获取客户的商机列表
-    async getBusinessList(name){
-      if(!this.form.contactName) return this.$message.error('请先选择询价方名称')
-      const data = await getTableList({
+      //更新联系人数据
+      async getLinkInfo(contactId) {
+        const data = await getcontactlink({ contactId });
+        if (data && data?.length) {
+          this.linkNameOptions = data;
+        }
+      },
+
+      selectFocus() {
+        if (this.linkNameOptions.length === 0) {
+          return this.$message.error('请先选择名称');
+        }
+      },
+      //获取客户的商机列表
+      async getBusinessList(name) {
+        if (!this.form.contactName)
+          return this.$message.error('请先选择询价方名称');
+        const data = await getTableList({
           pageNum: 1,
           size: 30,
-          contactName:name
+          contactName: name
         });
-        console.log(data,'3333')
-        this.businessList=data.list
-    },
-    //选择下拉框
-    onchangeLink(selectedOptions){
-      const option = this.linkNameOptions.find(opt => opt.id === selectedOptions);
-    this.form=Object.assign({},this.form,{
-      contactEmail:option?.email,
-      contactLinkName:option?.linkName||'',
-      contactTel:option?.mobilePhone||option?.phone||'',
-      contactLinkId:option?.id})
-    },
-    handHead(){
-        let item={
-          id:this.form.quoteLinkId
-        }
-        this.$refs.headRef.open(item)
+        console.log(data, '3333');
+        this.businessList = data.list;
       },
-    //选择报价方人回调
-   changePersonel(obj) {
-        this.$set( this.form, 'quoteLinkId',  obj.id)
-        this.$set(this.form, 'quoteLinkName',  obj.name)
-        this.$set(this.form, 'quoteTel',  obj.phone)
-        this.$set(this.form, 'quoteEmail',  obj.email)
+      //选择下拉框
+      onchangeLink(selectedOptions) {
+        const option = this.linkNameOptions.find(
+          (opt) => opt.id === selectedOptions
+        );
+        this.form = Object.assign({}, this.form, {
+          contactEmail: option?.email,
+          contactLinkName: option?.linkName || '',
+          contactTel: option?.mobilePhone || option?.phone || '',
+          contactLinkId: option?.id
+        });
+      },
+      handHead(title) {
+        let item = {
+          id: this.form.quoteLinkId
+        };
+        this.$refs.headRef.open(item, 0, title);
+      },
+      //选择报价方人回调
+      changePersonel(obj, index, title) {
+        if (title === '生产主管') {
+          this.save('sub', obj.id);
+          return;
+        }
+        this.$set(this.form, 'quoteLinkId', obj.id);
+        this.$set(this.form, 'quoteLinkName', obj.name);
+        this.$set(this.form, 'quoteTel', obj.phone);
+        this.$set(this.form, 'quoteEmail', obj.email);
       },
       //选择客户回调
       changeParent(obj) {
-        this.form = Object.assign({},this.form,{
-         contactId: obj.id,
-         contactName: obj.name,
-         contactAddress: obj.addressName + obj.address,
-         contactLinkId:'',
-         contactLinkName:'',
-         contactEmail:'',
-         contactTel:''
-        })
-      this.getLinkInfo(obj.id)
-      this.getBusinessList(obj.name)
+        this.form = Object.assign({}, this.form, {
+          contactId: obj.id,
+          contactName: obj.name,
+          contactAddress: obj.addressName + obj.address,
+          contactLinkId: '',
+          contactLinkName: '',
+          contactEmail: '',
+          contactTel: ''
+        });
+        this.getLinkInfo(obj.id);
+        this.getBusinessList(obj.name);
       },
-    
-      
+
       handParent() {
         let item = {
-          id:  this.form.contactId
-        }
-        this.$refs.parentRef.open(item)
+          id: this.form.contactId
+        };
+        this.$refs.parentRef.open(item);
       },
-    
+
       async open(type, row, contactCategoryId) {
-        this.title = type==='add'?'新增':'修改';
+        this.title = type === 'add' ? '新增' : '修改';
         this.row = row;
         this.visible = true;
         if (type == 'add') {
           this.isUpdate = false;
         } else {
           this.isUpdate = true;
-          this.getDetailData(row.id)
+          this.getDetailData(row.id);
         }
       },
 
-      salesmanChange(val, info){
+      salesmanChange(val, info) {
         this.otherForm.salesmanName = info.name;
       },
-      settlementModeChange(info){
+      settlementModeChange(info) {
         this.otherForm.settlementModeName = info.dictValue;
       },
-      ifChiefChange(value, idx){
-        if(value === 1){
-          this.tableLinkData.forEach(e => e.ifChief = 0);
+      ifChiefChange(value, idx) {
+        if (value === 1) {
+          this.tableLinkData.forEach((e) => (e.ifChief = 0));
           this.tableLinkData[idx].ifChief = 1;
         }
       },
- 
-    
-   
+
+      getValidate() {
+        return new Promise((resolve, reject) => {
+          this.$refs.form.validate((valid) => {
+            if (!valid) {
+              reject(false);
+            } else {
+              resolve(true);
+            }
+          });
+        });
+      },
       getValidate() {
-          return  new Promise((resolve, reject) => {
-              this.$refs.form.validate((valid) => {
-                if (!valid) {
-                  reject(false);
-                } else {
-                  resolve(true);
-                }
-              });
-            })
-     },
-     getValidate() {
         return Promise.all([
-            new Promise((resolve, reject) => {
-              this.$refs.form.validate((valid) => {
-                if (!valid) {
-                  reject(false);
-                } else {
-                  resolve(true);
+          new Promise((resolve, reject) => {
+            this.$refs.form.validate((valid) => {
+              if (!valid) {
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            });
+          }),
+          new Promise((resolve, reject) => {
+            this.$refs.inventoryTable.validateForm((valid) => {
+              if (!valid) {
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            });
+          })
+        ]);
+      },
+      async save(type, productionSupervisorId) {
+        try {
+          await this.getValidate();
+          // 表单验证通过,执行保存操作
+          this.loading = true;
+
+          if (!this.isUpdate) {
+            delete this.form.id;
+          }
+          let settlementModeName = this.getDictValue(
+            '结算方式',
+            this.form.settlementMode
+          );
+
+          if (this.form.askFile && this.form.askFile.length > 0) {
+            this.form.askFile = this.form.askFile[0];
+          } else {
+            this.form.askFile = null;
+          }
+          let commitData = Object.assign({}, this.form, {
+            settlementModeName,
+            quoteProductList: this.$refs.inventoryTable.getTableValue(),
+            totalPrice: this.$refs.inventoryTable.getTotalPrice()
+          });
+          if (this.isUpdate) {
+            UpdateInformation(commitData)
+              .then((res) => {
+                this.loading = false;
+                if (type === 'sub') {
+                  this.quotationSubmit(res, productionSupervisorId);
+                  return;
                 }
+                this.$message.success('修改成功');
+                this.cancel();
+                this.$emit('done');
+              })
+              .catch((e) => {
+                //this.loading = false;
               });
-            }),
-            new Promise((resolve, reject) => {
-              this.$refs.inventoryTable.validateForm((valid) => {
-                if (!valid) {
-                  reject(false);
-                } else {
-                  resolve(true);
+          } else {
+            addInformation(commitData)
+              .then((res) => {
+                this.loading = false;
+
+                if (type === 'sub') {
+                  this.quotationSubmit(res, productionSupervisorId);
+                  return;
                 }
+                this.$message.success('新增成功');
+                this.cancel();
+                this.$emit('done');
+              })
+              .catch((e) => {
+                //this.loading = false;
               });
-            }),
-         
-          
-          ]);
-     },
-      async save() {
-        try {
-           await this.getValidate();
-           // 表单验证通过,执行保存操作
-           this.loading = true;
-      
-        if (!this.isUpdate) {
-          delete this.form.id;
-        } 
-        let settlementModeName=this.getDictValue('结算方式', this.form.settlementMode);
-
-        if(this.form.askFile && this.form.askFile.length > 0){
-          this.form.askFile = this.form.askFile[0];
-        } else {
-          this.form.askFile = null;
-        }
-        let commitData=Object.assign({},this.form,{settlementModeName,
-          quoteProductList:this.$refs.inventoryTable.getTableValue(),
-          totalPrice:this.$refs.inventoryTable.getTotalPrice()})
-        if (this.isUpdate) {
-          UpdateInformation(commitData)
-            .then((res) => {
-              this.loading = false;
-              this.$message.success("修改成功");
-              this.cancel();
-              this.$emit('done');
-            })
-            .catch((e) => {
-              //this.loading = false;
-            });
-        } else {
-          addInformation(commitData)
-            .then((res) => {
-              this.loading = false;
-              this.$message.success("新增成功");
-              this.cancel();
-              this.$emit('done');
-            })
-            .catch((e) => {
-              //this.loading = false;
-            });
           }
         } catch (error) {
-          console.log(error)
+          console.log(error);
           // 表单验证未通过,不执行保存操作
         }
-       
+      },
+      quotationSubmit(res, productionSupervisorId) {
+        submit({
+          businessId: this.businessId || res,
+          productionSupervisorId
+        }).then((res) => {
+          this.cancel();
+          this.$emit('done');
+        });
       },
       cancel() {
         this.$nextTick(() => {
           this.activeName = 'base';
           // 关闭后,销毁所有的表单数据
-          this.$refs['otherForm'] &&  this.$refs['otherForm'].resetFields();
-          this.$refs['formRef'] &&  this.$refs['formRef'].resetFields();
-          this.form = copyObj(this.formDef)
+          this.$refs['otherForm'] && this.$refs['otherForm'].resetFields();
+          this.$refs['formRef'] && this.$refs['formRef'].resetFields();
+          this.form = copyObj(this.formDef);
           this.visible = false;
-        })
-      },
-    
-
+        });
+      }
     }
   };
 </script>
 <style scoped lang="scss">
-.TotalAmount{
-  font-size: 16px;
-  padding-right: 30px;
-}
-</style>
+  .TotalAmount {
+    font-size: 16px;
+    padding-right: 30px;
+  }
+</style>

+ 2 - 0
src/views/saleManage/quotation/index.vue

@@ -51,6 +51,7 @@
                   type="primary"
                   :underline="false"
                   icon="el-icon-edit"
+                  v-if="[0,3].includes(row.status)"
                   @click="openEdit('edit',row)"
                 >
                   修改
@@ -65,6 +66,7 @@
                       type="danger"
                       :underline="false"
                       icon="el-icon-delete"
+                      v-if="[0,3].includes(row.status)"
                     >
                       删除
                     </el-link>