codeMan 1 年之前
父节点
当前提交
afd00871a7
共有 2 个文件被更改,包括 73 次插入12 次删除
  1. 18 2
      src/DRP/HDrpManagement/calcMethod/modules/Edit.vue
  2. 55 10
      src/DRP/SDrpManagement/order/detail/index.vue

+ 18 - 2
src/DRP/HDrpManagement/calcMethod/modules/Edit.vue

@@ -29,7 +29,7 @@
           <a-col :span="12" v-if="item.param == 'value'">
             <a-form-item :label="item.paramname" :name="item.paramname" :rules="[{ required: true,validator: checkNumber,message:item.paramname }]">
               <a-input-group compact>
-                <a-select v-model:value="form['满足条件']" style="width:100px">
+                <a-select v-model:value="form['满足条件']" style="width:100px" :disabled="numDisabled">
                   <a-select-option v-for="(cond,condi) in condition" :key="condi" :value="cond.value">{{ cond.remarks }}</a-select-option>
                   <a-select-option value="Jiangsu">Jiangsu</a-select-option>
                 </a-select>
@@ -67,7 +67,7 @@
           </a-col>
           <a-col :span="12" v-if="item.param == 'isaccumulation'">
             <a-form-item :label="item.paramname" :name="item.paramname" :rules="[{ required: true,message:item.paramname }]">
-              <a-radio-group v-model:value="form[item.paramname]">
+              <a-radio-group v-model:value="form[item.paramname]" @change="isaccumulationChange">
                 <a-radio value="1">是</a-radio>
                 <a-radio value="0">否</a-radio>
               </a-radio-group>
@@ -114,6 +114,18 @@ const props = defineProps(['data','disabled'])
 
 const visible = ref(false)
 let form = ref({})
