瀏覽代碼

收付款结算新加字段 产品工艺 生产领料 生产订单新加字段 新加确认撤销接口 新加同步库存功能

Qukatie 11 月之前
父節點
當前提交
e28d001469

+ 14 - 0
src/api/tirePartsMall/productionManagement/productionOrder/index.js

@@ -88,4 +88,18 @@ export const selectPicking = (data) => {
     method: 'get',
     params: data
   })
+}
+export const confirm = (data) => {
+  return request({
+    url: '/api/blade-sales-part/productionOrder/confirm',
+    method: 'get',
+    params: data
+  })
+}
+export const revokeConfirm = (data) => {
+  return request({
+    url: '/api/blade-sales-part/productionOrder/revokeConfirm',
+    method: 'get',
+    params: data
+  })
 }

+ 14 - 0
src/api/tirePartsMall/productionManagement/productionPicking/index.js

@@ -66,4 +66,18 @@ export const selectPicking = (data) => {
     method: 'get',
     params: data
   })
+}
+export const confirm = (data) => {
+  return request({
+    url: '/api/blade-sales-part/productionOrder/confirm',
+    method: 'get',
+    params: data
+  })
+}
+export const revokeConfirm = (data) => {
+  return request({
+    url: '/api/blade-sales-part/productionOrder/revokeConfirm',
+    method: 'get',
+    params: data
+  })
 }

+ 16 - 1
src/api/tirePartsMall/salesManagement/saleOrder.js

@@ -362,4 +362,19 @@ export const getGoodAllList = (params) => {
     method: 'get',
     params: params
   })
-}
+}
+
+export const generateProcurement = (params) => {
+  return request({
+    url: '/api/blade-sales-part/order/generateProcurement',
+    method: 'get',
+    params: params
+  })
+}
+export const generateProductionOrder = (params) => {
+  return request({
+    url: '/api/blade-sales-part/ship/generateProductionOrder',
+    method: 'get',
+    params: params
+  })
+}

+ 1 - 1
src/router/views/index.js

