Przeglądaj źródła

销售订单 历史记录

yusheng 11 miesięcy temu
rodzic
commit
37d5cb6b9a

+ 17 - 16
src/views/purchasingManage/purchaseOrder/invoice/components/detailDialog.vue

@@ -388,14 +388,15 @@
               }
             },
             {
-            minWidth: 120,
-            prop: 'goodsLevel',
-            label: '物品级别',
-            formatter: (_row, _column, cellValue) => {
-              return levelList.find(item=>item.value==_row.goodsLevel)?.label
+              minWidth: 120,
+              prop: 'goodsLevel',
+              label: '物品级别',
+              formatter: (_row, _column, cellValue) => {
+                return levelList.find((item) => item.value == _row.goodsLevel)
+                  ?.label;
+              },
+              align: 'center'
             },
-            align: 'center'
-          },
             {
               width: 160,
               prop: 'singlePrice',
@@ -450,15 +451,15 @@
                   : '';
               }
             },
-            // {
-            //   width: 80,
-            //   prop: 'deliveryDays',
-            //   label: '交期(天)',
-            //   slot: 'deliveryDays',
-            //   align: 'center',
-            //   show:v!=2,
-
-            // },
+            {
+              prop: 'productionDate',
+              label: '生产日期',
+              slot: 'productionDate',
+              align: 'center',
+              show: v != 2,
+              showOverflowTooltip: true,
+              minWidth: 200
+            },
             {
               width: 160,
               prop: 'deliveryDeadline',

+ 131 - 25
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -23,7 +23,10 @@
           >
             新增
           </el-button>
-          <warehouseAll @success="warehouseAllChange" :disabled="!selection.length"></warehouseAll>
+          <warehouseAll
+            @success="warehouseAllChange"
+            :disabled="!selection.length"
+          ></warehouseAll>
         </div>
       </template>
       <template v-slot:technicalDrawings="{ row, $index }">
@@ -64,10 +67,20 @@
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.batchNo'"
         >
-          <el-input v-model="scope.row.batchNo" type="number"></el-input>
+          <el-input v-model="scope.row.batchNo" v-no-chinese></el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:productionDate="scope">
+        <el-form-item :prop="'datasource.' + scope.$index + '.productionDate'">
+          <el-date-picker
+            style="width: 140px"
+            v-model="scope.row.productionDate"
+            type="date"
+            placeholder="选择日期"
+          >
+          </el-date-picker>
         </el-form-item>
       </template>
-
       <!-- :disabled="!outsourceSendCode"      -->
       <template v-slot:sendTotalWeight="scope">
         <el-form-item
@@ -171,7 +184,53 @@
           >{{ column.label }}</span
         >
       </template>
-
+      <template v-slot:guaranteePeriod="scope">
+        <div class="period">
+          <div class="borderleftnone">
+            <el-form-item
+              style="margin-bottom: 20px"
+              :prop="'datasource.' + scope.$index + '.guaranteePeriod'"
+              :rules="{
+                pattern: numberReg,
+                message: '请输入数字',
+                trigger: 'blur'
+              }"
+            >
+              <el-input
+                v-model="scope.row.guaranteePeriod"
+                @change="
+                  setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
+                "
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </div>
+          <div class="borderrightnone">
+            <DictSelection
+              dictName="质保期单位"
+              clearable
+              v-model="scope.row.guaranteePeriodUnitCode"
+              @change="
+                setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
+              "
+            >
+            </DictSelection>
+          </div>
+        </div>
+      </template>
+      <template v-slot:guaranteePeriodDeadline="scope">
+        <el-form-item
+          :prop="'datasource.' + scope.$index + '.guaranteePeriodDeadline'"
+        >
+          <el-date-picker
+            style="width: 140px"
+            v-model="scope.row.guaranteePeriodDeadline"
+            type="date"
+            placeholder="选择日期"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </template>
       <!-- 操作列 -->
       <template v-slot:action="scope">
         <el-popconfirm
@@ -249,6 +308,7 @@
   import productListMain from '@/BIZComponents/product-list.vue';
   import warehouseAll from '@/BIZComponents/warehouseAll.vue';
   import { levelList } from '@/enum/dict.js';
