Quellcode durchsuchen

合同管理 新增批量提交操作

采购计划:需求类型中新增生产委外,研发委外。流程简化,采购订单可直接关联采购计划。
Z vor 2 Jahren
Ursprung
Commit
67c347cb25

+ 10 - 0
src/api/contractManage/contractBook.js

@@ -101,3 +101,13 @@ export async function submit(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+/**
+ * 合同批量提交
+ */
+export async function batchSubmitAPI(data) {
+  const res = await request.post(`/bpm/contractApprove/batchSubmit`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 10 - 0
src/api/purchasingManage/purchaseOrder.js

@@ -75,3 +75,13 @@ export async function getPurchaseinquiryAPI(id) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+/**
+ * 通过合同ID获取采购计划
+ */
+export async function getPurchasePlanByContractIdAPI(id) {
+  const res = await request.get(`/eom/purchaseplan/getByContractId/${id}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 2 - 2
src/enum/dict.js

@@ -53,7 +53,7 @@ export const numberList = [
 //报价管理-审核枚举
 export const reviewStatus = {
   0: '未提交',
-  1: '待审核',
+  1: '审核中',
   2: '已审核',
   3: '审核不通过'
 };
@@ -74,7 +74,7 @@ export const deliveryStatusOptions = [
 //销售订单-订单状态
 export const orderStatusOptions = [
   { value: 0, label: '未提交' },
-  { value: 1, label: '待审核' },
+  { value: 1, label: '审核中' },
   { value: 2, label: '已审核' },
   { value: 3, label: '审核未通过' }
 ];

+ 25 - 1
src/views/contractManage/contractBook/index.vue

@@ -53,6 +53,17 @@
                 >
                   批量删除
                 </el-button>
+
+                <el-button
+                  size="small"
+                  type="primary"
+
+                  class="ele-btn-icon"
+                  @click="contractBatchSubmit"
+                  :disabled="selection?.length === 0"
+                >
+                  批量提交
+                </el-button>
               </template>
 
               <!-- 查看详情列 -->
@@ -151,7 +162,7 @@ import supplierAddDialog from '@/views/purchasingManage/purchaseOrder/components
 import {
   getTableList,
   submit,
-  deleteInformation,
+  deleteInformation, batchSubmitAPI,
 } from '@/api/contractManage/contractBook';
 import dictMixins from '@/mixins/dictMixins';
 
@@ -413,6 +424,19 @@ export default {
         this.reload();
       });
     },
+    contractBatchSubmit() {
+      if (this.selection.some(item => ![0, 3].includes(item.status))) return this.$message.warning('审核中、已提交数据不能再次提交,请检查')
+      let arr = this.selection.map(item => {
+        return {
+          businessId: item.id,
+          businessType: item.type
+        }
+      })
+      batchSubmitAPI(arr).then((res) => {
+        this.$message.success('提交成功!');
+        this.reload();
+      });
+    },
     //
     handleGenerateOrder(row) {
       //1销售2是采购

+ 397 - 271
src/views/purchasingManage/purchaseNeedManage/components/addDialog.vue

@@ -19,6 +19,7 @@
               clearable
               v-model="form.sourceType"
               :listFormatte="listFormatte"
+              @change="handleSourceType"
             >
             </DictSelection>
           </el-form-item>
@@ -64,6 +65,30 @@
             />
           </el-form-item>
         </el-col>
+
+        <!-- v-if="form.sourceType==1"-->
+        <el-col v-if="form.sourceType==1" :span="12">
+          <el-form-item label="销售合同">
+            <el-input
+              clearable
+              v-model="form.saleContractName"
+              @click.native="handleContractBtn"
+              @clear="clearContrcat"
+              placeholder="请选择"/>
+          </el-form-item>
+        </el-col>
+        <el-col v-if="form.sourceType==1" :span="12">
+          <el-form-item label="销售订单">
+            <el-input
+              clearable
+              v-model="form.saleOrderNo"
+              @click.native="handleOrderBtn"
+              placeholder="请输入"
+              @clear="clearSaleOrder"
+            />
+          </el-form-item>
+        </el-col>
+
         <el-col :span="12">
           <el-form-item prop="remark" label="是否接受拆单" label-width="120px">
             <el-select
@@ -133,306 +158,407 @@
       ref="inventoryTable"
       :delDetailIds="delDetailIds"
     ></inventoryTable>
+    <contractListDialog
+      ref="selectContractRef"
+      @changeParent="changeContract"
+      :hasGeneratedOrder="''"
+    ></contractListDialog>
+    <orderListDialog
+      ref="orderListDialogRef"
+      @changeParent="changeOrder"
+    ></orderListDialog>
   </ele-modal>
 </template>
 
 <script>
-  import inventoryTable from './inventoryTable.vue';
+import inventoryTable from './inventoryTable.vue';
+
+import fileUpload from '@/components/upload/fileUpload';
+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 fileUpload from '@/components/upload/fileUpload';
-  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 {
+  addPurchaseNeedManage,
+  getDetail,
+  UpdateInformation,
+  submit
+} from '@/api/purchasingManage/purchaseNeedManage';
 
-  import {
-    addPurchaseNeedManage,
-    getDetail,
-    UpdateInformation,
-    submit
-  } from '@/api/purchasingManage/purchaseNeedManage';
 
-  import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
-  import { copyObj } from '@/utils/util';
-  import { listOrganizations } from '@/api/system/organization';
+import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
+import {copyObj} from '@/utils/util';
+import {listOrganizations} from '@/api/system/organization';
+import contractListDialog from "@/views/saleManage/saleOrder/components/contractListDialog.vue";
+import orderListDialog from "@/views/saleManage/saleOrder/invoice/components/orderListDialog.vue";
+import {getTableList as getSaleOrderListAPI} from "@/api/saleManage/saleorder";
 
-  export default {
-    props: {
-      categoryTreeList: Array
+export default {
+  props: {
+    categoryTreeList: Array
+  },
+  mixins: [dictMixins],
+  components: {
+    orderListDialog,
+    contractListDialog,
+    fileUpload,
+    headList,
+    inventoryTable,
+    deptSelect,
+    parentList,
+    personSelect
+  },
+  data() {
+    let formDef = {
+      id: '',
+      receiveDate: null,
+      remark: null,
+      requireDeptId: '',
+      requireDeptName: '',
+      requireUserId: '',
+      requireUserName: '',
+      sourceCode: '',
+      sourceId: '',
+      sourceType: '',
+      requirementName: '',
+      saleContractName: '',
+      saleContractNo: '',
+      saleContractId: '',
+      saleOrderId: '',
+      saleOrderNo: '',
+      files: [],
+      acceptUnpack: 1
+    };
+
+    return {
+      clearing: false, //是否清除合同
+      visible: false,
+      title: '',
+      delDetailIds: [],
+      formDef,
+      form: copyObj(formDef),
+      acceptUnpackList: [
+        {
+          label: '接受',
+          value: 1
+        },
+        {
+          label: '不接受',
+          value: 0
+        }
+      ],
+      rules: {
+        requireDeptId: [
+          {required: true, message: '请选择需求部门', trigger: 'change'}
+        ],
+        requirementName: [
+          {required: true, message: '请输入需求单名称', trigger: 'blur'}
+        ],
+        requireUserId: [
+          {required: true, message: '请选择需求人', trigger: 'change'}
+        ],
+        useTo: [{required: true, message: '请输入用途', trigger: 'change'}],
+        sourceType: [
+          {required: true, message: '请选择需求类型', trigger: 'change'}
+        ]
+      },
+      // 提交状态
+      loading: false,
+      // 是否是修改
+      isUpdate: false,
+
+      // 组织机构树形结构数据
+      groupTreeData: [],
+      // 组织机构平铺数据
+      groupData: [],
+      businessId: ''
+    };
+  },
+  created() {
+    this.getGroupAll();
+  },
+
+  methods: {
+    listFormatte(data) {
+      return data
+      // return data.filter((item) => item.dictCode != 1);
     },
-    mixins: [dictMixins],
-    components: {
-      fileUpload,
-      headList,
-      inventoryTable,
-      deptSelect,
-      parentList,
-      personSelect
+    // 获取公司数据
+    getGroupAll() {
+      listOrganizations().then((list) => {
+        this.groupData = list;
+        this.groupTreeData = this.$util.toTreeData({
+          data: list,
+          idField: 'id',
+          parentIdField: 'parentId'
+        });
+      });
+    },
+
+    // 选择负责人部门
+    change_principalDep(id) {
+      const info = this.groupData.find((e) => e.id == id);
+      console.log(info);
+      this.form.requireDeptName = info.name;
+      this.form.requireUserId = '';
+      this.form.requireUserName = '';
+      // 根据部门获取人员
+      this.$nextTick(() => {
+      });
+      this.getrequireUser(id);
+    },
+    // //选择需求来源类型
+    // chaengSource(data) {
+    //   this.form.sourceType = data?.dictValue;
+    // },
+    getrequireUser(groupId) {
+      if (groupId) {
+        this.$refs.directorRef.getList({groupId});
+      }
+    },
+    salesmanChange(val, info) {
+      this.form.requireUserName = info.name;
+    },
+    //获取详情
+    async getDetailData(id) {
+      this.businessId = id;
+
+      this.loading = true;
+      const data = await getDetail(id);
+      this.loading = false;
+      if (data) {
+        this.$nextTick(() => {
+          this.form = data;
+          // if (data.files !== '') {
+          //   this.$set(this.form, 'files', data?.files);
+          // }
+          // 根据部门获取人员
+          this.$refs.inventoryTable &&
+          this.$refs.inventoryTable.putTableValue(data.detailList);
+          this.getrequireUser(this.form.requireDeptId);
+        });
+      }
+    },
+
+    async open(type, row, contactCategoryId) {
+      this.title = type === 'add' ? '新增' : '修改';
+      this.row = row;
+      this.visible = true;
+      if (type == 'add') {
+        this.isUpdate = false;
+        this.$nextTick(() => {
+          this.form.requireDeptId = this.$store.getters.user.info.groupId;
+          this.form.requireUserId = this.$store.getters.user.info.userId;
+          this.form.requireDeptName = this.$store.getters.user.info.groupName;
+          this.form.requireUserName = this.$store.getters.user.info.name;
+          console.log(this.$store.getters.user.info.groupName);
+          this.getrequireUser(this.form.requireDeptId);
+        });
+      } else {
+        this.isUpdate = true;
+        this.getDetailData(row.id);
+      }
     },
-    data() {
-      let formDef = {
-        id: '',
-        receiveDate: null,
-        remark: null,
-        requireDeptId: '',
-        requireDeptName: '',
-        requireUserId: '',
-        requireUserName: '',
-        sourceCode: '',
-        sourceId: '',
-        sourceType: '',
-        requirementName: '',
-        files: [],
-        acceptUnpack: 1
-      };
 
-      return {
-        visible: false,
-        title: '',
-        delDetailIds: [],
-        formDef,
-        form: copyObj(formDef),
-        acceptUnpackList: [
-          {
-            label: '接受',
-            value: 1
-          },
-          {
-            label: '不接受',
-            value: 0
-          }
-        ],
-        rules: {
-          requireDeptId: [
-            { required: true, message: '请选择需求部门', trigger: 'change' }
-          ],
-          requirementName: [
-            { required: true, message: '请输入需求单名称', trigger: 'blur' }
-          ],
-          requireUserId: [
-            { required: true, message: '请选择需求人', trigger: 'change' }
-          ],
-          useTo: [{ required: true, message: '请输入用途', trigger: 'change' }],
-          sourceType: [
-            { required: true, message: '请选择需求类型', trigger: 'change' }
-          ]
-        },
-        // 提交状态
-        loading: false,
-        // 是否是修改
-        isUpdate: false,
 
-        // 组织机构树形结构数据
-        groupTreeData: [],
-        // 组织机构平铺数据
-        groupData: [],
-        businessId: ''
+    //选择合同弹框
+    handleContractBtn() {
+      if (this.clearing) return;
+      let item = {
+        id: this.form.saleContractId
       };
+      this.$refs.selectContractRef.open(item);
     },
-    created() {
-      this.getGroupAll();
+    //选择合同回调
+    changeContract(obj) {
+      this.form = Object.assign({}, this.form, {
+        saleContractId: obj.id,
+        saleContractName: obj.contractName,
+        saleContractNo: obj.contractNo,
+      });
+      this.getSaleOrderList(this.form.saleContractId)
     },
+    /* 表格数据源 */
+    async getSaleOrderList(contractId) {
+      let res = await getSaleOrderListAPI({
+        pageNum: 1,
+        size: 10,
+        contractId
+      });
+      this.form.saleOrderId = res.list[0]?.id
+      this.form.saleOrderNo = res.list[0]?.orderNo
 
-    methods: {
-      listFormatte(data) {
-        return data
-        // return data.filter((item) => item.dictCode != 1);
-      },
-      // 获取公司数据
-      getGroupAll() {
-        listOrganizations().then((list) => {
-          this.groupData = list;
-          this.groupTreeData = this.$util.toTreeData({
-            data: list,
-            idField: 'id',
-            parentIdField: 'parentId'
-          });
-        });
-      },
+    },
+    //清除合同
+    clearContrcat() {
+      this.clearing = true;
+      this.form.saleContractNo = ''
+      this.form.saleContractId = ''
+      this.form.saleContractName = ''
+      setTimeout(() => {
+        this.clearing = false;
+      }, 500);
+    },
 
-      // 选择负责人部门
-      change_principalDep(id) {
-        const info = this.groupData.find((e) => e.id == id);
-        console.log(info);
-        this.form.requireDeptName = info.name;
-        this.form.requireUserId = '';
-        this.form.requireUserName = '';
-        // 根据部门获取人员
-        this.$nextTick(() => {});
-        this.getrequireUser(id);
-      },
-      // //选择需求来源类型
-      // chaengSource(data) {
-      //   this.form.sourceType = data?.dictValue;
-      // },
-      getrequireUser(groupId) {
-        if (groupId) {
-          this.$refs.directorRef.getList({ groupId });
-        }
-      },
-      salesmanChange(val, info) {
-        this.form.requireUserName = info.name;
-      },
-      //获取详情
-      async getDetailData(id) {
-        this.businessId = id;
+    handleSourceType(){
+      this.form.saleOrderId = ''
+      this.form.saleOrderNo = ''
+      this.form.saleContractNo = ''
+      this.form.saleContractId = ''
+      this.form.saleContractName = ''
+    },
 
-        this.loading = true;
-        const data = await getDetail(id);
-        this.loading = false;
-        if (data) {
-          this.$nextTick(() => {
-            this.form = data;
-            // if (data.files !== '') {
-            //   this.$set(this.form, 'files', data?.files);
-            // }
-            // 根据部门获取人员
-            this.$refs.inventoryTable &&
-              this.$refs.inventoryTable.putTableValue(data.detailList);
-            this.getrequireUser(this.form.requireDeptId);
+    //选择订单弹框
+    handleOrderBtn() {
+      if (this.clearing) return;
+      let item = {
+        id: this.form.saleOrderId
+      };
+      this.$refs.orderListDialogRef.open(item);
+    },
+
+    //选择订单回调
+    changeOrder(obj) {
+      this.form = Object.assign({}, this.form, {
+        saleOrderId: obj.id,
+        saleOrderNo: obj.orderNo,
+        saleContractId: obj.contractId,
+        saleContractName: obj.contractName,
+        saleContractNo: obj.contractNo,
+      })
+    },
+//清除订单
+    clearSaleOrder() {
+      this.clearing = true;
+      this.form.saleOrderId = ''
+      this.form.saleOrderNo = ''
+      setTimeout(() => {
+        this.clearing = false;
+      }, 500);
+    },
+
+
+    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.inventoryTable.validateForm((valid) => {
+            if (!valid) {
+              reject(false);
+            } else {
+              resolve(true);
+            }
           });
+        })
+      ]);
+    },
+    async save(type) {
+      try {
+        await this.getValidate();
+        // 表单验证通过,执行保存操作
+        this.loading = true;
+        let isArrivalBatch = false;
+        let detailList = this.$refs.inventoryTable.getTableValue();
+        if (!this.isUpdate) {
+          delete this.form.id;
         }
-      },
 
-      async open(type, row, contactCategoryId) {
-        this.title = type === 'add' ? '新增' : '修改';
-        this.row = row;
-        this.visible = true;
-        if (type == 'add') {
-          this.isUpdate = false;
-          this.$nextTick(() => {
-            this.form.requireDeptId = this.$store.getters.user.info.groupId;
-            this.form.requireUserId = this.$store.getters.user.info.userId;
-            this.form.requireDeptName = this.$store.getters.user.info.groupName;
-            this.form.requireUserName = this.$store.getters.user.info.name;
-            console.log(this.$store.getters.user.info.groupName);
-            this.getrequireUser(this.form.requireDeptId);
-          });
-        } else {
-          this.isUpdate = true;
-          this.getDetailData(row.id);
+        if (detailList.length == 0) {
+          this.$message.warning('需求清单不能为空');
+          return;
         }
-      },
-      getValidate() {
-        return Promise.all([
-          new Promise((resolve, reject) => {
-            this.$refs.form.validate((valid) => {
-              if (!valid) {
-                reject(false);
-              } else {
-                resolve(true);
+        detailList.forEach((v) => {
+          if (
+            v.arrivalWay == 2 &&
+            (!v.arrivalBatch || v.arrivalBatch.length == 0)
+          ) {
+            isArrivalBatch = true;
+          }
+        });
+        if (isArrivalBatch) {
+          this.$message.warning('请设置分批时间');
+          return;
+        }
+
+        this.form.files = this.form.files || [];
+
+        this.form.sourceTypeName = this.getDictValue(
+          '需求来源类型',
+          this.form.sourceType
+        );
+        let commitData = Object.assign({}, this.form, {
+          detailList
+        });
+        if (this.isUpdate) {
+          UpdateInformation(commitData)
+            .then((res) => {
+              this.loading = false;
+              this.$message.success('修改成功');
+              if (type === 'sub') {
+                this.saleOrderSubmit(res);
+                return;
               }
+              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 {
+          addPurchaseNeedManage(commitData)
+            .then((res) => {
+              this.loading = false;
+              this.$message.success('新增成功');
+              if (type === 'sub') {
+                this.saleOrderSubmit(res);
+                return;
               }
+              this.cancel();
+              this.$emit('done');
+            })
+            .catch((e) => {
+              //this.loading = false;
             });
-          })
-        ]);
-      },
-      async save(type) {
-        try {
-          await this.getValidate();
-          // 表单验证通过,执行保存操作
-          this.loading = true;
-          let isArrivalBatch = false;
-          let detailList = this.$refs.inventoryTable.getTableValue();
-          if (!this.isUpdate) {
-            delete this.form.id;
-          }
-
-          if (detailList.length == 0) {
-            this.$message.warning('需求清单不能为空');
-            return;
-          }
-          detailList.forEach((v) => {
-            if (
-              v.arrivalWay == 2 &&
-              (!v.arrivalBatch || v.arrivalBatch.length == 0)
-            ) {
-              isArrivalBatch = true;
-            }
-          });
-          if (isArrivalBatch) {
-            this.$message.warning('请设置分批时间');
-            return;
-          }
-
-          this.form.files = this.form.files || [];
-
-          this.form.sourceTypeName = this.getDictValue(
-            '需求来源类型',
-            this.form.sourceType
-          );
-          let commitData = Object.assign({}, this.form, {
-            detailList
-          });
-          if (this.isUpdate) {
-            UpdateInformation(commitData)
-              .then((res) => {
-                this.loading = false;
-                this.$message.success('修改成功');
-                if (type === 'sub') {
-                  this.saleOrderSubmit(res);
-                  return;
-                }
-                this.cancel();
-                this.$emit('done');
-              })
-              .catch((e) => {
-                //this.loading = false;
-              });
-          } else {
-            addPurchaseNeedManage(commitData)
-              .then((res) => {
-                this.loading = false;
-                this.$message.success('新增成功');
-                if (type === 'sub') {
-                  this.saleOrderSubmit(res);
-                  return;
-                }
-                this.cancel();
-                this.$emit('done');
-              })
-              .catch((e) => {
-                //this.loading = false;
-              });
-          }
-        } catch (error) {
-          console.log(error);
-          // 表单验证未通过,不执行保存操作
         }
-      },
-      saleOrderSubmit(res) {
-        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.visible = false;
-        });
+      } catch (error) {
+        console.log(error);
+        // 表单验证未通过,不执行保存操作
       }
+    },
+    saleOrderSubmit(res) {
+      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.visible = false;
+      });
     }
-  };
+  }
+};
 </script>
 <style scoped lang="scss">
-  .TotalAmount {
-    font-size: 16px;
-    padding-right: 30px;
-  }
+.TotalAmount {
+  font-size: 16px;
+  padding-right: 30px;
+}
 </style>

+ 189 - 174
src/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue

@@ -58,14 +58,25 @@
               {{ form.requireUserName }}
             </el-form-item>
           </el-col>
+
+          <el-col v-if="form.sourceType==1" :span="12">
+            <el-form-item label="销售合同">
+              {{ form.saleContractName }}
+            </el-form-item>
+          </el-col>
+          <el-col v-if="form.sourceType==1" :span="12">
+            <el-form-item label="销售订单">
+              {{ form.saleOrderNo }}
+            </el-form-item>
+          </el-col>
           <el-col :span="12">
             <el-form-item prop="remark" label="是否接受拆单">
               {{
                 form.acceptUnpack === 1
                   ? '接受'
                   : form.cceptUnpack === 1
-                  ? '不接受'
-                  : ''
+                    ? '不接受'
+                    : ''
               }}
             </el-form-item>
           </el-col>
@@ -92,7 +103,8 @@
                 :underline="false"
                 @click="downloadFile(form.files)"
               >
-                {{ form.files.name }}</el-link
+                {{ form.files.name }}
+              </el-link
               >
             </el-form-item>
           </el-col>
@@ -132,7 +144,8 @@
               :underline="false"
               @click="downloadFile(link)"
             >
-              {{ link.name }}</el-link
+              {{ link.name }}
+            </el-link
             >
           </div>
         </template>
@@ -145,7 +158,8 @@
               :underline="false"
               @click="downloadFile(link)"
             >
-              {{ link.name }}</el-link
+              {{ link.name }}
+            </el-link
             >
           </div>
         </template>
@@ -156,7 +170,7 @@
       v-if="activeComp === 'bpm' && form.processInstanceId"
       :id="form.processInstanceId"
     ></bpmDetail>
-    <timeDialog  ref="timeDialogRef" :view="true"></timeDialog>
+    <timeDialog ref="timeDialogRef" :view="true"></timeDialog>
 
     <div slot="footer" class="footer">
       <el-button @click="cancel">返回</el-button>
@@ -165,186 +179,187 @@
 </template>
 
 <script>
-  import { getDetail } from '@/api/purchasingManage/purchaseNeedManage';
-  import { getFile } from '@/api/system/file';
-  import dictMixins from '@/mixins/dictMixins';
-  import { copyObj } from '@/utils/util';
-  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
-  import timeDialog from '@/components/timeDialog/index.vue';
+import {getDetail} from '@/api/purchasingManage/purchaseNeedManage';
+import {getFile} from '@/api/system/file';
+import dictMixins from '@/mixins/dictMixins';
+import {copyObj} from '@/utils/util';
+import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+import timeDialog from '@/components/timeDialog/index.vue';
 
-  export default {
-    mixins: [dictMixins],
-    props: {
-      isModal: {
-        default: true
-      }
+export default {
+  mixins: [dictMixins],
+  props: {
+    isModal: {
+      default: true
+    }
+  },
+  components: {
+    bpmDetail, timeDialog
+  },
+  data() {
+    return {
+      activeComp: 'main',
+      tabOptions: [
+        {key: 'main', name: '需求详情'},
+        {key: 'bpm', name: '流程详情'}
+      ],
+      visible: false,
+      title: '详情',
+      row: {},
+      form: {},
+      detailData: {},
+      columns: [
+        {
+          width: 45,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          width: 150,
+          prop: 'productCategoryName',
+          label: '分类',
+          slot: 'productCategoryName'
+        },
+        {
+          width: 140,
+          prop: 'productCode',
+          label: '编码',
+          slot: 'productCode'
+        },
+        {
+          width: 240,
+          prop: 'productName',
+          label: '名称',
+          slot: 'productName'
+        },
+        {
+          width: 150,
+          prop: 'productBrand',
+          label: '牌号',
+          slot: 'productBrand'
+        },
+        {
+          width: 80,
+          prop: 'totalCount',
+          label: '数量',
+          slot: 'totalCount'
+        },
+        {
+          width: 100,
+          prop: 'measuringUnit',
+          label: '单位',
+          slot: 'measuringUnit'
+        },
+        {
+          width: 130,
+          prop: 'modelType',
+          label: '型号',
+          slot: 'modelType'
+        },
+        {
+          width: 120,
+          prop: 'specification',
+          label: '规格',
+          slot: 'specification'
+        },
+        {
+          width: 130,
+          prop: 'brand',
+          label: '品牌',
+          slot: 'brand'
+        },
+        {
+          width: 150,
+          prop: 'arrivalWay',
+          label: '	到货方式',
+          formatter: (row, column, cellValue) => {
+            return cellValue == 1 ? '一次性到货' : '分批到货';
+          }
+        },
+        {
+          width: 170,
+          prop: 'expectReceiveDate',
+          label: '到货日期',
+          slot: 'expectReceiveDate'
+        },
+        {
+          width: 160,
+          prop: 'technicalDrawings',
+          label: '图纸附件',
+          slot: 'technicalDrawings'
+        },
+        {
+          width: 140,
+          prop: 'files',
+          label: '附件',
+          slot: 'files'
+        },
+        {
+          width: 220,
+          prop: 'remark',
+          label: '备注',
+          slot: 'remark'
+        }
+      ]
+    };
+  },
+  methods: {
+    async open(row) {
+      this.visible = true;
+      this.getDetailData(row.requirementId || row.id);
     },
-    components: {
-      bpmDetail,timeDialog
+    cancel() {
+      this.$nextTick(() => {
+        // 关闭后,销毁所有的表单数据
+        (this.form = copyObj(this.formDef)),
+          (this.otherForm = copyObj(this.otherFormDef)),
+          (this.tableBankData = []);
+        this.tableLinkData = [];
+        this.visible = false;
+      });
     },
-    data() {
-      return {
-        activeComp: 'main',
-        tabOptions: [
-          { key: 'main', name: '需求详情' },
-          { key: 'bpm', name: '流程详情' }
-        ],
-        visible: false,
-        title: '详情',
-        row: {},
-        form: {},
-        detailData: {},
-        columns: [
-          {
-            width: 45,
-            type: 'index',
-            columnKey: 'index',
-            align: 'center',
-            fixed: 'left'
-          },
-          {
-            width: 150,
-            prop: 'productCategoryName',
-            label: '分类',
-            slot: 'productCategoryName'
-          },
-          {
-            width: 140,
-            prop: 'productCode',
-            label: '编码',
-            slot: 'productCode'
-          },
-          {
-            width: 240,
-            prop: 'productName',
-            label: '名称',
-            slot: 'productName'
-          },
-          {
-            width: 150,
-            prop: 'productBrand',
-            label: '牌号',
-            slot: 'productBrand'
-          },
-          {
-            width: 80,
-            prop: 'totalCount',
-            label: '数量',
-            slot: 'totalCount'
-          },
-          {
-            width: 100,
-            prop: 'measuringUnit',
-            label: '单位',
-            slot: 'measuringUnit'
-          },
-          {
-            width: 130,
-            prop: 'modelType',
-            label: '型号',
-            slot: 'modelType'
-          },
-          {
-            width: 120,
-            prop: 'specification',
-            label: '规格',
-            slot: 'specification'
-          },
-          {
-            width: 130,
-            prop: 'brand',
-            label: '品牌',
-            slot: 'brand'
-          },
-          {
-            width: 150,
-            prop: 'arrivalWay',
-            label: '	到货方式',
-            formatter: (row, column, cellValue) => {
-              return cellValue == 1 ? '一次性到货' : '分批到货';
-            }
-          },
-          {
-            width: 170,
-            prop: 'expectReceiveDate',
-            label: '到货日期',
-            slot: 'expectReceiveDate'
-          },
-          {
-            width: 160,
-            prop: 'technicalDrawings',
-            label: '图纸附件',
-            slot: 'technicalDrawings'
-          },
-          {
-            width: 140,
-            prop: 'files',
-            label: '附件',
-            slot: 'files'
-          },
-          {
-            width: 220,
-            prop: 'remark',
-            label: '备注',
-            slot: 'remark'
-          }
-        ]
-      };
+    downloadFile(file) {
+      getFile({objectName: file.storePath}, file.name);
     },
-    methods: {
-      async open(row) {
-        this.visible = true;
-        this.getDetailData(row.requirementId || row.id);
-      },
-      cancel() {
-        this.$nextTick(() => {
-          // 关闭后,销毁所有的表单数据
-          (this.form = copyObj(this.formDef)),
-            (this.otherForm = copyObj(this.otherFormDef)),
-            (this.tableBankData = []);
-          this.tableLinkData = [];
-          this.visible = false;
-        });
-      },
-      downloadFile(file) {
-        getFile({ objectName: file.storePath }, file.name);
-      },
-      handleMethod(row) {
-        this.$refs.timeDialogRef.open(row);
-      },
-      async getDetailData(id) {
-        this.loading = true;
-        const data = await getDetail(id);
-        this.loading = false;
-        if (data) {
-          this.form = data;
+    handleMethod(row) {
+      this.$refs.timeDialogRef.open(row);
+    },
+    async getDetailData(id) {
+      this.loading = true;
+      const data = await getDetail(id);
+      this.loading = false;
+      if (data) {
+        this.form = data;
 
-          this.detailData = data;
-          if (data.files && data.files.length > 0) {
-            this.form.files = data.files[0];
-          } else {
-            this.form.files = null;
-          }
+        this.detailData = data;
+        if (data.files && data.files.length > 0) {
+          this.form.files = data.files[0];
+        } else {
+          this.form.files = null;
         }
       }
     }
-  };
+  }
+};
 </script>
 
 <style scoped lang="scss">
-  .ele-dialog-form {
-    .el-form-item {
-      margin-bottom: 10px;
-    }
+.ele-dialog-form {
+  .el-form-item {
+    margin-bottom: 10px;
   }
+}
 
-  .headbox {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    .amount {
-      font-size: 14px;
-      font-weight: bold;
-    }
+.headbox {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
   }
+}
 </style>

+ 54 - 12
src/views/purchasingManage/purchaseOrder/components/addDialog.vue

@@ -25,18 +25,16 @@
             />
           </el-form-item>
           <el-form-item
-            label="采购订单类型"
-            prop="purchaseType"
-            style="margin-bottom: 22px"
-          >
-            <DictSelection
-              dictName="采购订单类型"
-              clearable
-              v-model="form.purchaseType"
-            >
-            </DictSelection>
+            label="采购计划单名称"
+            prop="planCode">
+            <el-input
+              @click.native="handPurchasePlan"
+              v-model="form.purchasePlanName"
+              placeholder="请选择"
+            ></el-input>
           </el-form-item>
 
+
           <el-form-item
             label="需求部门"
             prop="requireDeptId"
@@ -103,6 +101,18 @@
             >
             </el-date-picker>
           </el-form-item> -->
+          <el-form-item
+            label="采购订单类型"
+            prop="purchaseType"
+            style="margin-bottom: 22px"
+          >
+            <DictSelection
+              dictName="采购订单类型"
+              clearable
+              v-model="form.purchaseType"
+            >
+            </DictSelection>
+          </el-form-item>
           <el-form-item label="结算方式" prop="settlementMode">
             <DictSelection
               dictName="结算方式"
@@ -340,6 +350,10 @@
       @changeParent="changeContract"
       :type="2"
     ></contractListDialog>
+    <inquiryManageList
+      ref="inquiryManageRef"
+      @changeInquiryManageList="changeInquiryManageList"
+    ></inquiryManageList>
   </ele-modal>
 </template>
 
@@ -360,6 +374,7 @@ import {
   UpdateInformation,
   addInformation,
   submit, getPurchaseinquiryAPI,
+  getPurchasePlanByContractIdAPI
 } from '@/api/purchasingManage/purchaseOrder';
 
 import {getcontactlink} from '@/api/saleManage/businessFollow';
@@ -367,10 +382,12 @@ import headList from '@/views/saleManage/businessOpportunity/components/headList
 import contractListDialog from '@/views/saleManage/saleOrder/components/contractListDialog.vue';
 import {listOrganizations} from '@/api/system/organization';
 import {copyObj} from '@/utils/util';
+import inquiryManageList from "@/views/purchasingManage/inquiryManage/components/inquiryManage-list.vue";
 
 export default {
   mixins: [dictMixins],
   components: {
+    inquiryManageList,
     fileUpload,
     headList,
     contractListDialog,
@@ -415,7 +432,11 @@ export default {
       partbLinkId: '',
       partbLinkName: '',
       partbName: '',
-      partbTel: ''
+      partbTel: '',
+      purchasePlanId: '',
+      purchasePlanNo: '',
+      purchasePlanName: '',
+
     };
 
     return {
@@ -529,7 +550,17 @@ export default {
 
       this.getrequireUser(id);
     },
+    //选择采购计划
+    handPurchasePlan() {
+      this.$refs.inquiryManageRef.open(this.form.planCode);
+    },
+//选择采购计划回调
+    changeInquiryManageList(data) {
+      this.form.purchasePlanId = data.id;
+      this.form.purchasePlanNo = data.planCode;
+      this.form.purchasePlanName = data.planName;
 
+    },
     // //选择需求来源类型
     // chaengSource(data) {
     //   this.form.sourceType = data?.dictValue;
@@ -717,7 +748,6 @@ export default {
 
     //选择合同回调
     changeContract(obj) {
-
       this.form = Object.assign({}, this.form, {
         contractId: obj.id,
         contractName: obj.contractName,
@@ -727,7 +757,18 @@ export default {
       //采购询价表
       obj.sourceId && this.getPurchaseinquiry(obj.sourceId);
       this.$store.commit('order/setContractId', obj.id);
+      //获取合同采购计划
+      this.getPlanInfo(this.form.contractId)
     },
+    async getPlanInfo(id) {
+      let res = await getPurchasePlanByContractIdAPI(id)
+      this.form = Object.assign({}, this.form, {
+        purchasePlanId: res.data?.id,
+        purchasePlanName: res.data?.planName,
+        purchasePlanNo: res.data?.planCode,
+      });
+    },
+
 
     //选择合同弹框
     handleContractBtn() {
@@ -920,6 +961,7 @@ export default {
     },
     sub(res) {
       submit({
+        sourceType:this.form.sourceType,
         businessId: this.businessId || res
       }).then((res) => {
         this.cancel();

+ 8 - 0
src/views/purchasingManage/purchaseOrder/components/detailDialog.vue

@@ -92,6 +92,14 @@
             >
               {{ form.contractName }}
             </el-form-item>
+            <el-form-item
+              label="采购计划名称:"
+              prop="purchasePlanName"
+              style="margin-bottom: 16px"
+            >
+              {{ form.purchasePlanName }}
+            </el-form-item>
+
             <el-form-item
               label="结算方式:"
               prop="settlementModeName"

+ 288 - 278
src/views/purchasingManage/purchaseOrder/index.vue

@@ -18,7 +18,7 @@
       <div class="main">
         <div v-if="activeComp == 'saleorder'">
           <div class="ele-border-lighter form-content" v-loading="loading">
-            <search-table @search="reload"> </search-table>
+            <search-table @search="reload"></search-table>
 
             <!-- 数据表格 -->
             <ele-pro-table
@@ -62,7 +62,8 @@
                   :underline="false"
                   @click="opencontractDetail(row)"
                 >
-                  {{ row.contractName }}</el-link
+                  {{ row.contractName }}
+                </el-link
                 >
               </template>
               <template v-slot:orderNo="{ row }">
@@ -71,7 +72,8 @@
                   :underline="false"
                   @click="openorderDetail(row)"
                 >
-                  {{ row.orderNo }}</el-link
+                  {{ row.orderNo }}
+                </el-link
                 >
               </template>
               <!-- 操作列 -->
@@ -119,10 +121,12 @@
                   </span>
                   <el-dropdown-menu slot="dropdown">
                     <el-dropdown-item command="invoice"
-                      >创建收货单</el-dropdown-item
+                    >创建收货单
+                    </el-dropdown-item
                     >
                     <el-dropdown-item command="returnOrder"
-                      >创建退货单</el-dropdown-item
+                    >创建退货单
+                    </el-dropdown-item
                     >
                   </el-dropdown-menu>
                 </el-dropdown>
@@ -163,296 +167,302 @@
 </template>
 
 <script>
-  import searchTable from './components/searchTable.vue';
-  import addDialog from './components/addDialog.vue';
-  import invoice from './invoice/index.vue';
-  import detailDialog from './components/detailDialog.vue';
-  import contractrDetail from '@/views/contractManage/contractBook/components/detailDialog.vue';
-  import addInvoiceDialog from '@/views/purchasingManage/purchaseOrder/invoice/components/addInvoiceDialog';
-  import addReturnGoodsDialog from '@/views/purchasingManage/purchaseOrder/returnGoods/components/addReturnGoodsDialog';
-  import popModal from '@/components/pop-modal';
-  import accountstatement from './accountstatement/index.vue';
-  import returnGoods from './returnGoods/index.vue';
-  import {
-    getTableList,
-    deleteInformation,submit
-  } from '@/api/purchasingManage/purchaseOrder';
-  import dictMixins from '@/mixins/dictMixins';
-  import { reviewStatus } from '@/enum/dict';
+import searchTable from './components/searchTable.vue';
+import addDialog from './components/addDialog.vue';
+import invoice from './invoice/index.vue';
+import detailDialog from './components/detailDialog.vue';
+import contractrDetail from '@/views/contractManage/contractBook/components/detailDialog.vue';
+import addInvoiceDialog from '@/views/purchasingManage/purchaseOrder/invoice/components/addInvoiceDialog';
+import addReturnGoodsDialog from '@/views/purchasingManage/purchaseOrder/returnGoods/components/addReturnGoodsDialog';
+import popModal from '@/components/pop-modal';
+import accountstatement from './accountstatement/index.vue';
+import returnGoods from './returnGoods/index.vue';
+import {
+  getTableList,
+  deleteInformation, submit
+} from '@/api/purchasingManage/purchaseOrder';
+import dictMixins from '@/mixins/dictMixins';
+import {reviewStatus} from '@/enum/dict';
 
-  export default {
-    mixins: [dictMixins],
-    components: {
-      searchTable,
-      returnGoods,
-      accountstatement,
-      popModal,
-      contractrDetail,
-      addReturnGoodsDialog,
-      addInvoiceDialog,
-      invoice,
-      addDialog,
-      detailDialog
-    },
-    data() {
-      return {
-        activeComp: 'saleorder',
-        tabOptions: [
-          { key: 'saleorder', name: '采购订单' },
-          { key: 'invoice', name: '收货单' },
-          { key: 'returnorder', name: '退货单' },
-          { key: 'accountstatement', name: '对账单' }
-        ],
-        selection: [], //单选中集合
-        delVisible: false, //批量删除弹框状态
-        loading: false, // 加载状态
-        columns: [
-          {
-            width: 45,
-            type: 'selection',
-            columnKey: 'selection',
-            align: 'center'
-          },
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            prop: 'orderNo',
-            label: '订单编码',
-            align: 'center',
-            slot: 'orderNo',
-            showOverflowTooltip: true,
-            minWidth: 200
-          },
-          {
-            prop: 'contractName',
-            label: '合同名称',
-            align: 'center',
-            slot: 'contractName',
-            showOverflowTooltip: true,
-            minWidth: 250
-          },
-          // {
-          //   prop: 'deliveryDate',
-          //   label: '交货日期',
-          //   align: 'center',
-          //   showOverflowTooltip: true,
-          //   minWidth: 200
-          // },
-          {
-            prop: 'purchaseTypeName',
-            label: '采购订单类型',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 140
-          },
-          {
-            prop: 'partaName',
-            label: '采购方名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 200
-          },
-          {
-            prop: 'partaLinkName',
-            label: '采购方联系人',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 130
-          },
+export default {
+  mixins: [dictMixins],
+  components: {
+    searchTable,
+    returnGoods,
+    accountstatement,
+    popModal,
+    contractrDetail,
+    addReturnGoodsDialog,
+    addInvoiceDialog,
+    invoice,
+    addDialog,
+    detailDialog
+  },
+  data() {
+    return {
+      activeComp: 'saleorder',
+      tabOptions: [
+        {key: 'saleorder', name: '采购订单'},
+        {key: 'invoice', name: '收货单'},
+        {key: 'returnorder', name: '退货单'},
+        {key: 'accountstatement', name: '对账单'}
+      ],
+      selection: [], //单选中集合
+      delVisible: false, //批量删除弹框状态
+      loading: false, // 加载状态
+      columns: [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center'
+        },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'orderNo',
+          label: '订单编码',
+          align: 'center',
+          slot: 'orderNo',
+          showOverflowTooltip: true,
+          minWidth: 200
+        },
+        {
+          prop: 'contractName',
+          label: '合同名称',
+          align: 'center',
+          slot: 'contractName',
+          showOverflowTooltip: true,
+          minWidth: 250
+        },
+        // {
+        //   prop: 'deliveryDate',
+        //   label: '交货日期',
+        //   align: 'center',
+        //   showOverflowTooltip: true,
+        //   minWidth: 200
+        // },
+        {
+          prop: 'purchaseTypeName',
+          label: '采购订单类型',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'partaName',
+          label: '采购方名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 200
+        },
+        {
+          prop: 'partaLinkName',
+          label: '采购方联系人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 130
+        },
 
-          {
-            prop: 'partaTel',
-            label: '采购方联系电话',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 130
-          },
-          {
-            prop: 'partbName',
-            label: '供应商名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 250
-          },
-          {
-            prop: 'partbLinkName',
-            label: '供应商联系人',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 120
-          },
-          {
-            prop: 'partbTel',
-            label: '供应商联系电话',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 130
-          },
-          {
-            prop: 'payAmount',
-            label: '应付金额(元)',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 140
-          },
-          {
-            prop: 'createTime',
-            label: '创建时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 170
-          },
-          {
-            prop: 'orderStatus',
-            label: '审核状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 100,
-            formatter: (_row, _column, cellValue) => {
-              return reviewStatus[_row.orderStatus];
-            }
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 230,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true,
-            fixed: 'right'
+        {
+          prop: 'partaTel',
+          label: '采购方联系电话',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 130
+        },
+        {
+          prop: 'partbName',
+          label: '供应商名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 250
+        },
+        {
+          prop: 'partbLinkName',
+          label: '供应商联系人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        {
+          prop: 'partbTel',
+          label: '供应商联系电话',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 130
+        },
+        {
+          prop: 'payAmount',
+          label: '应付金额(元)',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 170
+        },
+        {
+          prop: 'orderStatus',
+          label: '审核状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 100,
+          formatter: (_row, _column, cellValue) => {
+            return reviewStatus[_row.orderStatus];
           }
-        ]
-      };
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 230,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true,
+          fixed: 'right'
+        }
+      ]
+    };
+  },
+  computed: {},
+  created() {
+    this.requestDict('客户状态');
+  },
+  methods: {
+    //更多菜单
+    handleCommand(command, row) {
+      console.log(command, row);
+      if (command === 'invoice') {
+        this.$refs.invoiceDialogRef.open('add', {}, row.id);
+      }
+      if (command === 'returnOrder') {
+        this.$refs.addReturnGoodsRef.open('add', {});
+      }
     },
-    computed: {},
-    created() {
-      this.requestDict('客户状态');
+    //点击左边分类
+    handleNodeClick(data, node) {
+      // this.curNodeData = data;
+      this.reload({categoryId: data.id});
+    },
+    /* 表格数据源 */
+    datasource({page, limit, where, order}) {
+      return getTableList({
+        pageNum: page,
+        size: limit,
+        ...where
+      });
     },
-    methods: {
-      //更多菜单
-      handleCommand(command, row) {
-        console.log(command, row);
-        if (command === 'invoice') {
-          this.$refs.invoiceDialogRef.open('add', {}, row.id);
-        }
-        if (command === 'returnOrder') {
-          this.$refs.addReturnGoodsRef.open('add', {});
-        }
-      },
-      //点击左边分类
-      handleNodeClick(data, node) {
-        // this.curNodeData = data;
-        this.reload({ categoryId: data.id });
-      },
-      /* 表格数据源 */
-      datasource({ page, limit, where, order }) {
-        return getTableList({
-          pageNum: page,
-          size: limit,
-          ...where
-        });
-      },
 
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ page: 1, where });
-      },
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({page: 1, where});
+    },
 
-      //新增编辑
-      openEdit(type, row) {
-        this.$refs.addDialogRef.open(type, row, row.id);
-        this.$refs.addDialogRef.$refs.form &&
-          this.$refs.addDialogRef.$refs.form.clearValidate();
-      },
+    //新增编辑
+    openEdit(type, row) {
+      this.$refs.addDialogRef.open(type, row, row.id);
+      this.$refs.addDialogRef.$refs.form &&
+      this.$refs.addDialogRef.$refs.form.clearValidate();
+    },
 
-      //批量删除
-      allDelBtn() {
-        if (this.selection.length === 0) return;
-        let flag =  this.selection.some(item=>[1,2].includes(item.orderStatus))
-        if(flag) return this.$message.warning('抱歉已审核、审核中的数据不能删除,请检查')
-        this.delVisible = true;
-      },
+    //批量删除
+    allDelBtn() {
+      if (this.selection.length === 0) return;
+      let flag = this.selection.some(item => [1, 2].includes(item.orderStatus))
+      if (flag) return this.$message.warning('抱歉已审核、审核中的数据不能删除,请检查')
+      this.delVisible = true;
+    },
 
-      //删除接口
-      remove(delData) {
-        deleteInformation(delData).then((res) => {
-          this.$message.success('删除成功!');
-          this.reload();
-        });
-      },
+    //删除接口
+    remove(delData) {
+      deleteInformation(delData).then((res) => {
+        this.$message.success('删除成功!');
+        this.reload();
+      });
+    },
 
-      //删除弹框确定
-      commitBtn() {
-        const dataId = this.selection.map((v) => v.id);
-        this.remove(dataId);
-      },
+    //删除弹框确定
+    commitBtn() {
+      const dataId = this.selection.map((v) => v.id);
+      this.remove(dataId);
+    },
 
-      //查看详情
-      openorderDetail(row) {
-        this.$refs.contactDetailDialogRef.open(row);
-      },
-      saleOrderSubmit(res) {
-        submit({
-          businessId: res.id
-        }).then((res) => {
-          this.$message.success('提交成功');
-          this.reload();
-        });
-      },
-      //查看合同详情
-      opencontractDetail(row) {
-        let data = {
-          id: row.contractId
-        };
-        this.$refs.contractDetailRef.open(data);
-      }
+    //查看详情
+    openorderDetail(row) {
+      this.$refs.contactDetailDialogRef.open(row);
+    },
+    saleOrderSubmit(res) {
+      submit({
+        sourceType: res.sourceType,
+        businessId: res.id
+      }).then((res) => {
+        this.$message.success('提交成功');
+        this.reload();
+      });
+    },
+    //查看合同详情
+    opencontractDetail(row) {
+      let data = {
+        id: row.contractId
+      };
+      this.$refs.contractDetailRef.open(data);
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  :deep .el-card__body {
-    padding: 0;
-  }
-  :deep(.el-link--inner) {
-    margin-left: 0px !important;
-  }
+:deep .el-card__body {
+  padding: 0;
+}
 
-  .sys-organization-list {
-    height: calc(100vh - 264px);
-    box-sizing: border-box;
-    border-width: 1px;
-    border-style: solid;
-    overflow: auto;
-  }
-  .sys-organization-list :deep(.el-tree-node__content) {
-    height: 40px;
-    & > .el-tree-node__expand-icon {
-      margin-left: 10px;
-    }
-  }
+:deep(.el-link--inner) {
+  margin-left: 0px !important;
+}
 
-  .switch_left ul .active {
-    border-top: 4px solid var(--color-primary);
-    color: var(--color-primary-5);
-  }
-  .switch {
-    padding-bottom: 20px;
-  }
+.sys-organization-list {
+  height: calc(100vh - 264px);
+  box-sizing: border-box;
+  border-width: 1px;
+  border-style: solid;
+  overflow: auto;
+}
 
-  .el-dropdown-link {
-    cursor: pointer;
-    color: var(--color-primary-5);
-  }
-  .el-icon-arrow-down {
-    font-size: 12px;
+.sys-organization-list :deep(.el-tree-node__content) {
+  height: 40px;
+
+  & > .el-tree-node__expand-icon {
+    margin-left: 10px;
   }
+}
+
+.switch_left ul .active {
+  border-top: 4px solid var(--color-primary);
+  color: var(--color-primary-5);
+}
+
+.switch {
+  padding-bottom: 20px;
+}
+
+.el-dropdown-link {
+  cursor: pointer;
+  color: var(--color-primary-5);
+}
+
+.el-icon-arrow-down {
+  font-size: 12px;
+}
 </style>

+ 5 - 1
src/views/saleManage/saleOrder/components/contractListDialog.vue

@@ -68,6 +68,10 @@
       type: {
         default: 1,
         type: Number
+      },
+      hasGeneratedOrder:{
+        default: 0,
+        type: [Number,String]
       }
     },
     data() {
@@ -234,7 +238,7 @@
           size: limit,
           type:this.type,
           status:2,
-          hasGeneratedOrder:0,
+          hasGeneratedOrder:this.hasGeneratedOrder,
           ...where
         });
       },