@@ -2594,7 +2594,7 @@ export default [{
   hidden: true,
   children: [{
     path: '/tirePartsMall/salesManagement/purchaseOrder/index',
-    name: '采购订单',
+    name: '采购订单(L)',
     meta: {
       i18n: '/tirePartsMall/salesManagement/purchaseOrder/index',
       keepAlive: true,

+ 27 - 5
src/views/tirePartsMall/financialManagement/collectionSettlement/detailsPage.vue

@@ -72,9 +72,14 @@
           </template>
           <template slot-scope="{ row, index }" slot="invoiceAmount">
             <el-input-number size="small" style="width: 100%;" v-model="row.invoiceAmount" :precision="2" :controls="false"
-              v-if="row.$cellEdit" :max="row.accountsAmount"></el-input-number>
+              v-if="row.$cellEdit" :max="row.accountsAmount" @change="taxRateChange(row)"></el-input-number>
             <span v-else>{{ row.invoiceAmount }}</span>
           </template>
+          <template slot-scope="{ row, index }" slot="taxRate">
+            <el-input-number size="small" style="width: 100%;" v-model="row.taxRate" :precision="2" :controls="false"
+              v-if="row.$cellEdit" @change="taxRateChange(row)"></el-input-number>
+            <span v-else>{{ row.taxRate }}</span>
+          </template>
           <template slot-scope="{type,size,row,index,disabled}" slot="menu">
             <el-button :size="size" :disabled="form.financeStatus == '已收款' || isMenu" :type="type"
               :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="$refs.formContacts.rowCell(row, index)">{{
@@ -107,7 +112,7 @@ import billDetail from "@/components/bill/selectOrderDetailList";
 import { saveSubmit, collectionAndPayment, revokeCollectionAndPayment, detail, removeItems, getFinanceList, remove } from '@/api/accountingManagement/index.js';
 import { getList } from "@/api/collectionSettlement/index.js";
 import { skgetKh } from "@/api/tirePartsMall/salesManagement/saleOrder";
-
+import _ from "lodash";
 
 export default {
   name: "detailsPage",
@@ -286,6 +291,18 @@ export default {
             width: 100,
           },
           {
+            label: '税率(%)',
+            prop: 'taxRate',
+            overHidden: true,
+            width: 100,
+          },
+          {
+            label: '不含税金额',
+            prop: 'excludingTaxAmount',
+            overHidden: true,
+            width: 100,
+          },
+          {
             label: '发票号',
             prop: 'invoiceNo',
             overHidden: true,
@@ -427,6 +444,13 @@ export default {
     // this.corpIdData
   },
   methods: {
+    taxRateChange(row){
+      if(row.taxRate>0){
+        row.excludingTaxAmount=Number(_.divide(row.invoiceAmount,_.add(1,_.divide(row.taxRate, 100)))).toFixed(2)
+      }else{
+        row.excludingTaxAmount=Number(row.invoiceAmount).toFixed(2)
+      }
+    },
     thisAmountChange(row) {
       let sum1 = 0
       let sum2 = 0
@@ -712,7 +736,5 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-::v-deep .el-form-item {
-  margin-bottom: 8px !important;
-}
+
 </style>

+ 26 - 5
src/views/tirePartsMall/financialManagement/paymentSettlement/detailsPage.vue

@@ -50,9 +50,14 @@
           </template>
           <template slot-scope="{ row, index }" slot="invoiceAmount">
             <el-input-number size="small" style="width: 100%;" v-model="row.invoiceAmount" :precision="2" :controls="false"
-              v-if="row.$cellEdit" :max="row.accountsAmount"></el-input-number>
+              v-if="row.$cellEdit" :max="row.accountsAmount" @change="taxRateChange(row)"></el-input-number>
             <span v-else>{{ row.invoiceAmount }}</span>
           </template>
+          <template slot-scope="{ row, index }" slot="taxRate">
+            <el-input-number size="small" style="width: 100%;" v-model="row.taxRate" :precision="2" :controls="false"
+              v-if="row.$cellEdit" @change="taxRateChange(row)"></el-input-number>
+            <span v-else>{{ row.taxRate }}</span>
+          </template>
           <template slot-scope="{type,size,row,index,disabled}" slot="menu">
             <el-button :size="size" :type="type" :disabled="form.financeStatus == '已付款' || isMenu"
               :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="$refs.formContacts.rowCell(row, index)">{{
@@ -83,7 +88,7 @@
 import billDetail from "@/components/bill/selectOrderDetailListCG";
 import { saveSubmit, collectionAndPayment, revokeCollectionAndPayment, detail, removeItems, getFinanceList, remove } from '@/api/accountingManagement/index.js';
 import { number } from "echarts";
-
+import _ from "lodash";
 export default {
   name: "detailsPage",
   components: {
@@ -257,6 +262,18 @@ export default {
             width: 140,
           }, 
           {
+            label: '税率(%)',
+            prop: 'taxRate',
+            overHidden: true,
+            width: 100,
+          },
+          {
+            label: '不含税金额',
+            prop: 'excludingTaxAmount',
+            overHidden: true,
+            width: 100,
+          },
+          {
             label: '发票号',
             prop: 'invoiceNo',
             width: 140,
@@ -353,6 +370,13 @@ export default {
 
   },
   methods: {
+    taxRateChange(row){
+      if(row.taxRate>0){
+        row.excludingTaxAmount=Number(_.divide(row.invoiceAmount,_.add(1,_.divide(row.taxRate, 100)))).toFixed(2)
+      }else{
+        row.excludingTaxAmount=Number(row.invoiceAmount).toFixed(2)
+      }
+    },
     thisAmountChange(row) {
       let sum1 = 0
       let sum2 = 0
@@ -638,7 +662,4 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-::v-deep .el-form-item {
-  margin-bottom: 8px !important;
-}
 </style>

+ 6 - 0
src/views/tirePartsMall/productionManagement/productProcess/detailsPage.vue

@@ -210,6 +210,12 @@ export default {
                         cell: true
                     },
                     {
+                        label: "预计时间(字符)",
+                        prop: "estimatedTime",
+                        overHidden: true,
+                        cell: true
+                    },
+                    {
                         label: "是否开启",
                         prop: "whetherOpen",
                         type: 'switch',

+ 75 - 11
src/views/tirePartsMall/productionManagement/productionOrder/detailsPage.vue

@@ -17,14 +17,21 @@
                     :disabled="isSaveBtn" @click="submit">保 存
                 </el-button>
                 <el-button v-if="form.statusName == '生产中'" class="el-button--small-yh" style="margin-left: 6px;"
-                    type="warning" size="small" :disabled="editButton || isSaveBtn || form.statusName == '生产完成'"
+                    type="warning" size="small" :disabled="editButton || isSaveBtn"
                     @click="completed">完 工
                 </el-button>
-                <el-button v-if="form.statusName == '生产完成'" class="el-button--small-yh" style="margin-left: 6px;"
+                <el-button v-if="form.statusName == '待确认'" class="el-button--small-yh" style="margin-left: 6px;"
                     type="danger" size="small" :disabled="editButton || isSaveBtn" @click="revokeCompleted">撤销完工
                 </el-button>
-                <el-button class="el-button--small-yh" style="margin-left: 6px;" type="success" size="small"
-                    :disabled="editButton || isSaveBtn || form.statusName == '生产完成'" @click="generatePicking">领 料
+                <el-button  v-if="form.statusName == '生产中'" class="el-button--small-yh" style="margin-left: 6px;" type="success" size="small"
+                    :disabled="editButton || isSaveBtn " @click="generatePicking">领 料
+                </el-button>
+                <el-button v-if="form.statusName == '待确认'&&(roleName=='admin'||roleName=='库管')" class="el-button--small-yh" style="margin-left: 6px;"
+                    type="warning" size="small" :disabled="editButton || isSaveBtn"
+                    @click="confirm">确 认
+                </el-button>
+                <el-button v-if="form.statusName == '已确认'&&(roleName=='admin'||roleName=='库管')" class="el-button--small-yh" style="margin-left: 6px;"
+                    type="danger" size="small" :disabled="editButton || isSaveBtn" @click="revokeConfirm">撤销确认
                 </el-button>
                 <!-- <el-button class="el-button--small-yh" style="margin-left: 6px;" type="info" size="small"
                     :disabled="isSaveBtn" @click="selectPicking">查看领料
@@ -56,8 +63,8 @@
                             @selectChange="dicChange('goodsName', $event)" :disabled="editDisabled"></dicselect-product>
                     </tempalte>
                     <tempalte slot="stockClerkName">
-                        <dic-select v-model="form.stockClerkName" placeholder="派单人" key="id" label="name"
-                            url="/blade-user/selectListLos?roles=派单" :filterable="true"
+                        <dic-select v-model="form.stockClerkName" placeholder="操作人" key="id" label="account" res="records"
+                            url="/blade-user/page" :filterable="true"  :remote="true" dataName="account"
                             @selectChange="dicChange('stockClerkName', $event)" :disabled="editDisabled"></dic-select>
                     </tempalte>
                     <tempalte slot="storageName">
@@ -158,7 +165,7 @@
 </template>
 
 <script>
-import { submit, getDetail, itemsRemove, itemsShipRemove, getGoodsDetail, completed, revokeCompleted, generatePicking, selectPicking } from "@/api/tirePartsMall/productionManagement/productionOrder";
+import { submit, getDetail, itemsRemove, itemsShipRemove, getGoodsDetail, completed, revokeCompleted, generatePicking, selectPicking,confirm,revokeConfirm } from "@/api/tirePartsMall/productionManagement/productionOrder";
 import dicSelect from "@/components/dicSelect/main";
 import dicselectProduct from "@/components/dicSelect/mainProduct";
 import { getDicinit } from "@/api/dicSelect/index";
@@ -171,6 +178,7 @@ export default {
     name: "detailsPage",
     data() {
         return {
+            roleName: localStorage.getItem("roleName"),
             switchDialog: false, // 打印弹窗的开启和关闭
             selectPickingList: [],
             selectPickingOption: {
@@ -200,6 +208,7 @@ export default {
             editButton: false,
             editDisabled: false,
             form: {
+                operateDate: dateFormat(new Date(), 'yyyy-MM-dd') + ' 00:00:00',
                 craftItemsList: [],
                 attributeItemsList: []
             },
@@ -296,10 +305,18 @@ export default {
                         disabled: true,
                     },
                     {
-                        label: '派单人',
+                        label: '操作人',
                         prop: "stockClerkName",
                         disabled: false,
-                    }
+                    },
+                    {
+                        label: '操作日期',
+                        prop: "operateDate",
+                        disabled: false,
+                        type: "date",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd 00:00:00",
+                    },
                 ]
             },
             option: {},
@@ -526,8 +543,8 @@ export default {
                 if (row) {
                     this.form.goodsId = row.goodsId
                     this.form.goodsName = row.goodsName
-                    this.form.attributeItemsList=[]
-                    this.form.craftItemsList=[]
+                    this.form.attributeItemsList = []
+                    this.form.craftItemsList = []
                     getGoodsDetail({ id: row.id }).then(res => {
                         res.data.data.attributeItemsList.forEach(item => {
                             delete item.id
@@ -550,6 +567,7 @@ export default {
                                 this.form.craftItemsList.push({
                                     productionProcesses: e.productionProcesses,
                                     assemblyMileageProgress: e.assemblyMileageProgress,
+                                    estimatedTime:e.estimatedTime,
                                     type: e.type
                                 })
                             }
@@ -878,6 +896,52 @@ export default {
                 })
             })
         },
+        confirm() {
+            this.$confirm("是否确认?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                const loading = this.$loading({
+                    lock: true,
+                    text: '加载中',
+                    spinner: 'el-icon-loading',
+                    background: 'rgba(255,255,255,0.7)'
+                });
+                confirm({id:this.form.id}).then(res => {
+                    this.$message.success("操作成功");
+                    this.getDetails(res.data.data.id)
+                    this.editButton = true
+                    this.editDisabled = true
+                    this.optionForm.disabled = true
+                }).finally(() => {
+                    loading.close();
+                })
+            })
+        },
+        revokeConfirm() {
+            this.$confirm("是否撤销确认?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                const loading = this.$loading({
+                    lock: true,
+                    text: '加载中',
+                    spinner: 'el-icon-loading',
+                    background: 'rgba(255,255,255,0.7)'
+                });
+                revokeConfirm({id:this.form.id}).then(res => {
+                    this.$message.success("操作成功");
+                    this.getDetails(res.data.data.id)
+                    this.editButton = true
+                    this.editDisabled = true
+                    this.optionForm.disabled = true
+                }).finally(() => {
+                    loading.close();
+                })
+            })
+        },
         selectPicking() {
             selectPicking({ total: 1, size: 30, statusName: '已领料', bizTypeName: 'SCLL' }).then(res => {
                 this.selectPickingList = res.data.data.records

+ 32 - 9
src/views/tirePartsMall/productionManagement/productionOrder/index.vue

@@ -13,7 +13,7 @@
                 </template>
                 <template slot="menu" slot-scope="{ row, index }">
                     <el-button size="small" icon="el-icon-edit" type="text" @click="rowEdit(row)">编辑</el-button>
-                    <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)">删
+                    <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)" :disabled="row.statusName != '生产中'">删
                         除</el-button>
                 </template>
                 <template slot="customerName" slot-scope="{ row }">
@@ -125,7 +125,7 @@ export default {
                     {
                         label: "产品名称",
                         prop: "goodsName",
-                        overHidden: true,                       
+                        overHidden: true,
                         type: 'select',
                         filterable: true,
                         remote: true,
@@ -150,20 +150,43 @@ export default {
                         search: true,
                         searchOrder: 6,
                     },
+                    // {
+                    //     label: "派单人",
+                    //     prop: "stockClerkName",
+                    //     overHidden: true,                        
+                    //     type: 'select',
+                    //     filterable: true,
+                    //     remote: true,
+                    //     props: {
+                    //         label: 'name',
+                    //         value: 'name',
+                    //     },
+                    //     dicUrl: '/api/blade-user/selectListLos?roles=派单',
+                    //     search: true,
+                    //     searchOrder: 7,
+                    // },        
                     {
-                        label: "派单人",
+                        label: '操作人',
                         prop: "stockClerkName",
-                        overHidden: true,                        
+                        overHidden: true,
                         type: 'select',
                         filterable: true,
                         remote: true,
                         props: {
-                            label: 'name',
-                            value: 'name',
+                            label: 'account',
+                            value: 'account',
+                            res: 'data.records'
                         },
-                        dicUrl: '/api/blade-user/selectListLos?roles=派单',
+                        dicUrl: '/api/blade-user/blade-user/page?current=1&size=20&account={{key}}',
                         search: true,
-                        searchOrder: 7,
+                    },
+                    {
+                        label: '操作日期',
+                        prop: "operateDate",
+                        overHidden: true,
+                        type: "date",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd 00:00:00",
                     },
                     {
                         label: "订单状态",
@@ -237,7 +260,7 @@ export default {
             let obj = {}
             obj = {
                 ...Object.assign(params, this.query),
-                bizTypeName:'SCDD'
+                bizTypeName: 'SCDD'
             }
             this.loading = true;
             getList(page.currentPage, page.pageSize, obj).then(res => {

+ 134 - 44
src/views/tirePartsMall/productionManagement/productionPicking/detailsPage.vue

@@ -16,9 +16,15 @@
         <el-button v-if="form.statusName == '待领料'" class="el-button--small-yh" style="margin-left: 6px;" type="success"
           size="small" :disabled="!form.id || editButton" @click="confirmPicking">确认领料
         </el-button>
-        <el-button v-if="form.statusName == '已领料'" class="el-button--small-yh" style="margin-left: 6px;" type="danger"
+        <el-button v-if="form.statusName == '待确认'" class="el-button--small-yh" style="margin-left: 6px;" type="danger"
           size="small" :disabled="!form.id || editButton" @click="revokePicking">撤销领料
         </el-button>
+        <el-button v-if="form.statusName == '待确认'&&(roleName=='admin'||roleName=='库管')" class="el-button--small-yh" style="margin-left: 6px;" type="success"
+          size="small" :disabled="!form.id || editButton" @click="confirm">确 认
+        </el-button>
+        <el-button v-if="form.statusName == '已确认'&&(roleName=='admin'||roleName=='库管')" class="el-button--small-yh" style="margin-left: 6px;" type="danger"
+          size="small" :disabled="!form.id || editButton" @click="revokeConfirm">撤销确认
+        </el-button>
       </div>
     </div>
     <div style="margin-top: 50px">
@@ -28,12 +34,12 @@
             <dic-select v-model="form.customerName" placeholder="客户" key="id" label="cname" res="records"
               url="/blade-sales-part/corpsDesc/list?current=1&size=10&corpType=KH" :filterable="true" :remote="true"
               dataName="cname" @selectChange="dicChange('customerName', $event)"
-              :disabled="editButton || form.statusName == '已领料'"></dic-select>
+              :disabled="editButton || form.statusName == '待确认' || form.statusName == '已确认'"></dic-select>
           </tempalte>
           <template slot-scope="{row,index}" slot="contacts">
             <el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%" clearable filterable
               allow-create default-first-option @change="contactsChange($event)"
-              :disabled="editButton || form.statusName == '已领料'">
+              :disabled="editButton || form.statusName == '待确认' || form.statusName == '已确认'">
               <el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts" :value="item.contacts" />
             </el-select>
           </template>
@@ -46,16 +52,28 @@
           @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 442)">
           <template slot-scope="{scope,row}" slot="menuLeft">
             <el-button type="primary" icon="el-icon-plus" size="small"
-              :disabled="editButton || form.statusName == '已领料'" @click="rowAdd(row, 1)">添加商品</el-button>
+              :disabled="editButton || form.statusName == '待确认' || form.statusName == '已确认'"
+              @click="rowAdd(row, 1)">添加商品</el-button>
             <el-popover placement="top" width="400" trigger="click" @show="inventoryShow2()">
               <avue-crud :data="inventoryList" :option="inventoryOption">
               </avue-crud>
               <el-button slot="reference" type="primary" plain size="small"
                 :disabled="selectionMultilist.length != 1 || form.businessSource == '外部销售'">查看库存</el-button>
             </el-popover>
-            <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button>
+            <!-- <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button> -->
             <el-button type="danger" plain size="small" @click="batchDelete"
-              :disabled="editButton || form.statusName == '已领料'">一键删除</el-button>
+              :disabled="editButton || form.statusName == '待确认' || form.statusName == '已确认'">一键删除</el-button>
+            <el-popover width="600" trigger="click">
+              <avue-crud :data="inventoryData2" :option="inventoryOption2">
+                <template slot-scope="{row}" slot="menu">
+                  <el-button type="text" icon="el-icon-refresh" size="small" :disabled="row.storageId != form.storageId"
+                    @click.stop="synchronous(row)">更新库存
+                  </el-button>
+                </template>
+              </avue-crud>
+              <el-button type="primary" plain size="small" slot="reference" @click="viewInventory2"
+                :disabled="selectionMultilist.length != 1 || isAddBtn">同步库存</el-button>
+            </el-popover>
           </template>
           <template slot="goodsNum" slot-scope="{ row }">
             <el-input-number v-if="row.$cellEdit" size="small" v-model="row.goodsNum" :precision="numberDecimal"
@@ -63,19 +81,22 @@
             <span v-else>{{ row.goodsNum }}</span>
           </template>
           <template slot-scope="{type,size,row,index,disabled}" slot="menu">
-            <el-button v-if="!row.$cellEdit" :size="size" :disabled="editButton || form.statusName == '已领料'"
-              :type="type" icon="el-icon-edit" @click="rowCell(row, index)">编辑
+            <el-button v-if="!row.$cellEdit" :size="size"
+              :disabled="editButton || form.statusName == '待确认' || form.statusName == '已确认'" :type="type"
+              icon="el-icon-edit" @click="rowCell(row, index)">编辑
             </el-button>
-            <el-button v-else :size="size" :disabled="editButton || form.statusName == '已领料'" :type="type"
+            <el-button v-else :size="size"
+              :disabled="editButton || form.statusName == '待确认' || form.statusName == '已确认'" :type="type"
               icon="el-icon-plus" @click="rowSave(row, index)">保存
             </el-button>
-            <el-button icon="el-icon-delete" :size="size" :disabled="editButton || form.statusName == '已领料'"
-              :type="type" @click="rowDelBox(row, index, 'shipItemsList')">删除
+            <el-button icon="el-icon-delete" :size="size"
+              :disabled="editButton || form.statusName == '待确认' || form.statusName == '已确认'" :type="type"
+              @click="rowDelBox(row, index, 'shipItemsList')">删除
             </el-button>
           </template>
         </avue-crud>
       </trade-card>
-      <report-dialog :switchDialog="switchDialog" :reportName="reportName" :reportId="form.id"
+      <report-dialog :switchDialog="switchDialog" reportName="生产订单-领料明细" :reportId="form.ordNo"
         @onClose="onClose()"></report-dialog>
     </div>
 
@@ -138,10 +159,11 @@
 </template>
 
 <script>
-import { getDetail, submit, itemsRemove, confirmPicking, revokePicking } from "@/api/tirePartsMall/productionManagement/productionPicking";
+import { getDetail, submit, itemsRemove, confirmPicking, revokePicking, confirm, revokeConfirm } from "@/api/tirePartsMall/productionManagement/productionPicking";
 import {
   goodsPageXs,
 } from "@/api/tirePartsMall/salesManagement/saleOrder";
+import { getList } from "@/api/tirePartsMall/basicData/commodityInformation"
 import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
 import reportDialog from "@/components/report-dialog/main";
 import { dateFormat } from "@/util/date";
@@ -162,11 +184,14 @@ import {
 } from "@/api/tirePartsMall/basicData/customerInformation";
 import { getToken } from "@/util/auth";
 import { isProcurement } from "@/api/basicData/configuration";
+import { getList as inventoryList } from "@/api/tirePartsMall/inventory";
 export default {
   name: "detailsPage",
 
   data() {
     return {
+      roleName: localStorage.getItem("roleName"),
+      inventoryData2: [],
       sharedCompany: null,
       distributeVisible: false,
       numberDecimal: 0,
@@ -328,6 +353,32 @@ export default {
           }
         ]
       },
+      inventoryOption2: {
+        header: false,
+        menu: true,
+        menuWidth: 90,
+        editBtn: false,
+        delBtn: false,
+        column: [
+          {
+            label: '商品名称',
+            prop: 'cname',
+            overHidden: true,
+          }, {
+            label: '仓库',
+            prop: 'storageName',
+            overHidden: true,
+          }, {
+            label: '库存数量',
+            prop: 'balanceQuantity',
+            overHidden: true,
+          }, {
+            label: '批次号',
+            prop: 'dot',
+            overHidden: true,
+          }
+        ]
+      },
       loading: false,
       // 商品列表数据合计
       goodsListShow: [],
@@ -488,7 +539,11 @@ export default {
           },
           dicUrl: '/api/blade-sales-part/productionPicking/selectPicking?statusName=生产中&bizTypeName=SCDD&ordNo={{key}}'
         },
-
+        {
+          label: '商品名称',
+          prop: "goodsName",
+          disabled: true
+        },
         {
           label: '配送方式',
           prop: "shipType",
@@ -560,7 +615,7 @@ export default {
         dialogTop: 25,
         dialogWidth: "80%",
         showSummary: true,
-        tip:false,
+        tip: false,
         selection: true,
         saveBtn: false, // 表格弹窗保存按钮
         cellBtn: false, // 行编辑
@@ -568,10 +623,8 @@ export default {
           {
             name: 'goodsNum',
             type: 'sum',
-          }, {
-            name: 'sendNum',
-            type: 'sum',
-          }],
+          }
+        ],
         column: [
           {
             label: '商品名称',
@@ -664,31 +717,8 @@ export default {
       if (name == 'customerName') {
         if (row) {
           this.$set(this.form, 'customerId', row.id)
-          getCustom({ id: row.id }).then(res => {
-            if (res.data.data) {
-              this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
-              this.form.storageId = res.data.data.deliveryWarehouseId
-              this.form.storageName = res.data.data.deliveryWarehouseName
-              this.form.contacts = res.data.data.corpsAttnList[0].cname
-              this.form.phone = res.data.data.corpsAttnList[0].tel
-              this.contactsOption = res.data.data.corpsAddrList
-              this.form.recAddress = res.data.data.corpsAddrList[0].belongtoarea + res.data.data.corpsAddrList[0].detailedAddress
-              this.form.salerId = res.data.data.salesmanId
-              this.form.salerName = res.data.data.salesmanName
-            }
-          })
         } else {
-          this.form.customerId = ''
-          this.form.customerName = ''
-          this.dicUrlWithCustomId = ''
-          this.form.storageId = ''
-          this.form.contacts = ''
-          this.form.phone = ''
-          this.contactsOption = ''
-          this.form.recAddress = ''
-          this.form.salerId = ''
-          this.form.salerName = ''
-          this.form.storageName = ''
+          this.form.customerId = null
         }
       }
       if (name == 'sharedCompany') {
@@ -815,6 +845,19 @@ export default {
     removeStagList(row, index, type) {
       this.goodsListSave.splice(row.$index, 1)
     },
+    viewInventory2() {
+      inventoryList({ cname: this.selectionMultilist[0].goodsName }).then(res => [
+        this.inventoryData2 = res.data.data.records
+      ])
+    },
+    synchronous(row) {
+      this.form.shipItemsList.forEach(e => {
+        if (e.goodsName == this.selectionMultilist[0].goodsName) {
+          e.inventory = row.balanceQuantity
+          e.dot = row.dot
+        }
+      })
+    },
     //确认导入触发
     importGoods() {
       if (this.goodsListSave.length == 0) {
@@ -865,7 +908,7 @@ export default {
     //导入商品弹窗列表查询
     onLoad(page, params = {}) {
       this.loading = true;
-      goodsPageXs({
+      getList({
         current: page.currentPage,
         size: page.pageSize,
         customId: this.form.customerId,
@@ -921,6 +964,7 @@ export default {
       })
       getDetail({ id: id }).then(res => {
         this.form = res.data.data
+        this.$refs.formContacts.refreshTable();
       }).finally(() => {
         loading.close();
       })
@@ -948,6 +992,52 @@ export default {
         })
       })
     },
+    confirm() {
+      this.$confirm("是否确认?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        const loading = this.$loading({
+          lock: true,
+          text: '加载中',
+          spinner: 'el-icon-loading',
+          background: 'rgba(255,255,255,0.7)'
+        });
+        confirm({ id: this.form.id }).then(res => {
+          this.$message.success("操作成功");
+          this.getDetails(res.data.data.id)
+          this.editButton = true
+          this.editDisabled = true
+          this.optionForm.disabled = true
+        }).finally(() => {
+          loading.close();
+        })
+      })
+    },
+    revokeConfirm() {
+      this.$confirm("是否撤销确认?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        const loading = this.$loading({
+          lock: true,
+          text: '加载中',
+          spinner: 'el-icon-loading',
+          background: 'rgba(255,255,255,0.7)'
+        });
+        revokeConfirm({ id: this.form.id }).then(res => {
+          this.$message.success("操作成功");
+          this.getDetails(res.data.data.id)
+          this.editButton = true
+          this.editDisabled = true
+          this.optionForm.disabled = true
+        }).finally(() => {
+          loading.close();
+        })
+      })
+    },
     revokePicking() {
       this.$confirm("是否撤销领料?", {
         confirmButtonText: "确定",

+ 20 - 13
src/views/tirePartsMall/productionManagement/productionPicking/index.vue

@@ -7,7 +7,7 @@
         @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 441)" :page.sync="page">
         <template slot-scope="{type,size,row,index}" slot="menu">
           <!-- <el-button  :size="size" :type="type" @click="check(row)">查看</el-button> -->
-          <el-button :size="size" :disabled="row.statusName == '已领料'" :type="type"
+          <el-button :size="size" :disabled="row.statusName != '待领料'" :type="type"
             @click="$refs.crud.rowDel(row, index)">删除</el-button>
         </template>
         <template slot="corpNameSearch">
@@ -50,7 +50,7 @@ export default {
       courierList: [],
       detailsOpen: false,
       loading: false,
-      search: { },
+      search: {},
       form: {},
       dataList: [],
       detailData: {},
@@ -158,7 +158,7 @@ export default {
           prop: "ordNo",
           search: true,
           overHidden: true,
-        }, 
+        },
         {
           label: '业务对象',
           prop: "customerName",
@@ -187,19 +187,26 @@ export default {
             value: 'cname'
           },
           dicUrl: '/api/blade-sales-part/storageDesc/listAll',
-        }
-          // , {
-          //   label: '商品种类',
-          //   prop: "numberRows",
-          //   overHidden: true,
-          // }
-          , {
+        },
+        // , {
+        //   label: '商品种类',
+        //   prop: "numberRows",
+        //   overHidden: true,
+        // }
+        {
+          label: "商品名称",
+          prop: "goodsName",
+          search: false,
+          overHidden: true,
+          // width: 120,
+        },
+        {
           label: "订单数量",
           prop: "goodsTotalNum",
           search: false,
           overHidden: true,
           // width: 120,
-        }, 
+        },
         {
           label: '状态',
           prop: "statusName",
@@ -332,7 +339,7 @@ export default {
       if (type === 0) {
         this.detailData = {}
       }
-      if (this.$route.query.srcId) {
+      if (this.$route.query.srcId || this.$route.query.Id) {
         this.$router.$avueRouter.closeTag(this.$route.fullPath);
         this.$router.push({
           path: "/tirePartsMall/salesManagement/outboundWorkOrder/index"
@@ -351,7 +358,7 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        remove({ids:row.id}).then(res => {
+        remove({ ids: row.id }).then(res => {
           this.$message({
             type: 'success',
             message: '删除成功!'

+ 1 - 1
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/detailsPage.vue

@@ -91,7 +91,7 @@
                     </el-tab-pane>
                 </el-tabs>
             </trade-card>
-            <report-dialog :switchDialog="switchDialog" :reportId="form.id" reportName="入库工单"
+            <report-dialog :switchDialog="switchDialog" :reportId="form.id" reportName="商品商城-入库工单"
                 @onClose="onClose()"></report-dialog>
 
             <containerTitle title="上传附件"></containerTitle>

+ 4 - 4
src/views/tirePartsMall/salesManagement/purchaseOrder/detailsPage.vue

@@ -208,7 +208,7 @@
                     </el-tab-pane>
                 </el-tabs>
             </trade-card>
-            <report-dialog :switchDialog="switchDialog" reportName="轮胎商城-采购订单" :reportId="form.id"
+            <report-dialog :switchDialog="switchDialog" reportName="商品商城-采购订单" :reportId="form.id"
                 @onClose="onClose()"></report-dialog>
             <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
                 :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
@@ -1176,8 +1176,8 @@ export default {
         } else if (this.onLoad.id) {
             this.refresh(this.onLoad.id, true)
         }
-        if (!this.form.id) {
-            this.editButton = false // 第一次录入显示保存按钮
+        if (!this.detailData.id) {
+            // this.editButton = false // 第一次录入显示保存按钮
             this.optionContactsBack.column.forEach(its => {
                 if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
                     its.disabled = false
@@ -1316,7 +1316,7 @@ export default {
                 this.form = res.data.data
                 this.form.orderItemsList = res.data.data.orderItemsList
 
-                this.editButton = true //显示编辑按钮
+                // this.editButton = true //显示编辑按钮
             })
         },
         // 获取左侧筛选

+ 10 - 0
src/views/tirePartsMall/salesManagement/purchaseOrder/index.vue

@@ -495,6 +495,16 @@ export default {
         this.$store.commit("IN_LTCG_STATUS");
         this.editOpen({ id: this.$route.query.srcId }, 1)
       }
+      if (this.$route.query.copyId) {
+        this.$store.commit("IN_LTCG_STATUS");
+        this.loading = true
+        getCopy({ id: this.$route.query.copyId }).then(res => {
+          this.editOpen(res.data.data, 2)
+          this.onLoad(this.page, this.search)
+        }).finally(() => {
+          this.loading = false
+        })
+      }
       // 主页快捷跳转来的 直接打开新建订单
       if (this.$route.query.showTrue) {
         this.$store.commit("IN_LTCG_STATUS");

+ 35 - 24
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -153,7 +153,7 @@
                                 <span v-else>{{ row.dot }}</span>
                             </template>
                             <template slot="subTotalMoney" slot-scope="{ row }">{{ row.goodsNum * row.price
-                                }}</template>
+                            }}</template>
 
                             <template slot="remarks" slot-scope="{ row }">
                                 <el-input v-if="!mingxibaocun" size="small" v-model="row.remarks"
@@ -191,6 +191,12 @@
                                 <el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled"
                                     :type="type" @click="rowDelBox(row, index, 'orderItemsList')">删除
                                 </el-button>
+                                <el-button  :size="size" :disabled="editButton || !row.id"
+                                    :type="type" @click="purchaseOrder(row, index)">采购
+                                </el-button>
+                                <el-button  :size="size" :disabled="editButton || !row.id"
+                                    :type="type" @click="productionOrder(row, index)">生产
+                                </el-button>
                             </template>
                         </avue-crud>
                         <el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px"
@@ -354,7 +360,9 @@ import {
     whetherExistenceFinancing,
     checkOrderRW,
     revokeCheckOrderRW,
-    getParamservice
+    getParamservice,
+    generateProcurement,
+    generateProductionOrder
 } from "@/api/tirePartsMall/salesManagement/saleOrder";
 import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
 import reportDialog from "@/components/report-dialog/main";
@@ -835,7 +843,7 @@ export default {
                 addRowBtn: false,
                 editBtn: false,
                 delBtn: false,
-                menuWidth: 140,
+                menuWidth: 200,
                 dialogTop: 25,
                 dialogWidth: "80%",
                 summaryText: "合计",
@@ -1485,6 +1493,30 @@ export default {
         }
     },
     methods: {
+        purchaseOrder(row) {
+            this.$confirm('是否生成采购订单?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                generateProcurement({ id: row.id }).then(res => {
+                    this.$message.success("操作成功");
+                })
+            })
+
+        },
+        productionOrder(row) {
+            this.$confirm('是否生成生产订单?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                generateProductionOrder({ id: row.id }).then(res => {
+                    this.$message.success("操作成功");
+                })
+            })
+
+        },
         viewInventory() {
             this.inventoryData = []
             inventoryList({ cname: this.selectionMultilist[0].goodsName }).then(res => [
@@ -1494,27 +1526,6 @@ export default {
         viewInventory2() {
             inventoryList({ cname: this.selectionMultilist[0].goodsName }).then(res => [
                 this.inventoryData2 = res.data.data.records
-                // res.data.data.records.forEach(item => {
-                //     if (item.storageId == this.form.storageId && item.dot == this.selectionMultilist[0].dot) {
-                //         if (Number(item.balanceQuantity) == Number(this.selectionMultilist[0].inventory)) {
-                //             this.$message.success("库存一致,不需要同步");
-                //         }
-                //         if (Number(item.balanceQuantity) != Number(this.selectionMultilist[0].inventory)) {
-                //             this.$confirm('是否更新库存', '提示', {
-                //                 confirmButtonText: '确定',
-                //                 cancelButtonText: '取消',
-                //                 type: 'warning'
-                //             }).then(() => {
-                //                 this.form.orderItemsList.forEach(e => {
-                //                     if (e.goodsName == this.selectionMultilist[0].goodsName) {
-                //                         e.inventory = item.balanceQuantity
-                //                     }
-                //                 })
-                //                 //   this.editCustomer()
-                //             })
-                //         }
-                //     }
-                // })
             ])
         },
         synchronous(row) {