695593266@qq.com hace 2 meses
padre
commit
85999c1020
Se han modificado 2 ficheros con 48 adiciones y 14 borrados
  1. 46 13
      src/views/saleOrder/components/create-order.vue
  2. 2 1
      src/views/saleOrder/index.vue

+ 46 - 13
src/views/saleOrder/components/create-order.vue

@@ -27,7 +27,11 @@
           </el-col>
           <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
             <el-form-item label="订单类型:" prop="orderType">
-              <el-select v-model="form.orderType" style="width: 100%">
+              <el-select
+                v-model="form.orderType"
+                style="width: 100%"
+                :disabled="isOrderSource"
+              >
                 <el-option
                   v-for="item of orderTypeList"
                   :key="item.id"
@@ -43,6 +47,7 @@
                 dictName="订单类型"
                 clearable
                 v-model="form.saleType"
+                :disabled="isOrderSource"
               >
               </DictSelection>
             </el-form-item>
@@ -53,6 +58,7 @@
                 dictName="按单按库"
                 clearable
                 v-model="form.orderLibraryType"
+                :disabled="isOrderSource"
               >
               </DictSelection>
             </el-form-item>
@@ -62,13 +68,18 @@
               <el-input
                 clearable
                 v-model="form.customerName"
-                :disabled="form.saleType == 3"
-                style="width: calc(100% - 70px)"
+                :disabled="form.saleType == 3 || isOrderSource"
+                :style="
+                  isOrderSource
+                    ? { width: '100%' }
+                    : { width: 'calc(100% - 70px)' }
+                "
               />
               <!-- <el-button style="margin-left: 3px;" size="small" type="primary" @click.native="$refs.contactDialogRef.open()"
               >选择
             </el-button> -->
               <contactDialog
+                v-if="!isOrderSource"
                 style="margin-left: 3px"
                 @changeParent="contactDialogSuccess"
               ></contactDialog>
@@ -80,7 +91,7 @@
               <el-input
                 clearable
                 v-model="form.simpleName"
-                :disabled="form.saleType == 3"
+                :disabled="form.saleType == 3 || isOrderSource"
               />
             </el-form-item>
           </el-col>
@@ -90,7 +101,7 @@
               <el-input
                 clearable
                 v-model="form.serialNo"
-                :disabled="form.saleType == 3"
+                :disabled="form.saleType == 3 || isOrderSource"
               />
             </el-form-item>
           </el-col>
@@ -100,12 +111,14 @@
               <el-input
                 clearable
                 v-model="form.salesman"
+                :disabled="isOrderSource"
                 style="width: calc(100% - 70px)"
               />
               <el-button
                 style="margin-left: 3px"
                 type="primary"
                 size="small"
+                :disabled="isOrderSource"
                 @click="selectPersonnel"
                 >选择</el-button
               >
@@ -121,6 +134,7 @@
                 type="date"
                 placeholder="选择日期"
                 value-format="yyyy-MM-dd"
+                :disabled="isOrderSource"
               >
               </el-date-picker>
             </el-form-item>
@@ -135,7 +149,11 @@
           </el-col> -->
           <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
             <el-form-item label="备注:">
-              <el-input clearable v-model="form.notes" />
+              <el-input
+                clearable
+                v-model="form.notes"
+                :disabled="isOrderSource"
+              />
             </el-form-item>
           </el-col>
           <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
@@ -144,6 +162,7 @@
                 dictName="紧急程度"
                 clearable
                 v-model="form.deliveryRequirements"
+                :disabled="isOrderSource"
               >
               </DictSelection>
             </el-form-item>
@@ -219,6 +238,7 @@
                   filterable
                   allow-create
                   default-first-option
+                  :disabled="isOrderSource"
                 >
                   <el-option
                     v-for="item in modelList"
@@ -249,6 +269,7 @@
                   filterable
                   allow-create
                   default-first-option
+                  :disabled="isOrderSource"
                 >
                   <el-option
                     v-for="item in colorList"
@@ -277,6 +298,7 @@
                   size="small"
                   v-model="scope.row.productionCodes"
                   placeholder="请输入"
+                  :disabled="isOrderSource"
                 >
                 </el-input>
               </el-form-item>