+
+let numDisabled = ref(false)
+const isaccumulationChange = (e) => {
+  let value = e.target.value
+  if(value == '1') {
+    form.value['满足条件'] = '3'
+    numDisabled.value = true
+  } else {
+    numDisabled.value = false
+  }
+}
+
 const showDrawer = ()=>{
   props.data.param.forEach(item => {
     if (item.param == 'ordertype') {
@@ -124,6 +136,10 @@ const showDrawer = ()=>{
       form.value[item.paramname] = item.value
     }
   })
+  if (form.value['满足条件']) {
+    form.value['是否累加计算'] == 1 ? form.value['满足条件'] = '3' : ''
+    form.value['是否累加计算'] == 1 ? numDisabled.value = true : numDisabled.value = false
+  }
   form.value.remarks = props.data.remarks
   console.log(form.value,'参数',props.data);
   visible.value = true

+ 55 - 10
src/DRP/SDrpManagement/order/detail/index.vue

@@ -34,7 +34,8 @@
                   <a-input-number style="width:100%" id="inputNumber" :precision="2" v-model:value="data.record.qty" :min="data.record.orderminqty" :step="data.record.orderaddqty" @blur="onAddQtyChange(data.record)"/>
                 </template>
                 <template v-if="data.column.dataIndex === 'iscustom' && data.record.iscustomsize == 1">
-                  <a-button type="link" @click="openCustom(data)">定制信息</a-button>
+                  <a-button type="link" @click="openCustom(data)" v-if="!data.record.isselect">定制信息</a-button>
+                  <a-tag v-else closable @close="closeInfo(data.record)">{{ infoFun(data.record) }}</a-tag>
                 </template>
                 <!-- <template v-if="data.column.dataIndex === 'length' && data.record.iscustomsize == 1">
                   <a-select v-if="data.record.lengthschemedetails.length > 0" v-model:value="data.record.length" style="width: 150px" placeholder="选择长度">
@@ -99,28 +100,32 @@
         <logistics-order></logistics-order>
       </template>
     </detail-template>
-    <a-modal v-model:open="open" title="定制信息" @ok="handleOk" style="text-align:left">
-      <div class="mt-10">
-        <span class="label">品名:{{prod.record.itemname}}</span>
-      </div>
-      <div class="mt-10">
-        <span class="label">品号:{{prod.record.itemno}}</span>
+    <a-modal v-model:open="open" wrapClassName="oder-modal" title="定制信息" @ok="handleOk" style="text-align:left" :closable="false">
+      <div class="mt-10" style="display: flex;justify-content: space-evenly;margin-top: 20px;">
+        <div style="display: flex;align-items: center;color: red;">
+          <span class="label">品号:{{prod.record.itemno}}</span>
+          <span class="label overflow" style="max-width: 220px;margin-left: 10px;">品名:
+            <a-tooltip placement="topLeft" :title="prod.record.itemname" arrow-point-at-center>
+              {{prod.record.itemname}}
+            </a-tooltip>
+          </span>
+        </div>
       </div>
       <div class="mt-10" v-if="prod.record.cheekschemeid > 0">
         <span class="label">工艺</span>
-        <a-select v-model:value="prod.record.customcheek" style="width: 400px;" placeholder="选择长度">
+        <a-select v-model:value="prod.record.customcheek" style="width: 400px;" placeholder="选择工艺">
           <a-select-option v-for="item in prod.record.cheekschemedetails" :key="item.sa_sizeschemedetailid" :value="item.num">{{item.num}}</a-select-option>
         </a-select>
       </div>
       <div class="mt-10" v-if="prod.record.colorschemeid > 0">
         <span class="label">颜色</span>
-        <a-select v-model:value="prod.record.customcolors" style="width: 400px" placeholder="选择长度">
+        <a-select v-model:value="prod.record.customcolors" style="width: 400px" placeholder="选择颜色">
           <a-select-option v-for="item in prod.record.colorsschemedetails" :key="item.sa_sizeschemedetailid" :value="item.num">{{item.num}}</a-select-option>
         </a-select>
       </div>
       <div class="mt-10" v-if="prod.record.materialschemeid > 0">
         <span class="label">选项</span>
-        <a-select v-model:value="prod.record.custommaterial" style="width: 400px" placeholder="选择长度">
+        <a-select v-model:value="prod.record.custommaterial" style="width: 400px" placeholder="选择选项">
           <a-select-option v-for="item in prod.record.materialschemedetails" :key="item.sa_sizeschemedetailid" :value="item.num">{{item.num}}</a-select-option>
         </a-select>
       </div>
@@ -512,6 +517,7 @@ const openCustom = (data)=>{
   prod.value = data
 }
 const handleOk = ()=>{
+  prod.value.record.isselect = true
   prodlist.value.data.some((item)=>{
     if (item.itemid == prod.value.itemid) {
       item = prod.value
@@ -519,6 +525,33 @@ const handleOk = ()=>{
   })
   open.value = false
 }
+const closeInfo = (data) => {
+  data.isselect = false
+  data.customcheek = null
+  data.customcolors = null
+  data.custommaterial = null
+  data.length = null
+  data.width = null
+}
+const infoFun = computed(() => {
+  return (data) => {
+    let customcheek = '',customcolors = '',custommaterial = '',length = '',width = ''
+    if (data.cheekschemeid > 0) customcheek = data.cheekschemedetails.filter(item => item.num == data.customcheek).length ? data.cheekschemedetails.filter(item => item.num == data.customcheek)[0].num : ''
+    if (data.colorschemeid > 0) customcolors = data.colorsschemedetails.filter(item => item.num == data.customcolors).length ? data.colorsschemedetails.filter(item => item.num == data.customcolors)[0].num : ''
+    if (data.materialschemeid > 0) custommaterial = data.materialschemedetails.filter(item => item.num == data.custommaterial).length ? data.materialschemedetails.filter(item => item.num == data.custommaterial)[0].num :''
+    if (data.spec == '自定义' || data.spec == 'custom') {
+      length = data.lengthschemedetails.filter(item => item.num == data.length).length ? data.lengthschemedetails.filter(item => item.num == data.length)[0].num : ''
+      width = data.widthschemedetails.filter(item => item.num == data.width).length ? data.widthschemedetails.filter(item => item.num == data.width)[0].num : ''
+    }
+    let result = ''
+    if (customcheek) result = result + customcheek + ','
+    if (customcolors) result = result + customcolors + ','
+    if (custommaterial) result = result + custommaterial + ','
+    if (length) result = result + length + ','
+    if (width) result = result + width + ','
+    return result
+  }
+})
 const onModeClick = async (data)=>{
   printUrl(data)
 }
@@ -556,4 +589,16 @@ onMounted (()=>{
   .mt-10{
     margin-bottom:20px
   }
+  .overflow {
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    overflow: hidden;
+  }
+  
+</style>
+<style>
+.oder-modal .ant-modal-title {
+  display: flex !important;
+  justify-content: space-evenly !important;
+}
 </style>