Browse Source

no message

linwenxin 1 year ago
parent
commit
1add72f85d

+ 31 - 0
src/api/workOrderPool.js

@@ -247,3 +247,34 @@ export function orderBaseActive(params) {
     params
   })
 }
+
+export function orderPartsApplyCancel(params) {
+  return request({
+    url: `/order/parts/apply/cancel`,
+    method: 'post',
+    params
+  })
+}
+export function orderPartsApplyEnd(params) {
+  return request({
+    url: `/order/parts/apply/end`,
+    method: 'post',
+    params
+  })
+}
+export function orderPartsApplyRecord(params) {
+  return request({
+    url: `/order/parts/apply/record`,
+    method: 'post',
+    params
+  })
+}
+
+export function orderPartsApplyItemModify(data) {
+  return request({
+    url: `/order/parts/apply/item/modify`,
+    method: 'post',
+    data
+  })
+}
+

+ 1 - 7
src/components/template/editTable.js

@@ -71,18 +71,12 @@ export default {
                 }
               }}>{attributes?.editText || '编辑'}</el-button>}
               {setShowElement(attributes?.isDel, { row, column, index }) && <el-button type="text" onClick={async () => {
-                if (this.isEditTableIndex > -1) {
-                  if (this.isEditTableIndex === index) {
-                    this.isEditTableIndex = -1
-                  } else if (this.isEditTableIndex > index) {
-                    this.isEditTableIndex -= 1
-                  }
-                }
                 if (funs.delete) {
                   funs.delete({ row, column, index })
                 } else {
                   tableData.splice(index, 1)
                 }
+                this.isEditTableIndex = -1
               }}>{attributes?.delText || '删除'}</el-button>}
             </div>
           }

+ 7 - 2
src/views/workOrder/workOrderPool/detail.vue

@@ -7,6 +7,7 @@
       <el-tab-pane :label="`支付费用`" name="payFee" key="payFee"></el-tab-pane>
       <el-tab-pane v-if="EvaluationShow" label="评价信息" name="Evaluation" key="Evaluation"> </el-tab-pane>
       <el-tab-pane v-if="SettleAccountsShow" label="费用结算" name="SettleAccounts" key="SettleAccounts"> </el-tab-pane>
+      <el-tab-pane v-if="PartsApplicationShow" label="配件申请" name="PartsApplication" key="PartsApplication"> </el-tab-pane>
     </el-tabs>
     <div class="view_div">
       <div :style="{
@@ -20,6 +21,7 @@
       <Payment v-if="activeName == 'payFee'" :id="id" ref="payFee" :workOrderType="workOrderType" />
       <Evaluation v-if="activeName == 'Evaluation' && EvaluationShow" :id="id" ref="Evaluation" />
       <SettleAccounts v-if="activeName == 'SettleAccounts' && SettleAccountsShow" :id="id" ref="SettleAccounts" />
+      <PartsApplication v-if="activeName == 'PartsApplication' && PartsApplicationShow" :id="id" ref="PartsApplication" />
     </div>
   </div>
 </template>
@@ -31,6 +33,7 @@ import CompletionDetails from './detailModule/CompletionDetails/index.vue'
 import Payment from './detailModule/Payment/index.vue'
 import Evaluation from './detailModule/Evaluation/index.vue'
 import SettleAccounts from './detailModule/SettleAccounts/index.vue'
