xiaodai2022 2 vuotta sitten
vanhempi
commit
1f51676df0

+ 20 - 49
src/views/purchaseIn/purchaseDiffOrder/ShowDataTableColumns.js

@@ -2,78 +2,49 @@ export default [
   {
     prop: "cgdNo",
     label: "采购单编号",
+    span: 6
   },
   {
-    prop: "apply_name",
-    label: "申请人"
-  },
-  
-  {
-    prop: "good_code",
-    label: "商品编码",
-  },
-
-  {
-    prop: "good_name",
-    label: "商品名称",
-  },
- 
-  {
-    prop: "wsm_supplier",
-    label: "供应商"
+    prop: "status",
+    label: "状态",
+    _slot_: "status",
+    span: 6
   },
   {
-    prop: "wsm_supplierNo",
-    label: "供应商编码"
+    prop: "apply_name",
+    label: "申请人",
+    span: 6
   },
   {
-    prop: "class_cat",
-    label: "商品分类",
+    prop: "addtime",
+    label: "创建时间",
+    span: 6
   },
   {
-    prop: "good_weight",
-    label: "商品重量",
+    prop: "order_type",
+    label: "采购单类型",
+    _slot_: "order_type",
+    span: 6
   },
-  {
-    prop: "good_num",
-    label: "总采购数量",
-  },
- {
-    prop: "sale_price",
-    label: "采购单价",
-  },
-
   {
     prop: "diff_weight",
     label: "重量工差",
+    span: 6
   },
   {
     prop: "diff_price",
     label: "金额差价",
+    span: 6
   },
   {
     prop: "gold_price",
     label: "实时金价",
+    span: 6
   },
 
-  // {
-  //   prop: "good_price",
-  //   label: "商品单价",
-  // },
 
-  {
-    prop: "status",
-    label: "状态",
-    _slot_: "status",
-  },
-  {
-    prop: "updatetime",
-    label: "更新时间",
-  },
-  {
-    prop: "addtime",
-    label: "物创建时间",
-  },
+
+
 
 
 ]

+ 7 - 6
src/views/purchaseIn/purchaseDiffOrder/columns.js

@@ -4,6 +4,12 @@ export default [
           label: "采购单编号",
           width: "160px",
         },
