Ver código fonte

【新增】计划单

howie 2 anos atrás
pai
commit
f351c7665e

+ 1 - 1
src/views/supply/engin/components/commerce_detail.vue

@@ -378,7 +378,7 @@
           >
           <!-- <el-button type="primary" @click="openDirectDialog" v-if="!isDealer">提前开票</el-button> -->
 
-          <template v-if="detailData.isPlanOrder">
+          <template v-if="detailData.isPlanOrder === 'true'">
             <el-button
               v-if="!isDealer"
               type="primary"

+ 272 - 106
src/views/supply/engin/components/commerce_return.vue

@@ -78,7 +78,7 @@
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">不扣押金</div>
-          <div class="value">{{ detailData.takeDeposit ? '是':'否' }}</div>
+          <div class="value">{{ detailData.takeDeposit ? "是" : "否" }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">文件编号</div>
@@ -119,10 +119,14 @@
         <el-col :span="24" class="item">
           <div class="label">计划单</div>
           <div class="value">
-            <el-checkbox v-model="detailData.isPlanOrder" disabled :true-label="true" :false-label="false">
-              {{ detailData.isPlanOrder===true?'是':'否' }}
+            <el-checkbox
+              v-model="detailData.isPlanOrder"
+              disabled
+              true-label="true"
+              false-label="false"
+            >
+              {{ detailData.isPlanOrder === "true" ? "是" : "否" }}
             </el-checkbox>
-
           </div>
         </el-col>
       </el-row>
@@ -145,56 +149,194 @@
         :summary-method="$getSummaries"
       >
         <el-table-column align="center" label="序号" type="index" width="50" />
-        <el-table-column align="left" label="引用记录" prop="useRefCount" min-width="100" show-overflow-tooltip />
-        <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
-        <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip />
-        <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip />
-        <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
-        <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip />
-        <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
-        <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
+        <el-table-column
+          align="left"
+          label="引用记录"
+          prop="useRefCount"
+          min-width="100"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="left"
+          label="销售类型"
+          prop="saleTypeName"
+          min-width="100"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="left"
+          label="物料编码"
+          prop="materialNumber"
+          min-width="120"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="left"
+          label="产品编码"
+          prop="materialOldNumber"
+          min-width="120"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="left"
+          label="产品名称"
+          prop="materialName"
+          min-width="160"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="left"
+          label="规格型号"
+          prop="specification"
+          min-width="350"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="left"
+          label="单位"
+          prop="unit"
+          min-width="100"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="right"
+          label="单价"
+          prop="price"
+          min-width="100"
+          show-overflow-tooltip
+        >
           <template slot-scope="scope">
             {{ scope.row.price | numToFixed }}
           </template>
         </el-table-column>
-        <el-table-column align="right" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip />
-        <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip />
-        <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
+        <el-table-column
+          align="right"
+          label="工程登录数量"
+          prop="enginNum"
+          min-width="120"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="right"
+          label="数量"
+          prop="qty"
+          min-width="100"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="right"
+          label="订单金额"
+          prop="totalAmount"
+          min-width="100"
+          show-overflow-tooltip
+        >
           <template slot-scope="scope">
             {{ scope.row.totalAmount | numToFixed }}
           </template>
         </el-table-column>
-        <el-table-column align="left" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip />
-        <el-table-column align="right" label="使用返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
+        <el-table-column
+          align="left"
+          label="返利类型"
+          prop="customerWalletName2"
+          min-width="100"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="right"
+          label="使用返利金额"
+          prop="payRebateAmount"
+          min-width="100"
+          show-overflow-tooltip
+        >
           <template slot-scope="scope">
             {{ scope.row.payRebateAmount | numToFixed }}
           </template>
         </el-table-column>
-        <el-table-column align="right" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip>
+        <el-table-column
+          align="right"
+          label="格力折扣"
+          prop="discAmount"
+          min-width="100"
+          show-overflow-tooltip
+        >
           <template slot-scope="scope">
             {{ scope.row.discAmount | numToFixed }}
           </template>
         </el-table-column>
-        <el-table-column align="left" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip />
-        <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
+        <el-table-column
+          align="left"
+          label="现金钱包"
+          prop="customerWalletName"
+          min-width="100"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="right"
+          label="实付金额"
+          prop="payAmount"
+          min-width="100"
+          show-overflow-tooltip
+        >
           <template slot-scope="scope">
             {{ scope.row.payAmount | numToFixed }}
           </template>
         </el-table-column>
-        <el-table-column align="left" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
+        <el-table-column
+          align="left"
+          label="是否直调"
+          prop="isDirectTransfer"
+          min-width="100"
+          show-overflow-tooltip
+        >
           <template slot-scope="scope">
-            {{ scope.row.isDirectTransfer ? '是' : '否' }}
+            {{ scope.row.isDirectTransfer ? "是" : "否" }}
           </template>
         </el-table-column>
-        <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip />
-        <el-table-column align="right" label="可退数量" prop="refundableQty" min-width="100" show-overflow-tooltip />
-        <el-table-column align="right" label="退订数量" prop="tdQty" min-width="100" show-overflow-tooltip>
+        <el-table-column
+          align="right"
+          label="直调数量"
+          prop="directTransferQty"
+          min-width="100"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="right"
+          label="可退数量"
+          prop="refundableQty"
+          min-width="100"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="right"
+          label="退订数量"
+          prop="tdQty"
+          min-width="100"
+          show-overflow-tooltip
+        >
           <template slot-scope="scope">
-            <el-input v-model="scope.row.tdQty" size="mini" type="number" @blur="hasTdQty" @mousewheel.native.prevent />
+            <el-input
+              v-model="scope.row.tdQty"
+              size="mini"
+              type="number"
+              @blur="hasTdQty"
+              @mousewheel.native.prevent
+            />
           </template>
         </el-table-column>
-        <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
-        <el-table-column align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip />
+        <el-table-column
+          align="left"
+          label="备注"
+          prop="remark"
+          min-width="160"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          align="left"
+          label="税率"
+          prop="tax"
+          min-width="100"
+          show-overflow-tooltip
+        />
       </el-table>
     </div>
 
@@ -213,142 +355,166 @@
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">退订说明</div>
-          <div class="value"><el-input v-model="returnForm.remark" placeholder="请输入退订说明" /></div>
+          <div class="value">
+            <el-input
+              v-model="returnForm.remark"
+              placeholder="请输入退订说明"
+            />
+          </div>
         </el-col>
       </el-row>
     </div>
 
     <div class="page-footer">
       <div class="footer">
-        <el-button type="primary" @click="clickSubmitForm()">确定退订</el-button>
-        <el-popconfirm title="确定关闭吗?" style="margin-left: 10px;" @onConfirm="goBack">
+        <el-button type="primary" @click="clickSubmitForm()"
+          >确定退订</el-button
+        >
+        <el-popconfirm
+          title="确定关闭吗?"
+          style="margin-left: 10px"
+          @onConfirm="goBack"
+        >
           <el-button slot="reference">返回列表</el-button>
         </el-popconfirm>
       </div>
     </div>
-
   </div>
 </template>
 
 <script>
-import { getOrderDetail, returnCom } from '@/api/supply/engin'
+import { getOrderDetail, returnCom } from "@/api/supply/engin";
 
 export default {
-  name: 'CommerceReturn',
-  componentName: 'CommerceReturn',
+  name: "CommerceReturn",
+  componentName: "CommerceReturn",
   filters: {
     statusFilter(val) {
       const statusList = [
-        { label: '已保存', value: 'SAVE' },
-        { label: '待审核', value: 'WAIT' },
-        { label: '审核通过', value: 'OK' },
+        { label: "已保存", value: "SAVE" },
+        { label: "待审核", value: "WAIT" },
+        { label: "审核通过", value: "OK" },
         // { label: '审核驳回', value: 'FAIL' },,
-        { label: '已关闭', value: 'CLOSE' }
-      ]
-      const obj = statusList.find(o => o.value == val)
-      return obj ? obj.label : ''
-    }
+        { label: "已关闭", value: "CLOSE" },
+      ];
+      const obj = statusList.find((o) => o.value == val);
+      return obj ? obj.label : "";
+    },
   },
