yusheng il y a 2 ans
Parent
commit
7c6dfa003e

+ 15 - 8
src/api/saleOrder/index.js

@@ -68,14 +68,14 @@ export async function productionToPlan(data) {
 }
 
 // // 生产版本列表
-// export async function versionPage (params) {
-//   let par = new URLSearchParams(params);
-//   const res = await request.get( `/main/produceversion/page?` + par );
-//   if (res.data.code == 0) {
-//     return res.data.data;
-//   }
-//   return Promise.reject(new Error(res.data.message));
-// }
+export async function versionPage (params) {
+  let par = new URLSearchParams(params);
+  const res = await request.get( `/main/produceversion/page?` + par );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
 // 刷新销售订单
 export async function pullSalesOrder(params) {
@@ -184,3 +184,10 @@ export async function getInventory(materialCode, planType) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+// 选择工艺路线
+export async function routeList (params)  {
+  const res = await request.get('/main/producerouting/page', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+}

+ 186 - 0
src/components/ProductionVersion2/index.vue

@@ -0,0 +1,186 @@
+<template>
+  <el-dialog
+    title="选择工艺路线"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+  >
+    <el-card shadow="never">
+      <productionSearch @search="reload"></productionSearch>
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        height="calc(100vh - 350px)"
+        class="dict-table"
+        @cell-click="cellClick"
+      >
+        <!-- 表头工具栏 -->
+
+        <template v-slot:status="{ row }">
+          {{ checkStatus(row) }}
+        </template>
+
+        <template v-slot:action="{ row }">
+          <el-radio class="radio" v-model="radio" :label="row.id"
+            ><i></i
+          ></el-radio>
+        </template>
+      </ele-pro-table>
+    </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 { routeList } from '@/api/saleOrder';
+  import productionSearch from './production-search.vue';
+  export default {
+    components: {
+      productionSearch
+    },
+    data() {
+      return {
+        visible: false,
+        currentNum: '',
+        // 表格列配置
+        columns: [
+          {
+            prop: 'code',
+            label: '工艺路线组编码',
+            // sortable: 'custom',
+            showOverflowTooltip: true,
+            align: 'center',
+
+            minWidth: 110
+          },
+          {
+            prop: 'name',
+            label: '工艺路线名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'version',
+            label: '工艺路线版本',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            prop: 'produceVersionName',
+            label: '生产版本',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            slot: 'status',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            label: '选择'
+          }
+        ],
+        statusList: [
+          { label: '草稿', value: -1 },
+          { label: '失效', value: 0 },
+          { label: '生效', value: 1 }
+        ],
+        categoryLevelId: '9',
+        radio: null,
+        current:{}
+      };
+    },
+
+    watch: {},
+    methods: {
+      checkStatus(row) {
+        let obj = this.statusList.find((it) => it.value == row.status);
+        return obj.label;
+      },
+      /* 表格数据源 */
+      datasource({ page, where, limit }) {
+        return routeList({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
+      open(index) {
+        this.currentNum = index;
+        this.visible = true;
+      },
+      // 单击获取id
+      cellClick(row) {
+        this.current = row;
+        this.radio = row.id;
+      },
+
+      handleClose() {
+        this.visible = false;
+      },
+      selected() {
+        if (!this.current) {
+          return this.$message.warning('请选择工艺路线');
+        }
+        this.$emit('changeProduct', this.current,this.currentNum);
+        this.handleClose();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+  }
+
+  .table_col {
+    padding-left: 10px;
+
+    ::v-deep .el-table th.el-table__cell {
+      background: #f2f2f2;
+    }
+  }
+
+  .pagination {
+    text-align: right;
+    padding: 10px 0;
+  }
+
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+
+  .topsearch {
+    margin-bottom: 15px;
+  }
+</style>

+ 100 - 0
src/components/ProductionVersion2/production-search.vue

@@ -0,0 +1,100 @@
+<template>
+    <el-form
+      label-width="120px"
+      class="ele-form-search"
+      @keyup.enter.native="search"
+      @submit.native.prevent
+    >
+      <el-row>
+        <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 4 }">
+          <el-form-item label="工艺路线组编码:">
+            <el-input clearable v-model="where.code" placeholder="请输入" />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 4 }">
+          <el-form-item label="工艺路线名称:">
+            <el-input clearable v-model="where.name" placeholder="请输入" />
+          </el-form-item>
+        </el-col>
+        <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 4 }">
+          <el-form-item label="生产版本:">
+            <el-select v-model="where.produceVersionId" filterable placeholder="请选择" :style="{ width: '100%' }">
+                <el-option v-for="item in versionList" :key="item.code" :label="item.code + '-' + item.name"
+                  :value="item.id">
+                </el-option>
+              </el-select>
+          </el-form-item>
+        </el-col>
+
+  
+        <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+          <el-form-item label-width="20px">
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              class="ele-btn-icon"
+              @click="search"
+            >
+              查询
+            </el-button>
+            <el-button @click="reset">重置</el-button>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+  </template>
+  
+  <script>
+  import { versionPage } from '@/api/saleOrder';
+    export default {
+      data() {
+        // 默认表单数据
+        const defaultWhere = {
+          code: '',
+          name: '',
+          produceVersionId: ''
+        };
+        return {
+          // 表单数据
+          where: { ...defaultWhere },
+          statusList: [
+            { label: '草稿', value: -1 },
+            { label: '失效', value: 0 },
+            { label: '生效', value: 1 }
+          ],
+  
+          versionList: [],
+        };
+      },
+  
+      created() {
+        this.getVersionList()
+      },
+      computed: {
+        // 是否开启响应式布局
+        styleResponsive() {
+          return this.$store.state.theme.styleResponsive;
+        }
+      },
+      methods: {
+        /* 搜索 */
+        search() {
+          this.$emit('search', this.where);
+        },
+        /*  重置 */
+        reset() {
+          this.where = { ...this.defaultWhere }
+          this.search();
+        },
+  
+        async getVersionList() {
+        const res = await versionPage({
+          pageNum: 1,
+          size: -1
+        });
+  
+        this.versionList = res.list;
+      },
+      }
+    };
+  </script>

+ 67 - 20
src/views/contractManage/contractBook/components/addDialog.vue

@@ -18,14 +18,28 @@
             prop="type"
             style="margin-bottom: 22px"
           >
-            <DictSelection
+            <!-- <DictSelection
               dictName="合同类型"
               clearable
               v-model="form.type"
               @itemChange="dictChange"
               :disabled="create"
             >
-            </DictSelection>
+            </DictSelection> -->
+            <el-select
+              v-model="form.type"
+              placeholder="请选择"
+              style="width: 100%"
+              @change="dictChange"
+            >
+              <el-option
+                v-for="item in contractBookTypeList"
+                :key="item.code"
+                :label="item.name"
+                :value="item.code"
+              >
+              </el-option>
+            </el-select>
           </el-form-item>
           <el-form-item
             label="核价单"
@@ -90,16 +104,30 @@
             prop="categoryId"
             style="margin-bottom: 22px; width: 340px"
           >
-            <ele-tree-select
+            <!-- <ele-tree-select
               :data="categoryTreeList"
               v-model="form.categoryId"
               valueKey="id"
               labelKey="name"
-              @change="treeChange"
+       
               placeholder="请选择"
               default-expand-all
-            />
+            /> -->
+            <el-select
+              v-model="form.categoryId"
+              placeholder="请选择"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in categoryList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
           </el-form-item>
+
           <el-form-item
             label="签订日期"
             prop="contractStartDate"
@@ -503,8 +531,8 @@
         partbLinkName: '',
         partbName: '',
         partbTel: '',
-        settlementModeName:"",
-        settlementMode:"",
+        settlementModeName: '',
+        settlementMode: '',
         sourceId: '',
         sourceType: '',
         totalPrice: null,
@@ -520,6 +548,9 @@
           { id: 1, name: '固定' },
           { id: 2, name: '分期' }
         ],
+        contractBookTypeList: [],
+        categoryList: [],
+
         linkNameOptions: [],
         acceptUnpackoptions,
         visible: false,
@@ -532,7 +563,6 @@
         // removeLinkList: [],
         tableBankData: [],
         tableLinkData: [],
-
         rules: {
           type: [
             { required: true, message: '请选择合同类型', trigger: 'change' }
@@ -540,7 +570,7 @@
           settlementMode: [
             { required: true, message: '请选择合结算方式', trigger: 'change' }
           ],
-  
+
           categoryId: [
             { required: true, message: '请选择合同分类', trigger: 'change' }
           ],
@@ -675,6 +705,7 @@
         if (data) {
           this.$nextTick(() => {
             let { contractVO } = data;
+            this.dictChange(contractVO.type, 'init');
             this.form = contractVO;
             this.$refs.inventoryTable &&
               this.$refs.inventoryTable.putTableValue(data);
@@ -683,7 +714,7 @@
                 data.receiptPaymentList
               );
             this.getLinkInfo(
-              data.type == '2' ? contractVO.partbId : contractVO.partaId
+              contractVO.type == '2' ? contractVO.partbId : contractVO.partaId
             );
           });
         }
@@ -706,11 +737,17 @@
         }
       },
       //选择合同类型
-      dictChange(val) {
+      dictChange(val, type) {
+        this.categoryList = copyObj(
+          this.contractBookTypeList.find((item) => item.code == val).children
+        );
+        if (type == 'init') {
+          return;
+        }
         this.form = Object.assign({}, this.form, {
           typeName: val.dictValue,
-          contractName:'',
-          sourceCode:"",
+          contractName: '',
+          sourceCode: '',
           partaAddress: '',
           partaEmail: '',
           partaFax: '',
@@ -733,6 +770,7 @@
           categoryId: ''
         });
         this.getEnterprise();
+        this.changePersonel();
       },
       getEnterprise(type) {
         let key = this.form.type == '1' || !this.form.type ? 'partb' : 'parta';
@@ -765,11 +803,11 @@
         }
       },
       //选择合同分类
-      treeChange(val) {
-        //这里eladmin组件有bug,要手动验证下
-        this.$set(this.form, 'categoryId', val);
-        this.$refs.form.validateField('categoryId');
-      },
+      // treeChange(val) {
+      //   //这里eladmin组件有bug,要手动验证下
+      //   this.$set(this.form, 'categoryId', val);
+      //   this.$refs.form.validateField('categoryId');
+      // },
       //选择下拉框
       onchangeLink(selectedOptions) {
         if (this.form.type == '2') {
@@ -811,6 +849,10 @@
 
       //选择乙方人和采购合同下的甲方人回调
       changePersonel(obj, index, title) {
+        if (!obj) {
+          obj = this.$store.getters.user.info;
+          obj.id = obj.userId;
+        }
         if (this.form.type == '2') {
           this.$set(this.form, 'partaLinkId', obj.id);
           this.$set(this.form, 'partaLinkName', obj.name);
@@ -860,8 +902,13 @@
         this.row = row;
         this.visible = true;
         this.create = create;
+        this.contractBookTypeList = copyObj(this.categoryTreeList[0].children);
+
         if (type == 'add') {
+          let userInfo = this.$store.getters.user.info;
           this.isUpdate = false;
+          userInfo.id = userInfo.userId;
+          this.changePersonel();
           if (create) {
             this.create = create;
             //核价单生成的合同
@@ -892,7 +939,7 @@
       salesmanChange(val, info) {
         this.otherForm.salesmanName = info.name;
       },
-  
+
       ifChiefChange(value, idx) {
         if (value === 1) {
           this.tableLinkData.forEach((e) => (e.ifChief = 0));
@@ -1027,7 +1074,7 @@
       },
 
       changeInquiryList({ data, sourceCode }) {
-        console.log(data,'data')
+        console.log(data, 'data');
         this.setValue(data);
         this.$set(this.form, 'sourceCode', sourceCode);
       },

+ 50 - 8
src/views/contractManage/contractBook/components/inventoryTable.vue

@@ -398,6 +398,22 @@
           ></el-input>
         </el-form-item>
       </template>
+      <template v-slot:technologyRouteName="scope">
+        <el-form-item
+          :prop="'datasource.' + scope.$index + '.technologyRouteName'"
+          :rules="{
+            required: false,
+            message: '请选择',
+            trigger: 'change'
+          }"
+        >
+          <el-input
+            v-model="scope.row.technologyRouteName"
+            placeholder="请选择"
+            @click.native="openVersion(scope.$index)"
+          ></el-input>
+        </el-form-item>
+      </template>
 
       <!-- 操作列 -->
       <template v-slot:action="{ row }">
@@ -420,6 +436,10 @@
       @changeParent="changeParent"
     ></product-list>
     <head-list ref="headRef" @changeParent="changeAnswer"></head-list>
+    <ProductionVersion
+      ref="versionRefs"
+      @changeProduct="changeProduct"
+    ></ProductionVersion>
   </el-form>
 </template>
 <script>
@@ -428,6 +448,7 @@
   import dictMixins from '@/mixins/dictMixins';
   import fileUpload from '@/components/upload/fileUpload';
   import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
+  import ProductionVersion from '@/components/ProductionVersion2/index.vue';
   const dayjs = require('dayjs');
 
   export default {
@@ -435,7 +456,8 @@
     components: {
       productList,
       fileUpload,
-      headList
+      headList,
+      ProductionVersion
     },
     props: {
       pageName: {
@@ -648,6 +670,14 @@
             label: '技术图纸',
             slot: 'technicalDrawings'
           },
+          {
+            width: 240,
+            prop: 'technologyRouteName',
+            label: '工艺路线',
+            slot: 'technologyRouteName',
+            show: this.contractBookType == 1 ? true : false
+
+          },
           {
             width: 240,
             prop: 'industryArtFiles',
@@ -686,19 +716,31 @@
     },
     watch: {
       contractBookType(n) {
-        this.columns.forEach(item=>{
-          if(item.label=='生产交付交期'){
-            item.show=n==1?true:false
+        this.columns.forEach((item) => {
+          if (item.label == '生产交付交期'||item.label == '工艺路线') {
+            item.show = n == 1 ? true : false;
           }
-          if(item.prop=='customerExpectDeliveryDeadline'){
-            item.label=n==1?'客户期望交期':'交付日期'
+          if (item.prop == 'customerExpectDeliveryDeadline') {
+            item.label = n == 1 ? '客户期望交期' : '交付日期';
           }
-        })
-        this.$refs.table.reRenderTable()
+        });
+        this.$refs.table.reRenderTable();
       }
     },
 
     methods: {
+      openVersion(index) {
+        this.$refs.versionRefs.open(index);
+      },
+      //工艺路线
+      changeProduct(data, index) {
+        this.$set(
+          this.form.datasource[index],
+          'technologyRouteName',
+          data.name
+        );
+        this.$set(this.form.datasource[index], 'technologyRouteId', data.id);
+      },
       setDeliveryDays(row, index, type, isAll) {
         if (isAll) {
           this.form.datasource.forEach((item, i) => {

+ 8 - 0
src/views/contractManage/contractBook/components/inventoryTabledetail.vue

@@ -276,6 +276,14 @@
             label: '技术图纸',
             slot: 'technicalDrawings'
           },
+          {
+            width: 240,
+            prop: 'technologyRouteName',
+            label: '工艺路线',
+            slot: 'technologyRouteName',
+            show: this.contractBookType == 1 ? true : false
+
+          },
           {
             width: 240,
             prop: 'industryArtFiles',

+ 12 - 4
src/views/purchasingManage/inquiryManage/components/addDialog.vue

@@ -222,7 +222,7 @@
         chooseWinner(this.form);
       },
       //获取询价详情
-      async getDetailData(id) {
+      async getDetailData(id, type) {
         this.businessId = id;
         this.loading = true;
         let data = await getpurchaseinquiry(id);
@@ -230,8 +230,13 @@
         if (data) {
           this.form = data;
           this.supplierList = data.supplierList;
-          this.getplanData(data.planId);
-          console.log(this.form, 'this.form');
+          this.$nextTick(() => {
+            this.$refs.inventoryTable &&
+              this.$refs.inventoryTable.putTableValue(data.detailList);
+          });
+          if (type == 'init') {
+            this.getplanData(data.planId, type);
+          }
           // this.$nextTick(() => {
 
           // });
@@ -250,7 +255,6 @@
                 item.arrivalBatch[item.arrivalBatch.length - 1].arriveDate;
             }
           });
-          this.list = data.detailList;
           this.$set(this.form, 'acceptUnpack', data.acceptUnpack);
           this.form.planId = data.id;
           this.form.planCode = data.planCode;
@@ -262,6 +266,10 @@
               );
             });
           }
+          if (type == 'init') {
+            return;
+          }
+          this.list = data.detailList;
           this.$nextTick(() => {
             this.$refs.inventoryTable &&
               this.$refs.inventoryTable.putTableValue(data.detailList);

+ 2 - 2
src/views/purchasingManage/inquiryManage/components/detailDialog.vue

@@ -213,9 +213,9 @@
           // },
           {
             width: 170,
-            prop: 'receiveDate',
+            prop: 'expectReceiveDate',
             label: '到货日期',
-            slot: 'receiveDate'
+            slot: 'expectReceiveDate'
           },
           {
             width: 140,

+ 6 - 1
src/views/saleManage/quotation/components/addDialog.vue

@@ -519,7 +519,8 @@
         const data = await getTableList({
           pageNum: 1,
           size: 30,
-          contactName: name
+          contactName: name,
+          approvalStatus:2
         });
         console.log(data, '3333');
         this.businessList = data.list;
@@ -579,12 +580,16 @@
           await this.getEnterprisePage();
         }
         if (type == 'add') {
+          let userInfo=this.$store.getters.user.info
           this.isUpdate = false;
+          userInfo.id=userInfo.userId
+          this.changePersonel(userInfo)
           if (this.enterprisePage.length > 0) {
             this.form.quoteName = this.enterprisePage[0].name;
             // this.form.quoteTel = this.enterprisePage[0].tel;
             this.form.quoteFax = this.enterprisePage[0].fax;
             this.form.quoteAddress = this.enterprisePage[0].address;
+            
           }
           if (row.id) {
             this.form.opportunityId = row.id;

+ 22 - 9
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -78,6 +78,16 @@
             />
           </el-form-item>
           <el-form-item
+            label="合同编号"
+            prop="contractNumber"
+            style="margin-bottom: 22px"
+          >
+            <el-input
+              disabled
+              v-model="form.contractNumber"
+            />
+          </el-form-item>
+          <!-- <el-form-item
             label="交货日期"
             prop="deliveryDate"
             style="margin-bottom: 22px"
@@ -88,7 +98,7 @@
               placeholder="选择日期"
             >
             </el-date-picker>
-          </el-form-item>
+          </el-form-item> -->
           <el-form-item label="结算方式" prop="settlementMode">
             <DictSelection
               dictName="结算方式"
@@ -388,7 +398,7 @@
         contractId: '',
         orderFiles: [],
         contractName: '',
-        deliveryDate: '',
+        // deliveryDate: '',
         payAmount: '',
         projectName: '',
         projectId: '',
@@ -436,9 +446,9 @@
         groupTreeData: [],
         groupData: [],
         rules: {
-          deliveryDate: [
-            { required: true, message: '请选择交货日期', trigger: 'change' }
-          ],
+          // deliveryDate: [
+          //   { required: true, message: '请选择交货日期', trigger: 'change' }
+          // ],
           settlementMode: [
             { required: true, message: '请选择结算方式', trigger: 'change' }
           ],
@@ -608,7 +618,9 @@
         this.loading = false;
         if (data) {
           this.$nextTick(() => {
+            data.saleType=+data.saleType
             this.form = data;
+            console.log(this.form)
             this.$refs.inventoryTable &&
               this.$refs.inventoryTable.putTableValue(data);
             this.getLinkInfo(data.partaId);
@@ -677,7 +689,8 @@
         this.form = Object.assign({}, this.form, {
           contractId: obj.id,
           contractName: obj.contractName,
-          contractNo: obj.contractNo
+          contractNo: obj.contractNo,
+          contractNumber:obj.contractNumber
         });
         this.getDetailData(obj.id);
         this.$store.commit('order/setContractId', obj.id);
@@ -700,16 +713,16 @@
           projectName,
           saleType,
           saleTypeName,
-          deliveryDate,
+          // deliveryDate,
           orderFiles,
           remark
         } = this.form;
         this.form = Object.assign({}, copyObj(this.formDef), {
           id,
           projectName,
-          saleType,
+          saleType:+saleType,
           saleTypeName,
-          deliveryDate,
+          // deliveryDate,
           orderFiles,
           remark
         });

+ 9 - 2
src/views/saleManage/saleOrder/components/detailDialog.vue

@@ -42,6 +42,13 @@
             >
               {{ form.contractName }}
             </el-form-item>
+            <el-form-item
+              label="合同编号:"
+              prop="contractNumber"
+              style="margin-bottom: 16px"
+            >
+              {{ form.contractNumber }}
+            </el-form-item>
             <el-form-item
               label="结算方式:"
               prop="settlementModeName"
@@ -81,13 +88,13 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item
+            <!-- <el-form-item
               label="交货日期:"
               prop="deliveryDate"
               style="margin-bottom: 16px"
             >
               {{ form.deliveryDate }}
-            </el-form-item>
+            </el-form-item> -->
 
             <el-form-item
               label="项目名称:"

+ 7 - 0
src/views/saleManage/saleOrder/index.vue

@@ -236,6 +236,13 @@
             showOverflowTooltip: true,
             minWidth: 200
           },
+          {
+            prop: 'contractNumber',
+            label: '合同编号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
           {
             prop: 'deliveryDate',
             label: '交货日期',