+  const dayjs = require('dayjs');
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -571,13 +631,14 @@
                 : '';
             }
           },
-          // {
-          //   width: 80,
-          //   prop: 'deliveryDays',
-          //   label: '交期(天)',
-          //   slot: 'deliveryDays',
-          //   align: 'center'
-          // },
+          {
+            prop: 'productionDate',
+            label: '生产日期',
+            slot: 'productionDate',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
           {
             width: 160,
             prop: 'deliveryDeadline',
@@ -586,21 +647,24 @@
             align: 'center'
           },
           {
-            width: 200,
+            width: 250,
             prop: 'guaranteePeriod',
             label: '有效期',
             slot: 'guaranteePeriod',
-            formatter: (_row, _column, cellValue) => {
-              let name = '';
-              if (_row.guaranteePeriod) {
-                name += _row.guaranteePeriod;
-              }
-              if (_row.guaranteePeriodUnitName) {
-                name += _row.guaranteePeriodUnitName;
-              }
-              return name || '';
-            },
             align: 'center'
+
+            //   formatter: (_row, _column, cellValue) => {
+            //     let name = '';
+            //     if (_row.guaranteePeriod) {
+            //       name += _row.guaranteePeriod;
+            //     }
+            //     if (_row.guaranteePeriodUnitName) {
+            //       name += _row.guaranteePeriodUnitName;
+            //     }
+            //     return name || '';
+            //   },
+            //   align: 'center'
+            // },
           },
           {
             width: 160,
@@ -681,7 +745,7 @@
         this.$set(this.form.datasource[index], 'warehouseId', data.id);
       },
       warehouseAllChange(data) {
-        console.log(this.selection,'this.selection')
+        console.log(this.selection, 'this.selection');
         let keyS = this.selection.map((item) => item.key - 1);
         keyS.forEach((key) => {
           this.$set(this.form.datasource[key], 'warehouseName', data.name);
@@ -886,7 +950,46 @@
       getPrice() {
         return [this.allPrice];
       },
-
+      setDeliveryDays(row, index, type) {
+        if (type == 'deliveryDays') {
+          this.$set(
+            this.form.datasource[index],
+            'deliveryDeadline',
+            this.setDay(row.deliveryDays)
+          );
+        }
+        if (type == 'guaranteePeriod') {
+          let guaranteePeriodUnitName = this.guaranteePeriodUnit(
+            row.guaranteePeriodUnitCode
+          );
+          this.$set(
+            this.form.datasource[index],
+            'guaranteePeriodUnitName',
+            guaranteePeriodUnitName
+          );
+          this.$set(
+            this.form.datasource[index],
+            'guaranteePeriodDeadline',
+            guaranteePeriodUnitName != 'second'
+              ? this.setDay(row.guaranteePeriod, guaranteePeriodUnitName)
+              : ''
+          );
+        }
+      },
+      guaranteePeriodUnit(code) {
+        return code == 3
+          ? 'day'
+          : code == 4
+          ? 'month'
+          : code == 5
+          ? 'year'
+          : 'second';
+      },
+      setDay(addDay, dateType = 'day') {
+        return dayjs(this.contractStartDate || new Date())
+          .add(addDay, dateType)
+          .format('YYYY-MM-DD');
+      },
       //修改回显
       async putTableValue(data = [], code) {
         this.$nextTick(() => {
@@ -898,7 +1001,10 @@
             };
           });
           this.form.datasource.forEach((item, index) => {
-            item.key = index+1
+            item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode
+              ? item.guaranteePeriodUnitCode + ''
+              : '';
+            item.key = index + 1;
             this.init(item, index);
             this.getTotalPrice(index);
           });

+ 1 - 1
src/views/saleManage/contact/contactListAdmin.vue

@@ -140,7 +140,7 @@
             </el-link>
             <el-link
               v-if="
-                row.status === 2 &&
+                row.status === 0 &&
                 row.assignStatus !== 1 &&
                 $hasPermission('eom:contact:update')
               "

+ 1 - 1
src/views/saleManage/contact/index.vue

@@ -138,7 +138,7 @@
                   修改
                 </el-link>
                 <el-link
-                  v-if="row.status === 2"
+                  v-if="row.status === 0"
                   type="primary"
                   :underline="false"
                   icon="el-icon-check"

+ 82 - 12
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -19,10 +19,18 @@
       label-width="120px"
       class="el-form-box"
     >
-      <headerTitle title="订单信息"></headerTitle>
+      <headerTitle title="订单信息">
+        <el-button
+          type="primary"
+          size="mini"
+          style="margin-bottom: 5px"
+          @click="orderListShow"
+          v-if="!form.id"
+          >历史记录</el-button
+        >
+      </headerTitle>
       <el-row>
         <el-col :span="12">
- 
           <el-form-item label="销售类型" prop="saleType">
             <DictSelection
               dictName="销售类型"
@@ -134,7 +142,6 @@
               </template>
             </el-input>
           </el-form-item>
-          
         </el-col>
       </el-row>
       <headerTitle title="基本信息" v-if="form.needProduce != 2"></headerTitle>
@@ -418,8 +425,12 @@
       @reload="reload"
       :callBack="callBack"
     ></process-submit-dialog>
-  <bomDialog ref="bomDialogRef" @handleSubmit="bomDialogSuccess"></bomDialog>
-
+    <bomDialog ref="bomDialogRef" @handleSubmit="bomDialogSuccess"></bomDialog>
+    <saleOrderListDialog
+      ref="saleOrderListDialogRef"
+      :isMy="true"
+      @changeParent="saleOrderListDialogChange"
+    ></saleOrderListDialog>
   </ele-modal>
 </template>
 
@@ -442,7 +453,8 @@
     getSaleOrderDetail,
     UpdateInformation,
     addInformation,
-    submit,getByRepeatBomAttribute
+    submit,
+    getByRepeatBomAttribute
   } from '@/api/saleManage/saleorder';
   import { getcontactlink } from '@/api/saleManage/businessFollow';
   import headList from '@/BIZComponents/user-select/user-select.vue';
@@ -458,7 +470,8 @@
   import { getUserDetail } from '@/api/system/organization/index.js';
   import typeList from './typeList.vue';
   import bomDialog from './bomDialog';
-  
+  import saleOrderListDialog from '@/views/saleManage/saleOrder/invoice/components/orderListDialog.vue';
+
   export default {
     mixins: [dictMixins],
     components: {
@@ -471,7 +484,9 @@
       paymentList,
       inventoryTable,
       parentList,
-      typeList,bomDialog
+      typeList,
+      bomDialog,
+      saleOrderListDialog
     },
     props: {
       contactData: {
@@ -545,7 +560,7 @@
         // 组织机构树形结构数据
         groupTreeData: [],
         groupData: [],
-        tableList:[],
+        tableList: [],
         // rules: {
         //   settlementMode: [
         //     { required: true, message: '请选择结算方式', trigger: 'change' }
@@ -605,7 +620,7 @@
         return this.$store.state.user.info.clientEnvironmentId;
       },
       rules() {
-        let isRequired=this.isRequired
+        let isRequired = this.isRequired;
         return {
           settlementMode: [
             { required: true, message: '请选择结算方式', trigger: 'change' }
@@ -619,7 +634,11 @@
             { required: true, message: '请选择客户名称', trigger: 'change' }
           ],
           partaLinkName: [
-            { required: isRequired, message: '请选择客户联系人', trigger: 'change' }
+            {
+              required: isRequired,
+              message: '请选择客户联系人',
+              trigger: 'change'
+            }
           ],
           acceptUnpack: [
             { required: true, message: '请选择是否接受', trigger: 'change' }
@@ -637,7 +656,11 @@
             { required: true, message: '请输入售出方名称', trigger: 'change' }
           ],
           partbLinkName: [
-            { required: isRequired, message: '请输入售出方联系人', trigger: 'change' }
+            {
+              required: isRequired,
+              message: '请输入售出方联系人',
+              trigger: 'change'
+            }
           ],
           partbTel: [
             {
@@ -812,7 +835,54 @@
         };
         this.$refs.headRef.open(item);
       },
+      orderListShow() {
+        this.$refs.saleOrderListDialogRef.open();
+      },
+      async saleOrderListDialogChange(row) {
+        let data = await getSaleOrderDetail(row.id);
+        [
+          'id',
+          'orderId',
+          'createTime',
+          'createUserId',
+          'createUserName',
+          'createDept',
+          'orderNo',
+          'orderStatus',
+          'outboundStatus',
+          'payStatus',
+          'preOrderNo',
+          'progress',
+          'processInstanceId',
+          'orderBomList'
+        ].forEach((key) => {
+          delete data[key];
+          data.productList.forEach((item) => {
+            if (['id', 'createTime', 'createUserId','orderId'].includes(key)) {
+              delete item[key];
+            }
+          });
+          data.typedetailList.forEach((item) => {
+            if (['id', 'createTime', 'createUserId','orderId'].includes(key)) {
+              delete item[key];
+            }
+          });
+        });
 
+        this.form = data;
+        if (data) {
+          data.saleType = +data.saleType;
+          this.$nextTick(() => {
+            this.$refs.inventoryTable &&
+              this.$refs.inventoryTable.putTableValue(data);
+            this.$refs.typeListRef &&
+              this.$refs.typeListRef.putTableValue(data.typedetailList);
+
+            this.getLinkInfo(data.partaId);
+            this.$store.commit('order/setContractId', data.partaId);
+          });
+        }
+      },
       //选择售出方人回调
       changePersonel(obj) {
         if (!obj) {

+ 63 - 64
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -685,70 +685,69 @@
             slot: 'weightUnit',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
-          // {
-          //   width: 180,
-          //   prop: 'singlePrice',
-          //   label: '单价',
-          //   slot: 'singlePrice',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 160,
-          //   prop: 'taxRate',
-          //   label: '税率',
-          //   formatter: (_row, _column, cellValue) => {
-          //     return _row.taxRate ? _row.taxRate + '%' : '';
-          //   },
-          //   align: 'center'
-          // },
-          // {
-          //   width: 180,
-          //   prop: 'notaxSinglePrice',
-          //   label: '不含税单价',
-          //   slot: 'notaxSinglePrice',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 160,
-          //   prop: 'discountSinglePrice',
-          //   label: '折后单价',
-          //   slot: 'discountSinglePrice',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 120,
-          //   prop: 'totalPrice',
-          //   label: '合计',
-          //   slot: 'totalPrice',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 160,
-          //   prop: 'notaxTotalPrice',
-          //   label: '含税合计',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 120,
-          //   prop: 'discountTotalPrice',
-          //   label: '折后合计',
-          //   slot: 'discountTotalPrice',
-          //   align: 'center'
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
+          {
+            width: 180,
+            prop: 'singlePrice',
+            label: '单价',
+            slot: 'singlePrice',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'taxRate',
+            label: '税率',
+            formatter: (_row, _column, cellValue) => {
+              return _row.taxRate ? _row.taxRate + '%' : '';
+            },
+            align: 'center'
+          },
+          {
+            width: 180,
+            prop: 'notaxSinglePrice',
+            label: '不含税单价',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'discountSinglePrice',
+            label: '折后单价',
+            slot: 'discountSinglePrice',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'totalPrice',
+            label: '合计',
+            slot: 'totalPrice',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'notaxTotalPrice',
+            label: '含税合计',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'discountTotalPrice',
+            label: '折后合计',
+            slot: 'discountTotalPrice',
+            align: 'center'
+          },
           {
             width: 80,
             prop: 'deliveryDays',

+ 57 - 57
src/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue

@@ -246,64 +246,64 @@
             slot: 'weightUnit',
             align: 'center'
           },
-          // {
-          //   width: 160,
-          //   prop: 'pricingWay',
-          //   label: '计价方式',
-          //   slot: 'pricingWay',
-          //   align: 'center',
-          //   formatter: (row, column) => {
-          //     return row.pricingWay == 1
-          //       ? '按数量计费'
-          //       : row.pricingWay == 2
-          //       ? '按重量计费'
-          //       : '';
-          //   }
-          // },
-          // {
-          //   width: 160,
-          //   prop: 'singlePrice',
-          //   label: '单价',
-          //   slot: 'singlePrice',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 160,
-          //   prop: 'taxRate',
-          //   label: '税率',
-          //   formatter: (_row, _column, cellValue) => {
-          //     return _row.taxRate ? _row.taxRate + '%' : '';
-          //   },
-          //   align: 'center'
-          // },
-          // {
-          //   width: 160,
-          //   prop: 'notaxSinglePrice',
-          //   label: '不含税单价',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 160,
-          //   prop: 'discountSinglePrice',
-          //   label: '折后单价',
-          //   slot: 'discountSinglePrice',
-          //   align: 'center'
-          // },
-          // {
-          //   width: 120,
-          //   prop: 'totalPrice',
-          //   label: '合计',
-          //   slot: 'totalPrice',
-          //   align: 'center'
-          // },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
+            }
+          },
+          {
+            width: 160,
+            prop: 'singlePrice',
+            label: '单价',
+            slot: 'singlePrice',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'taxRate',
+            label: '税率',
+            formatter: (_row, _column, cellValue) => {
+              return _row.taxRate ? _row.taxRate + '%' : '';
+            },
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'notaxSinglePrice',
+            label: '不含税单价',
+            align: 'center'
+          },
+          {
+            width: 160,
+            prop: 'discountSinglePrice',
+            label: '折后单价',
+            slot: 'discountSinglePrice',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'totalPrice',
+            label: '合计',
+            slot: 'totalPrice',
+            align: 'center'
+          },
 
-          // {
-          //   width: 120,
-          //   prop: 'discountTotalPrice',
-          //   label: '折后合计',
-          //   slot: 'discountTotalPrice',
-          //   align: 'center'
-          // },
+          {
+            width: 120,
+            prop: 'discountTotalPrice',
+            label: '折后合计',
+            slot: 'discountTotalPrice',
+            align: 'center'
+          },
           ...this.dynamicsColumns,
           {
             width: 120,

+ 13 - 2
src/views/saleManage/saleOrder/invoice/components/orderListDialog.vue

@@ -53,6 +53,7 @@
   import searchTable from '@/views/saleManage/saleOrder/components/searchTable.vue';
   import { getTableList } from '@/api/saleManage/saleorder';
   import AssetTree from '@/components/AssetTree';
+  import { mapGetters } from 'vuex';
 
   export default {
     components: {
@@ -73,6 +74,10 @@
         default: () => {
           return {};
         }
+      },
+      isMy: {
+        type: Boolean,
+        default: false
       }
     },
     data() {
@@ -84,7 +89,9 @@
         isAcc: false
       };
     },
+
     computed: {
+      ...mapGetters(['user']),
       columns() {
         let selection = null;
         if (this.isAll) {
@@ -238,21 +245,25 @@
     methods: {
       open(item, currentIndex, isAcc = false) {
         this.currentIndex = currentIndex;
-
         this.isAcc = isAcc;
         this.visible = true;
       },
 
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
+        let orderStatus=2
         if (this.contactData.id) {
           where['contactId'] = this.contactData.id;
         }
+        if (this.isMy) {
+          where['currentUserId'] = this.user.info.userId;
+          orderStatus=''
+        }
         return getTableList({
           pageNum: page,
           size: limit,
           ...where,
-          orderStatus: 2,
+          orderStatus,
           ...this.searchParams
         });
       },

+ 1 - 1
src/views/saleManage/saleOrder/invoice/components/print-template-by.vue

@@ -257,7 +257,7 @@ export default {
         }
         this.QRvisible = true;
         this.$nextTick(() => {
-          JsBarcode('#print', '1234567822222', {
+          JsBarcode('#print', data.docNo, {
             format: 'CODE39', //选择要使用的条形码类型
             width: 0.8, //设置条之间的宽度
             height: 50, //高度