Ver Fonte

收货工单

yusheng há 1 ano atrás
pai
commit
3daa4ea920

BIN
public/importTemplate/采购订单导入模板.xlsx


+ 2 - 0
src/components/CommomSelect/dept-select.vue

@@ -11,6 +11,8 @@
     :placeholder="placeholder"
     @input="updateValue"
     @change="changeChoose"
+    v-bind="$attrs"
+
   />
 </template>
 

+ 19 - 2
src/views/purchasingManage/purchaseOrder/index.vue

@@ -56,6 +56,13 @@
                 >
                   批量删除
                 </el-button>
+                <el-button
+                  type="primary"
+                  size="small"
+                  icon="el-icon-upload2"
+                  @click="uploadFile"
+                  >导入</el-button
+                >
               </template>
 
               <!-- 查看详情列 -->
@@ -203,6 +210,13 @@
       v-if="addOrEditDialogFlag1"
       @reload="reload"
     ></addInvoiceManage>
+    <importDialog
+      ref="importDialogRef"
+      @success="reload"
+      :fileUrl="'/eos/importTemplate/采购订单导入模板.xlsx'"
+      fileName="采购订单导入模板"
+      apiUrl="/eom/purchaseorder/importFile"
+    />
   </div>
 </template>
 
@@ -233,6 +247,7 @@
   } from '@/enum/dict';
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
+  import importDialog from '@/components/upload/import-dialog.vue';
 
   export default {
     mixins: [dictMixins,tabMixins],
@@ -250,7 +265,7 @@
       detailDialog,
       outSourceSend,
       addOutSourceSend,
-      addInvoiceManage
+      addInvoiceManage,importDialog
     },
     data() {
       return {
@@ -488,7 +503,9 @@
         this.$refs.addDialogRef.$refs.form &&
           this.$refs.addDialogRef.$refs.form.clearValidate();
       },
-
+      uploadFile() {
+        this.$refs.importDialogRef.open();
+      },
       //批量删除
       allDelBtn() {
         if (this.selection.length === 0) return;

+ 2 - 0
src/views/salesServiceManagement/components/invoiceDialog.vue

@@ -28,6 +28,8 @@
         :need-page="false"
         tool-class="ele-toolbar-form"
         :selection.sync="selection"
+          height="400px"
+
       >
       </ele-pro-table>
     </div>

+ 4 - 0
src/views/salesServiceManagement/components/sparePartsList.vue

@@ -15,6 +15,7 @@
         :datasource="form.tableList"
         tool-class="ele-toolbar-form"
         :initLoad="false"
+        :need-page="false"
         height="300px"
       >
         <template v-slot:toolbar v-if="type != 'view'">
@@ -333,6 +334,9 @@
       getTableValue() {
         return this.form.tableList;
       },
+      setTableValue(val){
+        this.$set(this.form,'tableList',val)
+      },
       measureQuantityChange(index) {
         let row = this.form.tableList[index];
         if (row.measureQuantity && row.singlePrice) {

+ 26 - 23
src/views/salesServiceManagement/toDoList/components/addOrUpdateDialog.vue

@@ -3,9 +3,10 @@
     width="75%"
     :append-to-body="true"
     custom-class="ele-dialog-form"
-    :title="btnName"
+    :title="title"
     :visible.sync="visible"
     :maxable="true"
+
     @close="handleClose"
   >
     <header-title title="计划基本信息"></header-title>
@@ -23,7 +24,6 @@
               size="small"
               placeholder="请输入"
               :disabled="type == 'view'"
-
               disabled
             ></el-input>
           </el-form-item>
@@ -35,7 +35,6 @@
               size="small"
               placeholder="请输入"
               :disabled="type == 'view'"
-
             ></el-input>
           </el-form-item>
         </el-col>
@@ -46,7 +45,6 @@
               size="small"
               style="width: 100%"
               :disabled="type == 'view'"
-
             >
               <el-option :value="1" label="是"></el-option>
               <el-option :value="0" label="否"></el-option>
@@ -65,7 +63,6 @@
                 placeholder="请输入"
                 @input="formDataDurationTime"
                 :disabled="type == 'view'"
-
               >
                 <template #suffix>分钟</template>
               </el-input>
@@ -77,8 +74,7 @@
             <deptSelect
               v-model="addForm.executeGroupId"
               @changeGroup="searchDeptNodeClick"
-              :disabled="type == 'view'"
-
+              :disabled="type == 'view'&&!isDispatch"
             />
           </el-form-item>
         </el-col>
@@ -90,8 +86,7 @@
               style="width: 100%"
               filterable
               @change="changeUser"
-              :disabled="type == 'view'"
-
+              :disabled="type == 'view'&&!isDispatch"
             >
               <el-option
                 v-for="item in executorList"
@@ -132,12 +127,17 @@
     </el-form>
     <info ref="infoRef" type="view" :isPurchaseNeed="false"></info>
 
-    <header-title title="方案" ></header-title>
+    <header-title title="方案"></header-title>
     <spareParts ref="sparePartsRef" :type="type"></spareParts>
 
-    <template v-slot:footer >
+    <template v-slot:footer>
       <el-button @click="handleClose">取消</el-button>
-      <el-button type="primary" @click="save" v-if="type != 'view'"> 保存</el-button>
+      <el-button type="primary" @click="save" v-if="type != 'view'">
+        保存</el-button
+      >
+      <el-button type="primary" @click="save" v-if="isDispatch">
+        确认派单</el-button
+      >
     </template>
   </ele-modal>
 </template>
@@ -153,7 +153,7 @@
 
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
   import fileMain from '@/components/addDoc/index.vue';
-  import spareParts from '../../components/sparePartsList.vue';
+  import spareParts from '@/views/salesServiceManagement/components/sparePartsList.vue';
   import info from '@/views/salesServiceManagement/components/info.vue';
 
   import { mapGetters } from 'vuex';
@@ -195,10 +195,9 @@
 
         // 提交状态
         loading: false,
-
-        btnName: '',
-        type:'add',
-
+        type: 'add',
+        title:'',
+        isDispatch: false,
         detailList: []
       };
     },
@@ -216,8 +215,10 @@
         this.visible = false;
       },
       // 初始化
-      async init(row, tips) {
-        this.type = tips;
+      async init(row, type, isDispatch) {
+        this.type = type;
+        this.title=isDispatch?'派单':type=='view'?'详情':'修改'
+        this.isDispatch = isDispatch;
         if (row) {
           this.visible = true;
           this.getInfo(row.id);
@@ -267,12 +268,13 @@
         });
       },
       save() {
-        this.addForm.sparePartsApplyVO =
+        this.addForm.costListVOS =
           this.$refs.sparePartsRef.getTableValue();
         this.$refs.addFormRef.validate(async (valid) => {
           if (valid) {
-            let requestName =
-              this.btnName == '派单' ? dispatchOrders : updateSalesPlan;
+            let requestName = this.isDispatch
+              ? dispatchOrders
+              : updateSalesPlan;
             const res = await requestName(this.addForm);
             if (!res) return;
             this.$message.success('保存成功');
@@ -287,8 +289,9 @@
         this.addForm = res;
         this.$nextTick(() => {
           this.$refs.infoRef.init(res.afterSalesDemandVO);
+          this.$refs.sparePartsRef.setTableValue( res?.costListVOS || []);
+          
         });
-        this.detailList = res?.sparePartsApplyVO || [];
       }
     }
   };

+ 11 - 9
src/views/salesServiceManagement/toDoList/index.vue

@@ -24,7 +24,7 @@
             type="primary"
             :underline="false"
             @click="handleUpdate(row,'edit')"
-            v-if="[0, 3].includes(row.planStatus)"
+            v-if="[0, 4,5].includes(row.planStatus)"
           >
             修改
           </el-link>
@@ -32,7 +32,7 @@
             class="ele-action"
             title="确认删除这条记录吗?"
             @confirm="cancel(row)"
-            v-if="[0, 3].includes(row.planStatus)"
+            v-if="[0, 4,5].includes(row.planStatus)"
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -52,15 +52,15 @@
               </el-dropdown-item>
               <el-dropdown-item
                 command="handleDispatchOrders"
-                v-if="row.planStatus == 0 || row.planStatus == 3"
+                v-if="[0, 4,5].includes(row.planStatus)"
                 >派单
               </el-dropdown-item>
               <el-dropdown-item command="handleGenerate"
                 >生成报价单
               </el-dropdown-item>
-              <el-dropdown-item command="addSpareItems"
+              <!-- <el-dropdown-item command="addSpareItems"
                 >申请备品备件
-              </el-dropdown-item>
+              </el-dropdown-item> -->
             </el-dropdown-menu>
           </el-dropdown>
         </template>
@@ -151,9 +151,11 @@
               return {
                 0: '待派单',
                 1: '已派单',
-                2: '已完成',
-                3: '已撤回',
-                4: '执行中'
+                2: '执行中',
+                3: '已完成',
+                4: '已撤回',
+                5: '已驳回'
+                
               }[item.planStatus];
             }
           },