-  props: ['listItem'],
+  props: ["listItem"],
   data() {
     return {
-      userName: JSON.parse(localStorage.getItem('supply_user')).nickName,
+      userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
       detailData: {},
 
       formLoading: false,
       returnForm: {
-        remark: ''
-      }
-    }
+        remark: "",
+      },
+    };
   },
 
   created() {
-    this.getDetail()
+    this.getDetail();
   },
 
   methods: {
     getDate() {
-      var date = new Date()
-      var seperator1 = '-'
-      var year = date.getFullYear()
-      var month = date.getMonth() + 1
-      var strDate = date.getDate()
+      var date = new Date();
+      var seperator1 = "-";
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var strDate = date.getDate();
       if (month >= 1 && month <= 9) {
-        month = '0' + month
+        month = "0" + month;
       }
       if (strDate >= 0 && strDate <= 9) {
-        strDate = '0' + strDate
+        strDate = "0" + strDate;
       }
-      var currentdate = year + seperator1 + month + seperator1 + strDate
-      return currentdate
+      var currentdate = year + seperator1 + month + seperator1 + strDate;
+      return currentdate;
     },
 
     // 返回列表
     goBack() {
-      this.$emit('backListFormDetail')
+      this.$emit("backListFormDetail");
     },
     hasTdQty(row) {
       if (row.tdQty < 0) {
-        row.tdQty = 0
-        this.$errorMsg('不能填负数')
+        row.tdQty = 0;
+        this.$errorMsg("不能填负数");
       }
     },
     // 获取详情
     getDetail() {
-      getOrderDetail({ id: this.listItem.parentId }).then(res => {
+      getOrderDetail({ id: this.listItem.parentId }).then((res) => {
         if (res.data.items) {
-          res.data.items.forEach(item => {
-            item.number = (item.qty * 100 - item.retiredQty * 100) / 100
-            item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'refundableQty', 'tdQty']
-            item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount']
-          })
+          res.data.items.forEach((item) => {
+            item.number = (item.qty * 100 - item.retiredQty * 100) / 100;
+            item.sums1 = [
+              "number",
+              "directTransferQty",
+              "qty",
+              "enginNum",
+              "refundableQty",
+              "tdQty",
+            ];
+            item.sums2 = [
+              "totalAmount",
+              "payAmount",
+              "price",
+              "payRebateAmount",
+              "discAmount",
+            ];
+          });
         }
-        this.detailData = res.data
-      })
+        this.detailData = res.data;
+      });
     },
 
     // 退订
     clickSubmitForm(val) {
-      this.$confirm('此操作将退订订单, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        const params = {
-          enginOrderId: this.detailData.enginOrderId,
-          items: this.detailData.items,
-          refundNote: this.returnForm.remark,
-          refEnginRecordNo: this.detailData.refEnginRecordNo
-        }
-        returnCom(params).then(res => {
-          this.$successMsg()
-          this.goBack()
-          this.$parent.getList()
+      this.$confirm("此操作将退订订单, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          const params = {
+            enginOrderId: this.detailData.enginOrderId,
+            items: this.detailData.items,
+            refundNote: this.returnForm.remark,
+            refEnginRecordNo: this.detailData.refEnginRecordNo,
+          };
+          returnCom(params).then((res) => {
+            this.$successMsg();
+            this.goBack();
+            this.$parent.getList();
+          });
         })
-      }).catch(() => {})
-    }
-
-  }
-}
+        .catch(() => {});
+    },
+  },
+};
 </script>
 
 <style scoped lang="scss">