+        {
+          prop: "status",
+          label: "状态",
+          _slot_: "status",
+          width: "120px",
+        },
         {
           prop: "apply_name",
           label: "申请人",
@@ -34,12 +40,7 @@ export default [
           width: "110px",
         },
 
-        {
-          prop: "status",
-          label: "状态",
-          _slot_: "status",
-          width: "120px",
-        },
+       
         {
           prop: "addtime",
           label: "创建时间",

+ 62 - 62
src/views/purchaseIn/purchaseDiffOrder/detail.vue

@@ -5,39 +5,40 @@
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
       <!-- <p>{{ status }}---{{ powers }}</p> -->
-        <div class="detail-page-title">
+      <!-- <div class="detail-page-title">
         <span>采购工差单编号:</span><span v-if="sitem">{{ sitem.id }}</span>
-      </div>
+      </div> -->
       <!-- <status-bar
         v-if="newTime !== ''"
         :newTime="newTime"
         :options="statusOptions"
         :status="status"
       /> -->
-        <el-tabs v-model="activeTabs" >
+      <el-tabs v-model="activeTabs">
         <el-tab-pane label="业务详情" name="1">
-      <el-collapse v-model="activeNames" style="margin:-18px 0 0 0">
-        <el-collapse-item title="采购工差单详情" name="0">
-          <show-data-table
-            :newTime="newTime"
-            v-if="newTime !== ''"
-            :sitem="sitem"
-            :columns="ShowDataTableColumns"
-          >
-            <template slot="status">
-              <el-tag
-                :size="'mini'"
-                :type="sitem.status == '0' ? 'warning' : ''"
-                v-text="
-                  (
-                    statusOptions.find((item) => item.value == sitem.status) ||
-                    {}
-                  ).label || '--'
-                "
-              ></el-tag>
-            </template>
-          </show-data-table>
-          <!-- <purchase-order-addEdit
+          <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
+            <el-collapse-item title="采购工差单详情" name="0">
+              <show-data-table
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :sitem="sitem"
+                :columns="ShowDataTableColumns"
+              >
+                <template slot="status">
+                  <el-tag
+                    :size="'mini'"
+                    :type="sitem.status == '0' ? 'warning' : ''"
+                    v-text="
+                      (
+                        statusOptions.find(
+                          (item) => item.id === sitem.status
+                        ) || {}
+                      ).label || '--'
+                    "
+                  ></el-tag>
+                </template>
+              </show-data-table>
+              <!-- <purchase-order-addEdit
             style="padding: 0 0 20px 0"
             :newTime="newTime"
             v-if="newTime !== ''"
@@ -45,40 +46,40 @@
             :id="queryId"
             @refresh="initData()"
           /> -->
-        </el-collapse-item>
-        <!-- && status === '3' -->
-        <el-collapse-item
-          title="通知采购部门"
-          name="1"
-          v-if="status === '2' && powers.some((item) => item == '038')"
-        >
-          <div style="height: 50px; padding: 0 0px 20px 0">
-            <el-button
-              type="primary"
-              class="fr"
-              size="mini"
-              @click="statusConfirm('3', '确定我已知晓并同意')"
-              >我已知晓</el-button
+            </el-collapse-item>
+            <!-- && status === '3' -->
+            <el-collapse-item
+              title="通知采购部门"
+              name="1"
+              v-if="status === '2' && powers.some((item) => item == '038')"
             >
-          </div>
-        </el-collapse-item>
-        <el-collapse-item
-          title="通知财务部门"
-          name="2"
-          v-if="status === '3' && powers.some((item) => item == '039')"
-        >
-          <div style="height: 50px; padding: 0 0px 20px 0">
-            <el-button
-              type="primary"
-              class="fr"
-              size="mini"
-              @click="statusConfirm('4', '确定我已知晓并同意')"
-              >我已知晓</el-button
+              <div style="height: 50px; padding: 0 0px 20px 0">
+                <el-button
+                  type="primary"
+                  class="fr"
+                  size="mini"
+                  @click="statusConfirm('3', '确定我已知晓并同意')"
+                  >我已知晓</el-button
+                >
+              </div>
+            </el-collapse-item>
+            <el-collapse-item
+              title="通知财务部门"
+              name="2"
+              v-if="status === '3' && powers.some((item) => item == '039')"
             >
-          </div>
-        </el-collapse-item>
-      </el-collapse>
-          </el-tab-pane>
+              <div style="height: 50px; padding: 0 0px 20px 0">
+                <el-button
+                  type="primary"
+                  class="fr"
+                  size="mini"
+                  @click="statusConfirm('4', '确定我已知晓并同意')"
+                  >我已知晓</el-button
+                >
+              </div>
+            </el-collapse-item>
+          </el-collapse>
+        </el-tab-pane>
         <el-tab-pane label="审批记录" name="2">
           <process-time-line
             v-if="newTime !== ''"
@@ -126,15 +127,14 @@ export default {
   },
   data() {
     return {
-      activeTabs:"1",
+      activeTabs: "1",
       ShowDataTableColumns: ShowDataTableColumns,
       statusOptions: [
-        { value: "2", label: "通知采购部门" },
-        { value: "3", label: "通知财务部门" },
-        { value: "4", label: "工差单审核完成" },
+        { id: "1", label: "待业务部门审核" },
+        { id: "2", label: "工差单审核完成" },
       ],
       finishStatus: "finish",
-      activeNames: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9",],
+      activeNames: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
       sitem: null,
       status: "",
       newTime: "",

+ 27 - 109
src/views/purchaseIn/purchaseOrder/components/work-diff-table.vue

@@ -10,118 +10,34 @@
     >
       <el-table-column
         show-overflow-tooltip
-        prop="orderCode"
-        label="采购单编号"
-        width="150"
+        prop="diff_weight"
+        label="工差克重(g)"
       />
 
       <el-table-column
         show-overflow-tooltip
-        prop="outCode"
-        label="商品分类"
-        width="150"
+        prop="diff_price"
+        label="工差金额"
       />
-      <el-table-column
-        show-overflow-tooltip
-        prop="apply_name"
-        label="商品名称"
-        width="85"
-      />
-
-      <el-table-column
-        show-overflow-tooltip
-        prop="post_name"
-        label="物流公司"
-        width="110"
-      />
-      <el-table-column
-        show-overflow-tooltip
-        prop="post_code"
-        label="物流单号"
-        width="160"
-      />
-      <el-table-column
-        show-overflow-tooltip
-        prop="post_fee"
-        label="预计物流费"
-        width="100"
-      />
-      <el-table-column
-        show-overflow-tooltip
-        prop="status"
-        label="状态"
-        width="80"
-      >
+      <el-table-column show-overflow-tooltip prop="status" label="状态">
         <template slot-scope="scope">
-          状态
-          <!-- {{}} -->
-          <!-- <el-tag
+          <el-tag
             :size="tablebtnSize"
             :type="scope.row.status == '0' ? 'warning' : ''"
             v-text="
-              (statusOptions.find((item) => item.id == scope.row.status) || {})
-                .label || '--'
+              (
+                diffStatusOptions.find((item) => item.id == scope.row.status) ||
+                {}
+              ).label || '--'
             "
-          ></el-tag> -->
+          ></el-tag>
         </template>
       </el-table-column>
 
-      <el-table-column
-        show-overflow-tooltip
-        prop="sendtime"
-        label="发货时间"
-        min-width="170"
-      />
-      <el-table-column
-        show-overflow-tooltip
-        prop="send_num"
-        label="	发货数量"
-        width="80"
-      />
-      <el-table-column
-        show-overflow-tooltip
-        prop="check_num"
-        label="验收数量"
-        width="80"
-      />
-      <el-table-column
-        show-overflow-tooltip
-        prop="addr_info"
-        label="省市区"
-        min-width="170"
-      />
-      <el-table-column
-        show-overflow-tooltip
-        prop="addr"
-        label="收货地址"
-        min-width="170"
-      />
-      <el-table-column
-        show-overflow-tooltip
-        prop="contact"
-        label="联系人"
-        width="80"
-      />
-      <el-table-column
-        show-overflow-tooltip
-        prop="mobile"
-        label="联系电话"
-        width="110"
-      />
-      <el-table-column
-        show-overflow-tooltip
-        prop="wsm_supplier"
-        label="供应商"
-        min-width="220"
-      />
-      <el-table-column
-        show-overflow-tooltip
-        prop="wsm_supplierNo"
-        label="仓库供应商"
-        min-width="170"
-      />
+      <el-table-column show-overflow-tooltip prop="apply_name" label="创建人" />
+      <el-table-column show-overflow-tooltip prop="addtime" label="创建时间" />
 
-      <el-table-column fixed="right" width="80">
+      <el-table-column fixed="right" width="50">
         <template slot="header" slot-scope="scope">
           <span>操作</span>
         </template>
@@ -135,7 +51,11 @@
           >
             <i
               class="el-icon-view tb-icon"
-              @click="openHouseModal(scope.$index)"
+              @click="
+                routeGoto('purchaseDiffOrderDetail', {
+                  id: scope.row.id,
+                })
+              "
             ></i>
           </el-tooltip>
         </template>
@@ -193,6 +113,10 @@ export default {
       stock_code: "",
       tableData: [],
       loading: false,
+      diffStatusOptions: [
+        { id: "1", label: "待业务部门审核" },
+        { id: "2", label: "工差单审核完成" },
+      ],
       queryId: "",
       status: "",
       showModel: null,
@@ -223,17 +147,11 @@ export default {
     async resetForm() {
       // 重置
       await this.$nextTick(() => {
-     
-        // console.log(this.$refs.addrForm);
-        // if (this.$refs.addrForm) {
-        //   this.$refs.addrForm.resetFields();
-        //   this.$refs.addrForm.clearValidate();
+        this.tableData = [];
         const { purcheasediff } = this.sitem;
-           console.log(purcheasediff);
-        if (purcheasediff && purcheasediff.length > 0) {
-          this.tableData = JSON.parse(JSON.stringify(purcheasediff));
-        } else {
-          this.tableData = [];
+        console.log(purcheasediff);
+        if (purcheasediff) {
+          this.tableData.push(purcheasediff);
         }
       });
     },

+ 2 - 2
src/views/purchaseIn/purchaseOrder/detail.vue

@@ -4,7 +4,7 @@
       style="width: 100%"
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      <p>{{ status }}---{{ powers }}</p>
+      <!-- <p>{{ status }}---{{ powers }}</p> -->
       <div class="detail-page-title">
         <span>采购单编号:</span
         ><span
@@ -163,7 +163,7 @@
             <el-collapse-item
               title="工差单"
               name="4"
-              v-if="sitem&&sitem.order_type!=='1'&&sitem.status !== '0' && sitem.status !== '1'&&sitem.purcheasediff"
+              v-if="sitem&&sitem.order_type!=='1'&&sitem.status !== '0' &&sitem.purcheasediff"
             >
               <work-diff-table
                 :newTime="newTime"

+ 23 - 2
src/views/purchaseIn/wsmInOrder/components/wsm-in-order-error-model.vue

@@ -135,6 +135,23 @@ export default {
   props: ["showModel", "id", "sitem", "allnum"],
   mixins: [resToken],
   data() {
+    const validate_num_0 = (rule, value, callback) => {
+      const { required } = rule;
+      if (required && value === "") {
+        callback(new Error("不能为空!"));
+      } else if (
+        required &&
+        (value === "0" ||
+          value === "0." ||
+          value === "0.0" ||
+          value === "0.00" ||
+          value === "0.000")
+      ) {
+        callback(new Error("不能为零!"));
+      } else {
+        callback();
+      }
+    };
     return {
       showModelThis: this.showModel,
       loading: false,
@@ -154,7 +171,7 @@ export default {
         num: [
           {
             required: true,
-            // validator: validatename,
+            validator: validate_num_0,
             trigger: "blur",
           },
         ],
@@ -248,7 +265,7 @@ export default {
           const { num, error_code, error_msg, error_img, remark, index } =
             this.sitem;
           this.ruleForm = {
-            num: num || "",
+            num: num || "0",
             index: this.id,
             error_code: error_code || "",
             error_msg: error_msg || "",
@@ -262,6 +279,10 @@ export default {
       await this.$refs.ruleForm.validate(async (valid) => {
         if (valid) {
           const item = JSON.parse(JSON.stringify(this.ruleForm));
+          if (item.num + "" === "0") {
+            this.$message.warning("异常数量不能为0!");
+            return;
+          }
           this.showModelThis = false;
           this.$emit("refresh", item);
         } else {

+ 3 - 1
src/views/purchaseIn/wsmInOrder/components/wsm-in-order-record-form.vue

@@ -25,7 +25,9 @@
               :values="ruleForm.wsm_num"
               :placeholder="'正常数量'"
               :min="0"
-              :disabled="false"
+              :disabled="
+                !(status === '1' && powers.some((item) => item == '029'))
+              "
               :max="ruleForm.send_num"
               :position="'right'"
               :precision="0"

+ 1 - 0
src/views/purchaseIn/wsmInOrder/components/wsm-in-order-return-form.vue

@@ -192,6 +192,7 @@ export default {
         if (valid) {
           this.loading = true;
           let item = JSON.parse(JSON.stringify(this.ruleForm));
+          item.post_company=item.post_company.toString()
           delete item["return_num"];
           const res = await asyncRequest.returnsend(item);
           this.loading = false;

+ 4 - 12
src/views/purchaseIn/wsmInOrder/detail.vue

@@ -4,11 +4,11 @@
       style="width: 100%"
       v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
     >
-      <p>{{ status }}---{{ powers }}</p>
+      <!-- <p>{{ status }}---{{ powers }}</p> -->
 
-      <div class="detail-page-title">
+      <!-- <div class="detail-page-title">
         <span class="title">入库单编号:{{ queryId }}</span>
-      </div>
+      </div> -->
       <!-- <status-bar
         v-if="newTime !== ''"
         :newTime="newTime"
@@ -115,15 +115,7 @@
             <el-collapse-item
               title="入库验收登记审核"
               name="4"
-              v-if="
-                sitem.sendtype === '1' &&
-                (status === '1' ||
-                  status === '2' ||
-                  status === '3' ||
-                  status === '4' ||
-                  status === '5' ||
-                  status === '6')
-              "
+              v-if="sitem.sendtype === '1' && status !== '0' && status !== '1'"
             >
               <wsm-in-order-check-form
                 v-if="newTime !== ''"