@@ -232,7 +234,7 @@
       },
       handleDispatchOrders(row) {
         this.$nextTick(() => {
-          this.$refs.addOrUpdateDialogRef.init(row, 'view');
+          this.$refs.addOrUpdateDialogRef.init(row, 'view',true);
         });
       },
       async handleRevocation(row) {

+ 114 - 86
src/views/salesServiceManagement/workOrder/components/declarationDialog.vue

@@ -1,120 +1,148 @@
 <template>
-    <ele-modal custom-class="ele-dialog-form long-dialog-form" :visible.sync="visibleDialog" title="报工"
-        :close-on-click-modal="false" width="55%" append-to-body @close="handleClose" :maxable="true">
-        <el-form ref="form" :model="addForm" label-width="100px">
-            <el-form-item label="实际起始时间" prop="time">
-                <el-date-picker v-model="addForm.time" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss"
-                    range-separator="至" start-placeholder="实际开始日期" end-placeholder="实际结束日期">
-                </el-date-picker>
-            </el-form-item>
-            <el-form-item label="附件:" prop="attachments">
-                <fileMain v-model="addForm.attachments"></fileMain>
-            </el-form-item>
-            <el-form-item label="备注:" prop="reason">
-                <el-input type="textarea" placeholder="请输入内容" v-model="addForm.reason">
-                </el-input>
-            </el-form-item>
-        </el-form>
-        <div slot="footer" class="footer">
-            <el-button type="primary" @click="submitAdd">提交</el-button>
-            <el-button @click="handleClose">取消</el-button>
-        </div>
-    </ele-modal>
-</template>
-
-<script>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :visible.sync="visibleDialog"
+    title="报工"
+    :close-on-click-modal="false"
+    width="85%"
+    append-to-body
+    @close="handleClose"
+    :maxable="true"
+  >
+    <el-form ref="form" :model="addForm" label-width="100px">
+      <el-form-item label="实际起始时间" prop="time">
+        <el-date-picker
+          v-model="addForm.time"
+          type="datetimerange"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          range-separator="至"
+          start-placeholder="实际开始日期"
+          end-placeholder="实际结束日期"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="附件:" prop="attachments">
+        <fileMain v-model="addForm.attachments"></fileMain>
+      </el-form-item>
+      <el-form-item label="备注:" prop="reason">
+        <el-input
+          type="textarea"
+          placeholder="请输入内容"
+          v-model="addForm.reason"
+        >
+        </el-input>
+      </el-form-item>
+    </el-form>
 
-import fileMain from '@/components/addDoc/index.vue';
+    <info ref="infoRef" type="view" :isPurchaseNeed="false"></info>
 
-import { reportWorkingSalesWorkOrder } from '@/api/salesServiceManagement/index'
+    <header-title title="方案"></header-title>
+    <spareParts ref="sparePartsRef" :type="type"></spareParts>
+    <div slot="footer" class="footer">
+      <el-button type="primary" @click="submitAdd">提交</el-button>
+      <el-button @click="handleClose">取消</el-button>
+    </div>
+  </ele-modal>
+</template>
 
-export default {
-    props: {
-    },
+<script>
+  import fileMain from '@/components/addDoc/index.vue';
+  import { getSalesWorkOrderById } from '@/api/salesServiceManagement/index';
+  import { reportWorkingSalesWorkOrder } from '@/api/salesServiceManagement/index';
+  import spareParts from '@/views/salesServiceManagement/components/sparePartsList.vue';
+  import info from '@/views/salesServiceManagement/components/info.vue';
+  export default {
+    props: {},
     components: {
-        fileMain
+      fileMain,
+      spareParts,
+      info
     },
     watch: {},
-    computed: {
-    },
+    computed: {},
     data() {
-        return {
-            title: '',
-            visibleDialog: false,
-            addForm: {
-                id: '',
-                time: [],
-                attachments: [],
-                reason: '',
-            },
-            row: {}
-        }
-    },
-    created() {
+      return {
+        title: '',
+        visibleDialog: false,
+        addForm: {
+          id: '',
+          time: [],
+          attachments: [],
+          reason: ''
+        },
+        row: {}
+      };
     },
+    created() {},
     methods: {
-        open(row) {
-            this.row = row;
-            this.visibleDialog = true;
-
-        },
-        async submitAdd() {
-            this.$refs.form.validate(async (valid) => {
-                if (valid) {
-                    await reportWorkingSalesWorkOrder({
-                        acceptTime: this.addForm.time[0],
-                        finishTime: this.addForm.time[1],
-                        attachments: this.addForm.attachments,
-                        reason: this.addForm.reason,
-
-                    }).then((res) => {
-                        if (!res) return
-                        this.$message.success('操作成功')
-                        this.visibleDialog = false;
-                        this.$emit('reload');
-                    });
-                } else {
-                    return false;
-                }
+      open(row) {
+        this.row = row;
+        this.visibleDialog = true;
+        this.getDetail(row);
+      },
+      async getDetail(row) {
+        console.log(row,'row')
+        const res = await getSalesWorkOrderById(row.id);
+        this.$nextTick(() => {
+          this.$refs.infoRef.init(res.afterSalesDemandVO);
+          this.$refs.sparePartsRef.setTableValue(res?.costListVOS || []);
+        });
+      },
+      async submitAdd() {
+        this.$refs.form.validate(async (valid) => {
+          if (valid) {
+            await reportWorkingSalesWorkOrder({
+              acceptTime: this.addForm.time[0],
+              finishTime: this.addForm.time[1],
+              attachments: this.addForm.attachments,
+              reason: this.addForm.reason
+            }).then((res) => {
+              if (!res) return;
+              this.$message.success('操作成功');
+              this.visibleDialog = false;
+              this.$emit('reload');
             });
-        },
-        handleClose() {
-            this.visibleDialog = false;
-        },
-
+          } else {
+            return false;
+          }
+        });
+      },
+      handleClose() {
+        this.visibleDialog = false;
+      }
     }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-.dialog_top {
+  .dialog_top {
     margin-bottom: 10px;
     display: flex;
     align-items: center;
 
     span {
-        margin-left: 50px;
+      margin-left: 50px;
     }
 
     .name {
-        font-weight: 800;
-        color: #40a9ff;
+      font-weight: 800;
+      color: #40a9ff;
     }
-}
+  }
 
-::v-deep .el-row {
+  ::v-deep .el-row {
     display: flex;
     flex-wrap: wrap;
-}
+  }
 
-.btns {
+  .btns {
     text-align: right;
     // margin: 10px 0;
-}
+  }
 
-.main_container {
+  .main_container {
     width: 100%;
     display: flex;
     justify-content: space-between;
-}
-</style>
+  }
+</style>

+ 1 - 1
vue.config.js

@@ -37,7 +37,7 @@ module.exports = {
         // target: 'http://192.168.1.139:18086', // 粟
         // target: 'http://192.168.1.132:18086', // 徐1
         // target: 'http://192.168.1.134:18086', //徐2
-        target: 'http://192.168.1.144:18086',
+        target: 'http://192.168.1.105:18086',
         // target: 'http://192.168.1.103:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.105:18086',