+import PartsApplication from './detailModule/PartsApplication/index.vue'
 import { orderBaseDetail } from "@/api/workOrderPool.js"
 export default {
   components: {
@@ -39,7 +42,8 @@ export default {
     CompletionDetails,
     Payment,
     Evaluation,
-    SettleAccounts
+    SettleAccounts,
+    PartsApplication
   },
   props: {
     id: {
@@ -55,7 +59,8 @@ export default {
     return {
       activeName: this?.$route?.params?.pagePam || 'workOrderInfo',
       EvaluationShow: false,
-      SettleAccountsShow: false
+      SettleAccountsShow: false,
+      PartsApplicationShow: true,
     }
   },
   created() {

+ 210 - 0
src/views/workOrder/workOrderPool/detailModule/PartsApplication/formModule.vue

@@ -0,0 +1,210 @@
+<template>
+  <zj-form-module :title="'申请信息' + (index + 1)" :form-data="item" :form-items="formItems">
+    <div v-if="item.status == 'ING'" style="text-align:right;box-sizing:border-box;padding-bottom: 10px; padding-right: 10px;">
+      <el-button size="mini" plain @click="quxiao">取消申请</el-button>
+      <el-button size="mini" type="primary" plain @click="daohuo">到货反馈</el-button>
+    </div>
+  </zj-form-module>
+</template>
+
+<script>
+import editTable from "@/components/template/editTable.js"
+import { orderPartsApplyItemModify, orderPartsApplyCancel, orderPartsApplyEnd } from "@/api/workOrderPool.js";
+export default {
+  props: {
+    id: {
+      type: [String, Number],
+      default: null,
+    },
+    item: {
+      type: Object,
+      default: ()=>({}),
+    },
+    index: {
+      type: [String, Number],
+      default: null,
+    },
+  },
+  mixins: [editTable],
+  data() {
+    return {
+    }
+  },
+  computed: {
+    formItems() {
+      return [
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '申请单号', prop: 'id' },
+        },
+        {
+          name: 'slot-component',
+          md: 6,
+          formItemAttributes: { label: '申请状态', prop: 'status' },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return <el-input disabled={true} value={({ING:"申请中",END:"到货反馈",CANCEL:"取消申请"})[value]} placeholder=""></el-input>
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '申请人', prop: 'createBy' },
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '申请时间', prop: 'createTime' },
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '取消人', prop: 'cancelBy' },
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '取消时间', prop: 'cancelTime' },
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '反馈人', prop: 'confirmBy' },
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: { disabled: true, placeholder: '-' },
+          formItemAttributes: { label: '反馈时间', prop: 'confirmTime' },
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: {
+            disabled: true,
+            type: 'textarea',
+            rows: 2,
+            placeholder: '-'
+          },
+          formItemAttributes: {
+            label: '备注',
+            prop: 'remark',
+          }
+        },
+        {
+          name: 'slot-component',
+          md: 24,
+          formItemAttributes: { label: '配件信息', prop: 'items' },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            console.log(value)
+            return this.convertTableJson(value, [
+              {
+                columnAttributes: {
+                  label: '配件名称',
+                  prop: 'name',
+                  propName: 'name'
+                },
+                editRender: (h, { row, column, index }) => {
+                  return (
+                    <div class="redbordererr">
+                      <el-form-item label="" label-width="0px">
+                        <el-input value={row[column.columnAttributes.prop]} onInput={val => { row[column.columnAttributes.prop] = val }} placeholder="请输入内容"></el-input>
+                      </el-form-item>
+                    </div>
+                  )
+                },
+                viewRender: (h, { row, column, index }) => {
+                  return <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+                }
+              },
+              {
+                columnAttributes: {
+                  label: '数量',
+                  prop: 'qty',
+                  propName: 'qty'
+                },
+                editRender: (h, { row, column, index }) => {
+                  return (
+                    <div class="redbordererr">
+                      <el-form-item label="" label-width="0px">
+                        <el-input value={row[column.columnAttributes.prop]} onInput={val => { row[column.columnAttributes.prop] = val }} placeholder="请输入内容" type="number"></el-input>
+                      </el-form-item>
+                    </div>
+                  )
+                },
+                viewRender: (h, { row, column, index }) => {
+                  return <div style="padding-left:10px">{row[column.columnAttributes.prop]}</div>
+                }
+              },
+            ], {
+              isEdit: this.item.status == "ING",
+              isAdd: false,
+              isDel:  this.item.status == "ING",
+            }, {
+              confirm:({ row, column, index })=>{
+                orderPartsApplyItemModify({...row}).then(res=>{
+                  this.isEditTableIndex = -1
+                  this.$message({
+                    type: 'success',
+                    message: '保存成功'
+                  })
+                })
+              }
+            })
+          }
+        },
+      ]
+    },
+  },
+  methods: {
+    quxiao(){
+      this.$confirm('是否确认取消?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        orderPartsApplyCancel({
+          id:this.item.id
+        }).then(res=>{
+          this.$message({
+            type: 'success',
+            message: '取消成功'
+          })
+          this.$emit("shuaxin")
+        })
+      }).catch(() => {
+      });
+    },
+    daohuo(){
+      this.$confirm('是否确认反馈?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        orderPartsApplyEnd({
+          id:this.item.id
+        }).then(res=>{
+          this.$message({
+            type: 'success',
+            message: '反馈成功'
+          })
+          this.$emit("shuaxin")
+        })
+      }).catch(() => {
+      });
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 72 - 0
src/views/workOrder/workOrderPool/detailModule/PartsApplication/index.vue

@@ -0,0 +1,72 @@
+<template>
+  <zj-page-container>
+    <zj-page-fill class="neibuview">
+      <template v-if="payData.length">
+        <zj-form-container :formAttributes="{ 'label-position': 'top' }">
+          <template v-for="(item, index) in payData">
+            <formModule :item="payData[index]" :index="index" @shuaxin="shuaxin">
+            </formModule>
+          </template>
+        </zj-form-container>
+      </template>
+      <el-empty v-else description="暂时没有配件申请"></el-empty>
+    </zj-page-fill>
+  </zj-page-container>
+</template>
+
+<script>
+import { orderPartsApplyRecord } from "@/api/workOrderPool.js";
+import formModule from "./formModule.vue"
+export default {
+  components:{
+    formModule
+  },
+  props: {
+    id: {
+      type: [String, Number],
+      default: null,
+    },
+  },
+  data() {
+    return {
+      payData: []
+    }
+  },
+  watch: {
+    id: {
+      handler(newVal, oldVal) {
+        this.shuaxin()
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  computed: {
+  },
+  methods: {
+    shuaxin(){
+      orderPartsApplyRecord({
+        orderId: this.id
+      }).then(res => {
+        this.payData = res.data || []
+      })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep &>.zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    &>div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
+}
+</style>

+ 9 - 0
src/views/workOrder/workOrderPool/index.vue

@@ -326,6 +326,15 @@ export default {
         }, {
           label: "已取消",
           value: "YQX"
+        }, {
+          label: "配件申请中",
+          value: "PJSQZ"
+        }, {
+          label: "配件已到货",
+          value: "PJYDH"
+        }, {
+          label: "配件已取消",
+          value: "PJYQX"
         }].map(item => {
           var data = res.data.find(val => val.orderStatus == item.value)
           if (data) {