-  .detail-container {
-    width: 100%;
-    height: 100%;
-  }
-  .main-title {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    margin-top: 20px;
-    height: 60px;
-    border-bottom: 1px solid #DCDFE6;
-    margin-bottom: 20px;
-    .title {
-      font-size: 16px;
-      font-weight: 600;
-      padding-left: 10px;
-    }
+.detail-container {
+  width: 100%;
+  height: 100%;
+}
+.main-title {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-top: 20px;
+  height: 60px;
+  border-bottom: 1px solid #dcdfe6;
+  margin-bottom: 20px;
+  .title {
+    font-size: 16px;
+    font-weight: 600;
+    padding-left: 10px;
   }
+}
 </style>

+ 3 - 6
src/views/supply/engin/components/engin_detail.vue

@@ -247,12 +247,9 @@
           <el-col :span="8" class="item">
             <div class="label">是否计划单</div>
             <div class="value">
-              <el-radio-group
-                v-model="detailData.examineForm.isPlanOrder"
-                :disabled="true"
-              >
-                <el-radio label="true">是</el-radio>
-                <el-radio label="false">否</el-radio>
+              <el-radio-group v-model="detailData.isPlanOrder" disabled>
+                <el-radio :label="true">是</el-radio>
+                <el-radio :label="false">否</el-radio>
               </el-radio-group>
             </div>
           </el-col>

+ 2 - 2
src/views/supply/engin/components/engin_examine.vue

@@ -377,8 +377,8 @@
               v-model="examineForm.isPlanOrder"
               :disabled="websitNumber === '广州'"
             >
-              <el-radio label="true">是</el-radio>
-              <el-radio label="false">否</el-radio>
+              <el-radio :label="true">是</el-radio>
+              <el-radio :label="false">否</el-radio>
             </el-radio-group>
           </div>
         </el-col>