@@ -324,6 +346,7 @@
                   size="small"
                   v-model="scope.row.batchNo"
                   placeholder="请输入"
+                  :disabled="isOrderSource"
                   @input="
                     (value) =>
                       (scope.row.batchNo = value.replace(/[^a-zA-Z0-9_-]/g, ''))
@@ -360,6 +383,7 @@
                   type="number"
                   style="width: 100%"
                   placeholder="输入数量"
+                  :disabled="isOrderSource"
                   @input="inputNumber(scope.row, scope.$index)"
                 ></el-input>
               </el-form-item>
@@ -386,7 +410,7 @@
                   v-model="scope.row.productType"
                   @change="changeProductType(scope.row, scope.$index)"
                   :key="scope.$index"
-                  :disabled="!isAdd"
+                  :disabled="!isAdd && !isOrderSource"
                 >
                   <el-option
                     v-for="item of scope.row.producedList"
@@ -421,7 +445,7 @@
                 <el-select
                   v-model="scope.row.bomCategoryId"
                   @change="changeBomId(scope.row, scope.$index)"
-                  :disabled="!isAdd"
+                  :disabled="!isAdd && !isOrderSource"
                 >
                   <el-option
                     v-for="item of scope.row.bomVersionList"
@@ -499,7 +523,7 @@
                 <el-input
                   v-model="form.produceRoutingName"
                   style="width: 100%"
-                  readonly
+                  :readonly="!isOrderSource"
                 ></el-input>
               </el-form-item>
             </template>
@@ -553,6 +577,7 @@
                     tableHandleKeyUp(scope.row, scope.$index, $event, 'moCount')
                   "
                   placeholder="请输入"
+                  :disabled="isOrderSource"
                 >
                 </el-input>
               </div>
@@ -580,6 +605,7 @@
                   "
                   v-model="scope.row.blockCount"
                   placeholder="请输入"
+                  :disabled="isOrderSource"
                 ></el-input>
               </div>
             </template>
@@ -601,13 +627,17 @@
               <el-button
                 type="text"
                 @click="handleDeleteItem(scope.$index)"
-                v-if="!scope.row.id"
+                v-if="!scope.row.id && !isOrderSource"
                 >删除</el-button
               >
             </template>
           </el-table-column>
         </el-table>
-        <div class="add-product" @click="addEquipment" v-if="isAdd">
+        <div
+          class="add-product"
+          @click="addEquipment"
+          v-if="isAdd && !isOrderSource"
+        >
           <i class="el-icon-circle-plus-outline"></i>
         </div>
       </el-form>
@@ -761,7 +791,8 @@
         processingRequired: 0, // 生产类型跟BOM 版本是否必填 1:是 0:否
         sourceSalesOrderId: '', // 源销售订单ID
         modelList: [], // 机型数据
-        colorList: [] // 颜色数据
+        colorList: [], // 颜色数据
+        isOrderSource: false // 是否是源销售订单
       };
     },
     watch: {
@@ -880,6 +911,7 @@
       },
       open(row) {
         this.visible = true;
+        this.isOrderSource = row && row.orderSource == 1;
         if (row) {
           this.title = '修改订单';
           this.getDetail(row.code);
@@ -975,6 +1007,7 @@
       },
 
       cancel() {
+        this.isOrderSource = false;
         this.form = {
           salesmanId: '',
           salesman: '',
@@ -1161,7 +1194,7 @@
 
           //contractNum
 
-          if (!v.produceRoutingId&&this.clientEnvironmentId!=4) {
+          if (!v.produceRoutingId && this.clientEnvironmentId != 4) {
             flag = false;
             this.$message.warning('请选择工艺路线');
             break;

+ 2 - 1
src/views/saleOrder/index.vue

@@ -93,6 +93,7 @@
         </template>
 
         <!-- 操作列 -->
+        <!-- v-if="row.orderSource != 1 && activeName == 'first'" -->
         <template v-slot:action="{ row }">
           <template>
             <el-link
@@ -176,7 +177,7 @@
         loading: false,
         activeName: 'first',
         selection: [],
-        tabMixinsInit:false,
+        tabMixinsInit: false,
         columns: [],
         cacheKeyUrl: 'c32a9c7d-aps-saleOrder-index',
         columnsVersion: 1,