已添加16个文件
已重命名3个文件
已修改9个文件
已复制2个文件
已删除3个文件
| | |
| | | |
| | | this.editor.create() // çæç¼è¾å¨ |
| | | this.editor.txt.text(this.value) // çæç¼è¾å¨ |
| | | this.$emit('oninit', this.editor) |
| | | this.$emit('ok', this.editor) |
| | | } |
| | | }, |
| | | beforeCreate () { |
| | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-form-item label="容å¨ç±»åID" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»åID" v-decorator="['containerTypeId']" /> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»åID" v-decorator="['containerTypeId', {rules: [{required: true, message: '请è¾å
¥å®¹å¨ç±»åIDï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="容å¨ç±»ååç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»ååç§°" v-decorator="['containerTypeName']" /> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»ååç§°" v-decorator="['containerTypeName', {rules: [{required: true, message: '请è¾å
¥å®¹å¨ç±»ååç§°ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æç±»åID" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åID" v-decorator="['materialTypeId']" /> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åID" v-decorator="['materialTypeId', {rules: [{required: true, message: '请è¾å
¥ç©æç±»åIDï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æç±»åç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åç¼å·" v-decorator="['materialTypeCode']" /> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åç¼å·" v-decorator="['materialTypeCode', {rules: [{required: true, message: '请è¾å
¥ç©æç±»åç¼å·ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æç±»ååç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»ååç§°" v-decorator="['materialTypeName']" /> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»ååç§°" v-decorator="['materialTypeName', {rules: [{required: true, message: '请è¾å
¥ç©æç±»ååç§°ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æå®¹å¨å®¹é" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æå®¹å¨å®¹é" v-decorator="['boxQty']" /> |
| | | <a-input placeholder="请è¾å
¥ç©æå®¹å¨å®¹é" v-decorator="['boxQty', {rules: [{required: true, message: '请è¾å
¥ç©æå®¹å¨å®¹éï¼'}]}]" /> |
| | | </a-form-item> |
| | | </a-form> |
| | | </a-spin> |
| | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-form-item label="容å¨ç±»åID" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»åID" v-decorator="['containerTypeId']" /> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»åID" v-decorator="['containerTypeId', {rules: [{required: true, message: '请è¾å
¥å®¹å¨ç±»åIDï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="容å¨ç±»ååç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»ååç§°" v-decorator="['containerTypeName']" /> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»ååç§°" v-decorator="['containerTypeName', {rules: [{required: true, message: '请è¾å
¥å®¹å¨ç±»ååç§°ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æç±»åID" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åID" v-decorator="['materialTypeId']" /> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åID" v-decorator="['materialTypeId', {rules: [{required: true, message: '请è¾å
¥ç©æç±»åIDï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æç±»åç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åç¼å·" v-decorator="['materialTypeCode']" /> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åç¼å·" v-decorator="['materialTypeCode', {rules: [{required: true, message: '请è¾å
¥ç©æç±»åç¼å·ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æç±»ååç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»ååç§°" v-decorator="['materialTypeName']" /> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»ååç§°" v-decorator="['materialTypeName', {rules: [{required: true, message: '请è¾å
¥ç©æç±»ååç§°ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æå®¹å¨å®¹é" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æå®¹å¨å®¹é" v-decorator="['boxQty']" /> |
| | | <a-input placeholder="请è¾å
¥ç©æå®¹å¨å®¹é" v-decorator="['boxQty', {rules: [{required: true, message: '请è¾å
¥ç©æå®¹å¨å®¹éï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> |
| | | </a-form> |
| | |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '130px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '130px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '130px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '130px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '130px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '130px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '130px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '130px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '130px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '130px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '130px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '130px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': ''//æå°å宽设置 |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | |
| | | <add-form ref="addForm" @ok="handleOk" /> |
| | | </a-tab-pane> |
| | | <a-tab-pane key="2" tab="æ§å¶å±æ§" force-render> |
| | | Content of Tab Pane 2 |
| | | <add-control-rule ref="WmsControlRule" @ok="handleOk" /> |
| | | </a-tab-pane> |
| | | <a-tab-pane key="3" tab="æ¹æ¬¡å±æ§"> |
| | | éæ±å¾
å® |
| | |
| | | <script> |
| | | import { WmsMaterialAdd, GetAreas, GetStations } from '@/api/modular/main/WmsMaterialManage' |
| | | import addForm from './tabItem/addForm.vue' |
| | | import addFormBaseCustomer from './tabItem/addFormBaseCustomer.vue' |
| | | import addFormContainerPackaging from './tabItem/addFormContainerPackaging.vue' |
| | | import addFormSub from './tabItem/addFormWmsSubstituteGood.vue' |
| | | import addFormBaseCustomer from './tabItem/addFormBaseCustomer/addFormBaseCustomer.vue' |
| | | import addFormContainerPackaging from './tabItem/WmsContainerPackaging/addFormContainerPackaging.vue' |
| | | import addFormSub from './tabItem/WmsSubstituteGood/addFormWmsSubstituteGood.vue' |
| | | import addControlRule from './tabItem/WmsControlRule/index.vue' |
| | | |
| | | export default { |
| | | components: { |
| | | addForm, |
| | | addFormBaseCustomer, |
| | | addFormContainerPackaging, |
| | | addFormSub |
| | | addFormSub, |
| | | addControlRule |
| | | }, |
| | | data() { |
| | | return { |
ÎļþÃû´Ó iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/addFormContainerPackaging.vue ÐÞ¸Ä |
| | |
| | | <template> |
| | | <!-- å
è£
å
³ç³»åºç¡è¡¨ --> |
| | | <a-form :form="form"> |
| | | <a-modal |
| | | title="æ°å¢å
è£
å
³ç³»åºç¡è¡¨" |
| | | :width="900" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | @ok="handleSubmit" |
| | | @cancel="handleCancel"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-form-item label="容å¨ç±»åID" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»åID" v-decorator="['containerTypeId']" /> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»åID" v-decorator="['containerTypeId', {rules: [{required: true, message: '请è¾å
¥å®¹å¨ç±»åIDï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="容å¨ç±»ååç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»ååç§°" v-decorator="['containerTypeName']" /> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»ååç§°" v-decorator="['containerTypeName', {rules: [{required: true, message: '请è¾å
¥å®¹å¨ç±»ååç§°ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æç±»åID" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åID" v-decorator="['materialTypeId']" /> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åID" v-decorator="['materialTypeId', {rules: [{required: true, message: '请è¾å
¥ç©æç±»åIDï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æç±»åç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åç¼å·" v-decorator="['materialTypeCode']" /> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åç¼å·" v-decorator="['materialTypeCode', {rules: [{required: true, message: '请è¾å
¥ç©æç±»åç¼å·ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æç±»ååç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»ååç§°" v-decorator="['materialTypeName']" /> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»ååç§°" v-decorator="['materialTypeName', {rules: [{required: true, message: '请è¾å
¥ç©æç±»ååç§°ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æå®¹å¨å®¹é" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æå®¹å¨å®¹é" v-decorator="['boxQty']" /> |
| | | <a-input placeholder="请è¾å
¥ç©æå®¹å¨å®¹é" v-decorator="['boxQty', {rules: [{required: true, message: '请è¾å
¥ç©æå®¹å¨å®¹éï¼'}]}]" /> |
| | | </a-form-item> |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- å
è£
å
³ç³» --> |
| | | <div style="background-color: white"> |
| | | <!-- <a-spin :spinning="loading"> --> |
| | | <div class="wms-task-management-detail-div"> |
| | | <div class="drawer-content"> |
| | | <!-- <span style="font-weight:bold;cursor:default;"> |
| | | <a style="cursor:default;">{{ row.no }}</a>åæ®è¯¦æ
|
| | | </span> --> |
| | | <div style="margin-top: 10px;"> |
| | | <a-table :columns="columns" :data-source="list" row-key="id" :pagination="false" :scroll="{ x: true }"> |
| | | <template slot="index" slot-scope="text, record, index">{{ index + 1 }}</template> |
| | | <span slot="containerStatusscopedSlots" slot-scope="text"> |
| | | <a-tag :color="text == '1' ? '#daa520' : text == '2' ? '#cd5c5c' : text == '3' ? '#add8e6' : '#696969'">{{ |
| | | 'orderdetails_statusenum' | dictType(text) |
| | | }}</a-tag> |
| | | </span> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a-popconfirm v-if="hasPerm('BaseCustomer:delete')" placement="topRight" title="确认å é¤ï¼" |
| | | @confirm="() => itemDelete(record, index)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | </div> |
| | | |
| | | <p @click="visible = true">æ°å¢è¡</p> |
| | | |
| | | <a-modal title="å
è£
å
³ç³»" :width="900" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit" |
| | | @cancel="handleCancel"> |
| | | <show-list ref="showList" @ok="handleOk" /> |
| | | <!-- <a-spin :spinning="confirmLoading"></a-spin> --> |
| | | </a-modal> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { WmsOrderRukuDetail } from '@/api/modular/main/WmsOrderManage' |
| | | import showList from './index.vue' |
| | | |
| | | export default { |
| | | name: 'wmsOrderRukuManagementDetailDrawer', |
| | | emits: ['update:visible'], |
| | | props: { |
| | | visible: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | row: { |
| | | type: Object, |
| | | default: function () { |
| | | return {} |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | showList |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | containerStatusData: [], |
| | | list: [], |
| | | columns: [ |
| | | { |
| | | dataIndex: 'index', |
| | | title: 'åºå·', |
| | | fixed: 'left', |
| | | width: '60', |
| | | scopedSlots: { customRender: 'index' }, |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '容å¨ç±»ååç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'containerTypeName' |
| | | }, |
| | | { |
| | | title: 'ç©æç±»åç¼å·', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'materialTypeCode' |
| | | }, |
| | | { |
| | | title: 'ç©æç±»ååç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'materialTypeName' |
| | | }, |
| | | { |
| | | title: 'ç©æå®¹å¨å®¹é', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'boxQty' |
| | | }, |
| | | ], |
| | | // å页 |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30', '40'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + 'å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0, |
| | | size: 'small' |
| | | } |
| | | } |
| | | }, |
| | | |
| | | created() { |
| | | const containerStatusOption = this.$options |
| | | this.containerStatusData = containerStatusOption.filters['dictData']('orderdetails_statusenum') |
| | | |
| | | this.columns.push({ |
| | | title: 'æä½', |
| | | width: '150px', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' } |
| | | }) |
| | | }, |
| | | methods: { |
| | | onClose() { |
| | | this.close() |
| | | }, |
| | | close() { |
| | | this.$emit('update:visible', false) |
| | | }, |
| | | afterVisibleChange(visible) { |
| | | if (visible) { |
| | | this.initShow() |
| | | } else { |
| | | this.afterClsoe() |
| | | } |
| | | }, |
| | | initShow() { |
| | | this.loading = true |
| | | this.getList(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | getList(row) { |
| | | let params = { id: row.id } |
| | | WmsOrderRukuDetail(params) |
| | | .then(d => { |
| | | this.list = d.data.rows || [] |
| | | this.$emit('update:visible', true) |
| | | // callback && callback(true) |
| | | }) |
| | | .catch(() => { |
| | | this.$emit('update:visible', false) |
| | | this.list = [] |
| | | // callback && callback(false) |
| | | }) |
| | | }, |
| | | afterClsoe() { |
| | | this.list = [] |
| | | }, |
| | | handleOk(param) { |
| | | this.list = param |
| | | }, |
| | | handleSubmit() { |
| | | this.visible = false |
| | | }, |
| | | handleCancel() { |
| | | this.visible = false |
| | | }, |
| | | itemDelete(record, index) { |
| | | this.list.splice(index, 1) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .wms-task-management-detail-div { |
| | | height: 100%; |
| | | overflow: auto; |
| | | |
| | | .drawer-content { |
| | | padding: 16px; |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | title="ç¼è¾å
è£
å
³ç³»åºç¡è¡¨" |
| | | :width="900" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | @ok="handleSubmit" |
| | | @cancel="handleCancel"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-form-item label="容å¨ç±»åID" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»åID" v-decorator="['containerTypeId', {rules: [{required: true, message: '请è¾å
¥å®¹å¨ç±»åIDï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="容å¨ç±»ååç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥å®¹å¨ç±»ååç§°" v-decorator="['containerTypeName', {rules: [{required: true, message: '请è¾å
¥å®¹å¨ç±»ååç§°ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æç±»åID" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åID" v-decorator="['materialTypeId', {rules: [{required: true, message: '请è¾å
¥ç©æç±»åIDï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æç±»åç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»åç¼å·" v-decorator="['materialTypeCode', {rules: [{required: true, message: '请è¾å
¥ç©æç±»åç¼å·ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æç±»ååç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æç±»ååç§°" v-decorator="['materialTypeName', {rules: [{required: true, message: '请è¾å
¥ç©æç±»ååç§°ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="ç©æå®¹å¨å®¹é" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥ç©æå®¹å¨å®¹é" v-decorator="['boxQty', {rules: [{required: true, message: '请è¾å
¥ç©æå®¹å¨å®¹éï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment' |
| | | import { |
| | | WmsContainerPackagingEdit |
| | | } from '@/api/modular/main/WmsBase/WmsContainerPackagingManage' |
| | | export default { |
| | | data () { |
| | | return { |
| | | Id: 0, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 15 } |
| | | }, |
| | | record: {}, |
| | | visible: false, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this) |
| | | } |
| | | }, |
| | | methods: { |
| | | moment, |
| | | // åå§åæ¹æ³ |
| | | edit (record) { |
| | | this.visible = true; |
| | | this.Id = record.id; |
| | | this.$nextTick(() => { |
| | | }); |
| | | //深度æ·è´ ç§»é¤VUEççå¬ï¼é²æ¢INDEX页é¢å¼åå¨ |
| | | this.record = JSON.parse(JSON.stringify(record)) |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue( |
| | | { |
| | | id: record.id, |
| | | containerTypeId: record.containerTypeId, |
| | | containerTypeName: record.containerTypeName, |
| | | materialTypeId: record.materialTypeId, |
| | | materialTypeCode: record.materialTypeCode, |
| | | materialTypeName: record.materialTypeName, |
| | | boxQty: record.boxQty |
| | | } |
| | | ) |
| | | }) |
| | | }, |
| | | handleSubmit () { |
| | | const { form: { validateFields } } = this |
| | | this.confirmLoading = true |
| | | validateFields((errors, values) => { |
| | | if (!errors) { |
| | | for (const key in values) { |
| | | if (values[key] == null) continue |
| | | if (typeof (values[key]) === 'object') { |
| | | values[key] = JSON.stringify(values[key]) |
| | | this.record[key] = values[key] |
| | | } else { |
| | | this.record[key] = values[key] |
| | | } |
| | | } |
| | | WmsContainerPackagingEdit(this.record).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success('ç¼è¾æå') |
| | | this.confirmLoading = false |
| | | this.$emit('ok', this.record) |
| | | this.handleCancel() |
| | | } else { |
| | | this.$message.error('ç¼è¾å¤±è´¥ï¼' + JSON.stringify(res.message)) |
| | | } |
| | | }).finally((res) => { |
| | | this.confirmLoading = false |
| | | }) |
| | | }else{ |
| | | this.confirmLoading = false |
| | | } |
| | | }); |
| | | }, |
| | | handleCancel () { |
| | | this.form.resetFields() |
| | | this.visible = false |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :width="850" |
| | | :destroyOnClose="true" |
| | | :visible="visible" |
| | | :forceRender="true" |
| | | title="æ¹é导å
¥" |
| | | cancelText="åæ¶ä¸ä¼ " |
| | | okText="å¼å§ä¸ä¼ " |
| | | @cancel="handleCancel" |
| | | @ok="handleSubmit"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-row :span="24"> |
| | | <span>è¯·éæ©è¦å¯¼å
¥çæ°æ®æä»¶ï¼Excelæ ¼å¼ï¼</span> |
| | | </a-row> |
| | | <p></p> |
| | | <a-row> |
| | | <a-col :span="16"> |
| | | <a-upload-dragger accept=".xlsx,.xls" :multiple="false" :customRequest="customRequest" @change="handleChange" :beforeUpload="beforeUpload"> |
| | | <a-icon style="font-size: 40px;" type="cloud-upload" /> |
| | | </a-upload-dragger> |
| | | </a-col> |
| | | <!--<a-col :span="8"> |
| | | <span>导å
¥æ¨¡å¼ï¼</span> |
| | | <a-select |
| | | style="width: 130px" |
| | | placeholder="è¯·éæ©å¯¼å
¥æ¨¡å¼" |
| | | v-model="importExcelType"> |
| | | <a-select-option |
| | | v-for="(item,index) in importExcelTypeData" |
| | | :key="index" |
| | | :value="item.code">{{ item.name }} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-col>--> |
| | | </a-row> |
| | | <a-row :span="24"> |
| | | <!--<a-button @click="showDemand" style="width: 150px;text-align: left;" type="link" v-show="!detailed"> |
| | | ç¹å»æ¥çæä»¶ä¸ä¼ è¦æ± |
| | | </a-button>--> |
| | | <span>ã</span> |
| | | <a-button style="width: 90px;text-align: left;" @click="wmsContainerPackagingDownloadExcelTemplate" type="link">ä¸è½½å¯¼å
¥æ¨¡æ¿</a-button>ï¼å¡«åå¹¶ä¸ä¼ |
| | | <span>ã</span> |
| | | <a-button @click="showDemand" style="width: 150px;text-align: left;" type="link" v-show="detailed"> |
| | | æ¶èµ· |
| | | </a-button> |
| | | </a-row> |
| | | <a-row v-show="detailed" style="background: #fef4e8; height: 30px;" :span="24"> |
| | | <a-breadcrumb> |
| | | <a-breadcrumb-item style="line-height: 30px;color: #faad14;margin-left: 18px;">æä»¶ä¸ä¼ è¦æ±</a-breadcrumb-item> |
| | | </a-breadcrumb> |
| | | </a-row> |
| | | <pre v-show="detailed"> |
| | | <div v-html="demandText"></div> |
| | | </pre> |
| | | <a-table v-show="detailed" :columns="columns" :data-source="dataList" :rowKey="(record) => record.processID" :pagination="false"></a-table> |
| | | <pre v-show="detailed"> |
| | | <div v-html="columnText"></div> |
| | | </pre> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { downloadFile, checkFile, parseExcelFieldText, parseDemandText } from '@/utils/util' |
| | | |
| | | import { WmsContainerPackagingImportExcel, WmsContainerPackagingDownloadExcelTemplate} from '@/api/modular/main/WmsBase/WmsContainerPackagingManage' |
| | | import { sysExcelTemplateGetColumnList } from '@/api/modular/system/excelTemplateManage' |
| | | export default { |
| | | components: { |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | detailed: false, |
| | | confirmLoading: false, |
| | | fileList: [], |
| | | importExcelTypeData: [], |
| | | importExcelType: '1', |
| | | uploadFile: null, |
| | | columns: [], |
| | | dataList: [], |
| | | demandText:'', |
| | | columnText: '' |
| | | } |
| | | }, |
| | | methods: { |
| | | index() { |
| | | this.visible = true; |
| | | this.importExcelTypeData = this.$options.filters['dictData']('import_excel_type') |
| | | this.demandText = parseDemandText("wmsContainerPackagingDownloadExcelTemplate") |
| | | window.downloadFile = this.wmsContainerPackagingDownloadExcelTemplate; |
| | | this.getTable(); |
| | | }, |
| | | showDemand() { |
| | | this.detailed = !this.detailed; |
| | | }, |
| | | customRequest(document) { |
| | | this.uploadFile = document |
| | | }, |
| | | getTable() { |
| | | sysExcelTemplateGetColumnList({className: "WmsContainerPackaging"}).then(res => |
| | | { |
| | | if (res.success) { |
| | | this.columns =[]; |
| | | this.dataList = [{}]; |
| | | res.data.forEach(x => { |
| | | this.columns.push({ |
| | | dataIndex: x.columnName, |
| | | key: x.columnName, |
| | | title: x.columnComment |
| | | }); |
| | | this.dataList[0][x.columnName] = x.isRequired ? "å¿
å¡«" : "éå¿
å¡«" |
| | | }); |
| | | this.columnText = parseExcelFieldText(res.data); |
| | | } |
| | | }); |
| | | }, |
| | | beforeUpload(fileInfo) { |
| | | let res = checkFile(fileInfo, 1073741824, ['.xlsx', '.xls']); |
| | | if (!res.success) { |
| | | this.$message.warning(res.msg) |
| | | return false |
| | | } |
| | | setTimeout(() => {this.uploadFile.onSuccess(this.uploadFile.file)}, 1000) |
| | | }, |
| | | handleChange(fileInfo) { |
| | | if (fileInfo.file.status === 'error') { |
| | | fileInfo.fileList.splice(0, 1) |
| | | } |
| | | if (fileInfo.file.status === 'done') { |
| | | if (fileInfo.fileList.length > 1) { |
| | | fileInfo.fileList.splice(0, 1) |
| | | } |
| | | this.fileList = fileInfo.file |
| | | } |
| | | }, |
| | | handleSubmit() { |
| | | this.confirmLoading = true |
| | | const formData = new FormData() |
| | | formData.append('file', this.uploadFile.file) |
| | | WmsContainerPackagingImportExcel(formData, {importExcelType: this.importExcelType}).then(res => { |
| | | this.$message.success('æä½æå') |
| | | this.confirmLoading = false |
| | | this.$emit('ok', []) |
| | | this.handleCancel() |
| | | }).finally((res)=>{this.confirmLoading = false}) |
| | | }, |
| | | handleCancel() { |
| | | this.visible = false |
| | | this.detailed = false |
| | | }, |
| | | wmsContainerPackagingDownloadExcelTemplate() { |
| | | WmsContainerPackagingDownloadExcelTemplate({version: "v2"}).then((res) => { |
| | | downloadFile(res); |
| | | }).catch((err) => { |
| | | this.$message.error('ä¸è½½é误ï¼è·åæä»¶æµé误' + err) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | ::v-deep .ant-upload.ant-upload-drag { |
| | | position: relative; |
| | | width: 140px; |
| | | height: 135px; |
| | | text-align: center; |
| | | background: #fafafa; |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 2px; |
| | | cursor: pointer; |
| | | -webkit-transition: border-color 0.3s; |
| | | transition: border-color 0.3s; |
| | | } |
| | | ::v-deep .ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger), .ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger) { |
| | | color: #ffc53d; |
| | | border-color: white; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div ref="boxOutWrap" class="boxOutWrap"> |
| | | <div ref="boxForm" class="boxForm"> |
| | | <a-card :bordered="false" :bodyStyle="tstyle"> |
| | | <div class="table-page-search-wrapper" v-if="hasPerm('WmsContainerPackaging:page')"> |
| | | <a-form layout="inline"> |
| | | <a-row :gutter="48"> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="容å¨ç±»åID"> |
| | | <a-input v-model="queryParam.containerTypeId" allow-clear placeholder="请è¾å
¥å®¹å¨ç±»åID" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="容å¨ç±»ååç§°"> |
| | | <a-input v-model="queryParam.containerTypeName" allow-clear placeholder="请è¾å
¥å®¹å¨ç±»ååç§°" /> |
| | | </a-form-item> </a-col |
| | | ><template v-if="advanced"> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ç©æç±»åID"> |
| | | <a-input v-model="queryParam.materialTypeId" allow-clear placeholder="请è¾å
¥ç©æç±»åID" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ç©æç±»åç¼å·"> |
| | | <a-input v-model="queryParam.materialTypeCode" allow-clear placeholder="请è¾å
¥ç©æç±»åç¼å·" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ç©æç±»ååç§°"> |
| | | <a-input v-model="queryParam.materialTypeName" allow-clear placeholder="请è¾å
¥ç©æç±»ååç§°" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ç©æå®¹å¨å®¹é"> |
| | | <a-input v-model="queryParam.boxQty" allow-clear placeholder="请è¾å
¥ç©æå®¹å¨å®¹é" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <!--å¹´ææ¥æ¶åç§--> |
| | | <!--æ¶é´èå´--> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="å建æ¶é´"> |
| | | <a-range-picker |
| | | style="width: 100%" |
| | | :placeholder="['å¼å§æ¶é´', 'ç»ææ¶é´']" |
| | | :show-time="{ |
| | | format: 'HH:mm:ss', |
| | | defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')] |
| | | }" |
| | | v-model="queryParam.createdTime" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | @change="onChangecreatedTime" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <!--å¹´ææ¥æ¶åç§--> |
| | | <!--æ¶é´èå´--> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ´æ°æ¶é´"> |
| | | <a-range-picker |
| | | style="width: 100%" |
| | | :placeholder="['å¼å§æ¶é´', 'ç»ææ¶é´']" |
| | | :show-time="{ |
| | | format: 'HH:mm:ss', |
| | | defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')] |
| | | }" |
| | | v-model="queryParam.updatedTime" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | @change="onChangeupdatedTime" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="å建è
åç§°"> |
| | | <a-input v-model="queryParam.createdUserName" allow-clear placeholder="请è¾å
¥å建è
åç§°" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ä¿®æ¹è
åç§°"> |
| | | <a-input v-model="queryParam.updatedUserName" allow-clear placeholder="请è¾å
¥ä¿®æ¹è
åç§°" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </template> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <span class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="$refs.table.refresh(true)">æ¥è¯¢</a-button> |
| | | <a-button style="margin-left: 8px" @click="() => (queryParam = {})">éç½®</a-button> |
| | | <a @click="toggleAdvanced" style="margin-left: 8px"> |
| | | {{ advanced ? 'æ¶èµ·' : 'å±å¼' }} |
| | | <a-icon :type="advanced ? 'up' : 'down'" /> |
| | | </a> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | </a-card> |
| | | </div> |
| | | <a-card :bordered="false"> |
| | | <s-table |
| | | ref="table" |
| | | :columns="columns" |
| | | :data="loadData" |
| | | :alert="true" |
| | | @changeTablePage="pageInfo = $event" |
| | | :scroll="{ x: true, y: tableHeight }" |
| | | :rowKey="record => record.id" |
| | | :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" |
| | | > |
| | | <template class="table-operator" slot="operator" v-if="hasPerm('WmsContainerPackaging:add')"> |
| | | <!-- <div ref="actionBar" class="actionBar"> |
| | | <a-button type="info" v-if="hasPerm('sysExcelTemplate:importExcel')" icon="upload" @click="$refs.excelForm.index()"> |
| | | 导å
¥ |
| | | </a-button> |
| | | <a-button type="info" v-if="hasPerm('WmsContainerPackaging:exportExcel')" icon="download" @click="WmsContainerPackagingToExcel()"> |
| | | å¯¼åº |
| | | </a-button> |
| | | <a-button type="primary" v-if="hasPerm('WmsContainerPackaging:add')" icon="plus" @click="$refs.addForm.add()">æ°å¢å
è£
å
³ç³»åºç¡è¡¨</a-button> |
| | | </div> --> |
| | | </template> |
| | | <!-- <span slot="action" slot-scope="text, record"> |
| | | |
| | | <a v-if="hasPerm('WmsContainerPackaging:edit')" @click="$refs.editForm.edit(record)">ç¼è¾</a> |
| | | <a-divider type="vertical" v-if="hasPerm('WmsContainerPackaging:edit') & hasPerm('WmsContainerPackaging:delete')"/> |
| | | <a-popconfirm v-if="hasPerm('WmsContainerPackaging:delete')" placement="topRight" title="确认å é¤ï¼" @confirm="() => WmsContainerPackagingDelete(record)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> --> |
| | | </s-table> |
| | | <add-form ref="addForm" @ok="handleOk" /> |
| | | <edit-form ref="editForm" @ok="handleOk" /> |
| | | <excel-form ref="excelForm" @ok="handleOk" /> |
| | | </a-card> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { STable } from '@/components' |
| | | import moment from 'moment' |
| | | import { |
| | | WmsContainerPackagingPage, |
| | | WmsContainerPackagingDelete, |
| | | WmsContainerPackagingToExcel |
| | | } from '@/api/modular/main/WmsBase/WmsContainerPackagingManage' |
| | | //èªå®ä¹tableé«åº¦ |
| | | import setTableHtMixin from '@/mixins/handleTableHt.js' |
| | | import addForm from './addForm.vue' |
| | | import { exportExcel } from '@/utils/exportToExcel' |
| | | import { downloadFile } from '@/utils/util' |
| | | import editForm from './editForm.vue' |
| | | import excelForm from './excelForm.vue' |
| | | export default { |
| | | mixins: [setTableHtMixin], |
| | | components: { |
| | | STable, |
| | | addForm, |
| | | editForm, |
| | | excelForm |
| | | }, |
| | | data() { |
| | | return { |
| | | advanced: false, // é«çº§æç´¢ å±å¼/å
³é |
| | | queryParam: {}, |
| | | pageInfo: { |
| | | current: 1, |
| | | pageSize: 10 |
| | | }, |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | width: '60px', |
| | | align: 'center', |
| | | customRender: (text, record, index) => `${index + 1 + (this.pageInfo.current - 1) * this.pageInfo.pageSize}` |
| | | }, |
| | | { |
| | | title: '容å¨ç±»åID', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'containerTypeId' |
| | | }, |
| | | { |
| | | title: '容å¨ç±»ååç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'containerTypeName' |
| | | }, |
| | | { |
| | | title: 'ç©æç±»åID', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'materialTypeId' |
| | | }, |
| | | { |
| | | title: 'ç©æç±»åç¼å·', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'materialTypeCode' |
| | | }, |
| | | { |
| | | title: 'ç©æç±»ååç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'materialTypeName' |
| | | }, |
| | | { |
| | | title: 'ç©æå®¹å¨å®¹é', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '130px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'boxQty' |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'createdTime' |
| | | }, |
| | | { |
| | | title: 'æ´æ°æ¶é´', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'updatedTime' |
| | | }, |
| | | { |
| | | title: 'å建è
åç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'createdUserName' |
| | | }, |
| | | { |
| | | title: 'ä¿®æ¹è
åç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'updatedUserName' |
| | | } |
| | | ], |
| | | tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, |
| | | // å è½½æ°æ®æ¹æ³ å¿
须为 Promise 对象 |
| | | loadData: parameter => { |
| | | return WmsContainerPackagingPage(Object.assign(parameter, this.switchingDate())).then(res => { |
| | | return res.data |
| | | }) |
| | | }, |
| | | selectedRowKeys: [], |
| | | selectedRows: [] |
| | | } |
| | | }, |
| | | created() { |
| | | // if (this.hasPerm('WmsContainerPackaging:edit') || this.hasPerm('WmsContainerPackaging:delete')) { |
| | | // this.columns.push({ |
| | | // title: 'æä½', |
| | | // width: '150px', |
| | | // dataIndex: 'action', |
| | | // scopedSlots: { customRender: 'action' } |
| | | // }) |
| | | // } |
| | | const path = this.$route.path |
| | | const columnStr = window.localStorage.getItem(path) |
| | | if (columnStr) { |
| | | var _columns = JSON.parse(columnStr) |
| | | this.columns.forEach(element => { |
| | | var fObj = _columns.find((item, index) => { |
| | | return item.dataIndex === element.dataIndex |
| | | }) |
| | | if (fObj != undefined && fObj != null) { |
| | | element.checked = fObj.checked |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.handleTableHt() //è®¾ç½®ä¸»è¡¨è¡¨æ ¼é«åº¦ |
| | | window.addEventListener( |
| | | 'resize', |
| | | () => { |
| | | this.handleTableHt() // çå¬å±å¹å¤§å°æ¹åè¡¨æ ¼é«åº¦ |
| | | }, |
| | | false |
| | | ) |
| | | }, |
| | | methods: { |
| | | moment, |
| | | /** |
| | | * æ¥è¯¢åæ°ç»è£
|
| | | */ |
| | | switchingDate() { |
| | | const obj = JSON.parse(JSON.stringify(this.queryParam)) |
| | | return obj |
| | | }, |
| | | WmsContainerPackagingDelete(record) { |
| | | WmsContainerPackagingDelete(record).then(res => { |
| | | if (res.success) { |
| | | this.$message.success('å 餿å') |
| | | this.$refs.table.refresh() |
| | | } else { |
| | | this.$message.error('å é¤å¤±è´¥') // + res.message |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | WmsContainerPackagingToExcel() { |
| | | this.loading = true |
| | | let entozh = {} |
| | | const path = this.$route.path |
| | | if (window.localStorage.getItem(path)) { |
| | | JSON.parse(window.localStorage.getItem(path)).forEach(item => { |
| | | if (item.dataIndex != 'action' && item.checked) { |
| | | entozh[item.dataIndex] = item.title |
| | | } |
| | | }) |
| | | } else { |
| | | //ç´æ¥ç¹å¯¼åº |
| | | this.columns.forEach(item => { |
| | | if (item.dataIndex != 'action') { |
| | | entozh[item.dataIndex] = item.title |
| | | } |
| | | }) |
| | | } |
| | | WmsContainerPackagingPage(Object.assign({ pageSize: 100000, pageIndex: 1 }, this.queryParam)) |
| | | .then(res => { |
| | | this.loading = false |
| | | //éè¦æªåæ¥æçåæ®µ |
| | | var arrDataCutout = this.columns.filter(v => v.customCutout == true) |
| | | res.data.rows.forEach(item => { |
| | | var arrKeys = Object.keys(item) |
| | | arrKeys.forEach(key => { |
| | | var strFieldDic = key + 'Data' |
| | | //æä¸¾è½¬å¼ |
| | | if (this[strFieldDic] && this[strFieldDic].length > 0) { |
| | | let arrFieldDic = this[strFieldDic].filter(v => String(v.code) == String(item[key])) |
| | | if (arrFieldDic.length > 0) { |
| | | item[key] = arrFieldDic[0]?.name || '没ææä¸¾å¼' |
| | | } |
| | | } |
| | | // æ¥ææªå |
| | | if (arrDataCutout.length > 0) { |
| | | arrDataCutout.forEach(itemIn => { |
| | | if (key == itemIn.dataIndex && item[key]) { |
| | | item[key] = item[key].split(' ')[0] |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | exportExcel(res.data.rows, entozh, 'xlsx', `${this.$route.meta.title}`) |
| | | }) |
| | | .catch(err => { |
| | | this.loading = false |
| | | this.$message.error('ä¸è½½é误ï¼è·åæä»¶æµé误' + err) |
| | | }) |
| | | }, |
| | | |
| | | toggleAdvanced() { |
| | | this.advanced = !this.advanced |
| | | this.handleTableHt() //è®¾ç½®ä¸»è¡¨è¡¨æ ¼é«åº¦ |
| | | }, |
| | | onChangecreatedTime(date, dateString) { |
| | | this.queryParam.createdTime = dateString |
| | | }, |
| | | onChangeupdatedTime(date, dateString) { |
| | | this.queryParam.updatedTime = dateString |
| | | }, |
| | | handleOk() { |
| | | this.$refs.table.refresh() |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectedRows) { |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.selectedRows = selectedRows |
| | | this.$emit('ok', selectedRows) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="less"> |
| | | .table-operator { |
| | | margin-bottom: 18px; |
| | | } |
| | | button { |
| | | margin-right: 8px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | title="æ°å¢æ§å¶å±æ§è§å" |
| | | :width="900" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | @ok="handleSubmit" |
| | | @cancel="handleCancel"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-form-item label="è§åç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥è§åç¼å·" v-decorator="['ruleCode', {rules: [{required: true, message: '请è¾å
¥è§åç¼å·ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="è§ååç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥è§ååç§°" v-decorator="['ruleName', {rules: [{required: true, message: '请è¾å
¥è§ååç§°ï¼'}]}]" /> |
| | | </a-form-item> |
| | | <a-form-item label="è§åæè¿°" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥è§åæè¿°" v-decorator="['ruleDesc']" /> |
| | | </a-form-item> |
| | | <a-form-item label="æ¯å¦ç¦ç¨" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-switch v-decorator="['isDisabled',{rules: [{ required: true, message: 'è¯·éæ©æ¯å¦ç¦ç¨ï¼' }], valuePropName: 'checked'}]" /> |
| | | </a-form-item> |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment' |
| | | import { |
| | | WmsControlRuleAdd |
| | | } from '@/api/modular/main/WmsBase/WmsControlRuleManage' |
| | | export default { |
| | | data () { |
| | | return { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 15 } |
| | | }, |
| | | visible: false, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this) |
| | | } |
| | | }, |
| | | methods: { |
| | | moment, |
| | | // åå§åæ¹æ³ |
| | | add (record) { |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | |
| | | }); |
| | | }, |
| | | /** |
| | | * æäº¤è¡¨å |
| | | */ |
| | | handleSubmit () { |
| | | const { form: { validateFields } } = this |
| | | this.confirmLoading = true |
| | | validateFields((errors, values) => { |
| | | if (!errors) { |
| | | for (const key in values) { |
| | | if (typeof (values[key]) === 'object') { |
| | | values[key] = JSON.stringify(values[key]) |
| | | } |
| | | } |
| | | WmsControlRuleAdd(values).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.confirmLoading = false |
| | | this.$emit('ok', values) |
| | | this.handleCancel() |
| | | } else { |
| | | this.$message.error('æ°å¢å¤±è´¥ï¼' + JSON.stringify(res.message)) |
| | | } |
| | | }).finally((res) => { |
| | | this.confirmLoading = false |
| | | }) |
| | | } else { |
| | | this.confirmLoading = false |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.form.resetFields() |
| | | this.visible = false |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div ref="boxOutWrap" class="boxOutWrap"> |
| | | <div ref="boxForm" class="boxForm"> |
| | | <a-card :bordered="false" :bodyStyle="tstyle"> |
| | | |
| | | <div class="table-page-search-wrapper" v-if="hasPerm('WmsControlRuleDetail:page')"> |
| | | <a-form layout="inline"> |
| | | <a-row :gutter="48"> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ§å¶å±æ§è§åID"> |
| | | <a-input v-model="queryParam.controlRuleId" allow-clear placeholder="请è¾å
¥æ§å¶å±æ§è§åID"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æé«åºå"> |
| | | <a-input v-model="queryParam.maxImumqty" allow-clear placeholder="请è¾å
¥æé«åºå"/> |
| | | </a-form-item> |
| | | </a-col><template v-if="advanced"> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æä½åºå"> |
| | | <a-input v-model="queryParam.minImumqty" allow-clear placeholder="请è¾å
¥æä½åºå"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="å®å
¨åºå"> |
| | | <a-input v-model="queryParam.safeImumqty" allow-clear placeholder="请è¾å
¥å®å
¨åºå"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æå°åºé¾"> |
| | | <a-input v-model="queryParam.minStorageAge" allow-clear placeholder="请è¾å
¥æå°åºé¾"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æå¤§åºé¾"> |
| | | <a-input v-model="queryParam.maxStorageAge" allow-clear placeholder="请è¾å
¥æå¤§åºé¾"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ¯å¦å
æ£"> |
| | | <a-select :allowClear="true" style="width: 100%" v-model="queryParam.isNotChek" placeholder="è¯·éæ©æ¯å¦å
æ£"> |
| | | <a-select-option v-for="(item,index) in isNotChekData" :key="index" :value="item.code">{{ item.name }}</a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ä¿è´¨æå¤©æ°"> |
| | | <a-input v-model="queryParam.shelfLifeDays" allow-clear placeholder="请è¾å
¥ä¿è´¨æå¤©æ°"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ¯å¦ç¦ç¨"> |
| | | <a-select :allowClear="true" style="width: 100%" v-model="queryParam.isDisabled" placeholder="è¯·éæ©æ¯å¦ç¦ç¨"> |
| | | <a-select-option v-for="(item,index) in isDisabledData" :key="index" :value="item.code">{{ item.name }}</a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | <!--å¹´ææ¥æ¶åç§--> |
| | | <!--æ¶é´èå´--> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="å建æ¶é´"> |
| | | <a-range-picker style="width: 100%" :placeholder="['å¼å§æ¶é´', 'ç»ææ¶é´']" :show-time="{ |
| | | format: 'HH:mm:ss', defaultValue: [moment('00:00:00', 'HH:mm:ss'),moment('23:59:59', 'HH:mm:ss')]}" v-model="queryParam.createdTime" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" @change="onChangecreatedTime"/> |
| | | |
| | | </a-form-item> |
| | | </a-col> |
| | | <!--å¹´ææ¥æ¶åç§--> |
| | | <!--æ¶é´èå´--> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ´æ°æ¶é´"> |
| | | <a-range-picker style="width: 100%" :placeholder="['å¼å§æ¶é´', 'ç»ææ¶é´']" :show-time="{ |
| | | format: 'HH:mm:ss', defaultValue: [moment('00:00:00', 'HH:mm:ss'),moment('23:59:59', 'HH:mm:ss')]}" v-model="queryParam.updatedTime" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" @change="onChangeupdatedTime"/> |
| | | |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="å建è
åç§°"> |
| | | <a-input v-model="queryParam.createdUserName" allow-clear placeholder="请è¾å
¥å建è
åç§°"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ä¿®æ¹è
åç§°"> |
| | | <a-input v-model="queryParam.updatedUserName" allow-clear placeholder="请è¾å
¥ä¿®æ¹è
åç§°"/> |
| | | </a-form-item> |
| | | </a-col> </template> |
| | | |
| | | <a-col :md="8" :sm="24" > |
| | | <span class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="$refs.table.refresh(true)" >æ¥è¯¢</a-button> |
| | | <a-button style="margin-left: 8px" @click="() => queryParam = {}">éç½®</a-button> |
| | | <a @click="toggleAdvanced" style="margin-left: 8px"> {{ advanced ? 'æ¶èµ·' : 'å±å¼' }} |
| | | <a-icon :type="advanced ? 'up' : 'down'"/> |
| | | </a> |
| | | </span> |
| | | </a-col> |
| | | |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | </a-card> |
| | | </div> |
| | | <a-card :bordered="false"> |
| | | <!-- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" --> |
| | | <s-table |
| | | ref="table" |
| | | :columns="columns" |
| | | :data="loadData" |
| | | :alert="true" |
| | | @changeTablePage="pageInfo = $event" |
| | | :scroll="{x: true,y:tableHeight}" |
| | | :rowKey="(record) => record.id" |
| | | > |
| | | <template class="table-operator" slot="operator" v-if="hasPerm('WmsControlRuleDetail:add')" > |
| | | <!-- <div ref="actionBar" class="actionBar"> |
| | | <a-button type="info" v-if="hasPerm('sysExcelTemplate:importExcel')" icon="upload" @click="$refs.excelForm.index()"> |
| | | 导å
¥ |
| | | </a-button> |
| | | <a-button type="info" v-if="hasPerm('WmsControlRuleDetail:exportExcel')" icon="download" @click="WmsControlRuleDetailToExcel()"> |
| | | å¯¼åº |
| | | </a-button> |
| | | <a-button type="primary" v-if="hasPerm('WmsControlRuleDetail:add')" icon="plus" @click="$refs.addForm.add()">æ°å¢æ§å¶å±æ§è§åæç»</a-button> |
| | | </div> --> |
| | | </template> |
| | | <span slot="isNotChekscopedSlots" slot-scope="text"> |
| | | <div v-if="text===true "> |
| | | <a-tag color="green">æ¯</a-tag> |
| | | </div> |
| | | <div v-else-if="text==false"> |
| | | <a-tag color="volcano">å¦</a-tag> |
| | | </div> |
| | | <div v-else=""></div> |
| | | </span> |
| | | <span slot="isDisabledscopedSlots" slot-scope="text"> |
| | | <div v-if="text===true "> |
| | | <a-tag color="green">æ¯</a-tag> |
| | | </div> |
| | | <div v-else-if="text==false"> |
| | | <a-tag color="volcano">å¦</a-tag> |
| | | </div> |
| | | <div v-else=""></div> |
| | | </span> |
| | | <!-- <span slot="action" slot-scope="text, record"> |
| | | |
| | | <a v-if="hasPerm('WmsControlRuleDetail:edit')" @click="$refs.editForm.edit(record)">ç¼è¾</a> |
| | | <a-divider type="vertical" v-if="hasPerm('WmsControlRuleDetail:edit') & hasPerm('WmsControlRuleDetail:delete')"/> |
| | | <a-popconfirm v-if="hasPerm('WmsControlRuleDetail:delete')" placement="topRight" title="确认å é¤ï¼" @confirm="() => WmsControlRuleDetailDelete(record)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> --> |
| | | </s-table> |
| | | <add-form ref="addForm" @ok="handleOk" /> |
| | | <edit-form ref="editForm" @ok="handleOk" /> |
| | | <excel-form ref="excelForm" @ok="handleOk" /> |
| | | </a-card> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { STable } from '@/components' |
| | | import moment from 'moment' |
| | | import { WmsControlRuleDetailPage, WmsControlRuleDetailDelete, WmsControlRuleDetailToExcel } from '@/api/modular/main/WmsBase/WmsControlRuleDetailManage' |
| | | //èªå®ä¹tableé«åº¦ |
| | | import setTableHtMixin from '@/mixins/handleTableHt.js' |
| | | import addForm from './addForm.vue' |
| | | import { exportExcel } from '@/utils/exportToExcel' |
| | | import { downloadFile } from '@/utils/util' |
| | | import editForm from './editForm.vue' |
| | | import excelForm from './excelForm.vue' |
| | | export default { |
| | | mixins: [setTableHtMixin], |
| | | components: { |
| | | STable, |
| | | addForm, |
| | | editForm, |
| | | excelForm |
| | | }, |
| | | data () { |
| | | return { |
| | | advanced: false, // é«çº§æç´¢ å±å¼/å
³é |
| | | queryParam: {}, |
| | | pageInfo: { |
| | | current: 1, |
| | | pageSize: 10 |
| | | }, |
| | | columns: [ |
| | | { |
| | | title:'åºå·', |
| | | width: '60px', |
| | | align: 'center', |
| | | customRender: (text, record, index) => `${index + 1 + (this.pageInfo.current - 1) * this.pageInfo.pageSize}` |
| | | }, |
| | | { |
| | | title: 'æ§å¶å±æ§è§åID', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '140px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '140px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'controlRuleId' |
| | | }, |
| | | { |
| | | title: 'æé«åºå', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'maxImumqty' |
| | | }, |
| | | { |
| | | title: 'æä½åºå', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'minImumqty' |
| | | }, |
| | | { |
| | | title: 'å®å
¨åºå', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'safeImumqty' |
| | | }, |
| | | { |
| | | title: 'æå°åºé¾', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'minStorageAge' |
| | | }, |
| | | { |
| | | title: 'æå¤§åºé¾', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'maxStorageAge' |
| | | }, |
| | | { |
| | | title: 'æ¯å¦å
æ£', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'isNotChek', |
| | | scopedSlots: { customRender: 'isNotChekscopedSlots' } |
| | | }, |
| | | { |
| | | title: 'ä¿è´¨æå¤©æ°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'shelfLifeDays' |
| | | }, |
| | | { |
| | | title: 'æ¯å¦ç¦ç¨', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'isDisabled', |
| | | scopedSlots: { customRender: 'isDisabledscopedSlots' } |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'createdTime' |
| | | }, |
| | | { |
| | | title: 'æ´æ°æ¶é´', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'updatedTime' |
| | | }, |
| | | { |
| | | title: 'å建è
åç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'createdUserName' |
| | | }, |
| | | { |
| | | title: 'ä¿®æ¹è
åç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'updatedUserName' |
| | | } |
| | | ], |
| | | tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, |
| | | // å è½½æ°æ®æ¹æ³ å¿
须为 Promise 对象 |
| | | loadData: parameter => { |
| | | return WmsControlRuleDetailPage(Object.assign(parameter, this.switchingDate())).then((res) => { |
| | | return res.data |
| | | }) |
| | | }, |
| | | selectedRowKeys: [], |
| | | selectedRows: [] |
| | | } |
| | | }, |
| | | created () { |
| | | if (this.hasPerm('WmsControlRuleDetail:edit') || this.hasPerm('WmsControlRuleDetail:delete')) { |
| | | this.columns.push({ |
| | | title: 'æä½', |
| | | width: '150px', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' } |
| | | }) |
| | | } |
| | | const path = this.$route.path |
| | | const columnStr = window.localStorage.getItem(path) |
| | | if(columnStr) { |
| | | var _columns = JSON.parse(columnStr) |
| | | this.columns.forEach(element => { |
| | | var fObj = _columns.find((item, index) => { |
| | | return item.dataIndex === element.dataIndex; |
| | | }) |
| | | if(fObj!=undefined && fObj!=null){ |
| | | element.checked=fObj.checked; |
| | | } |
| | | }); |
| | | } |
| | | const isNotChekOption = this.$options |
| | | this.isNotChekData = isNotChekOption.filters['dictData']('yes_true_false') |
| | | const isDisabledOption = this.$options |
| | | this.isDisabledData = isDisabledOption.filters['dictData']('yes_true_false') |
| | | |
| | | this.handleTableHt() //è®¾ç½®ä¸»è¡¨è¡¨æ ¼é«åº¦ |
| | | window.addEventListener( |
| | | 'resize', |
| | | () => { |
| | | this.handleTableHt() // çå¬å±å¹å¤§å°æ¹åè¡¨æ ¼é«åº¦ |
| | | }, |
| | | false |
| | | ) |
| | | |
| | | }, |
| | | methods: { |
| | | moment, |
| | | /** |
| | | * æ¥è¯¢åæ°ç»è£
|
| | | */ |
| | | switchingDate () { |
| | | const obj = JSON.parse(JSON.stringify(this.queryParam)) |
| | | return obj |
| | | }, |
| | | WmsControlRuleDetailDelete (record) { |
| | | WmsControlRuleDetailDelete(record).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success('å 餿å') |
| | | this.$refs.table.refresh() |
| | | } else { |
| | | this.$message.error('å é¤å¤±è´¥') // + res.message |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | WmsControlRuleDetailToExcel() { |
| | | this.loading = true |
| | | let entozh = {}; |
| | | const path = this.$route.path; |
| | | if (window.localStorage.getItem(path)) { |
| | | JSON.parse(window.localStorage.getItem(path)).forEach(item => { |
| | | if (item.dataIndex != 'action' && item.checked) { |
| | | entozh[item.dataIndex] = item.title |
| | | } |
| | | }) |
| | | } else { //ç´æ¥ç¹å¯¼åº |
| | | this.columns.forEach(item => { |
| | | if (item.dataIndex != 'action') { |
| | | entozh[item.dataIndex] = item.title |
| | | } |
| | | }) |
| | | } |
| | | WmsControlRuleDetailPage(Object.assign({ pageSize: 100000, pageIndex: 1 }, this.queryParam)).then((res) => { |
| | | this.loading = false; |
| | | //éè¦æªåæ¥æçåæ®µ |
| | | var arrDataCutout = this.columns.filter(v => v.customCutout == true); |
| | | res.data.rows.forEach(item => { |
| | | var arrKeys = Object.keys(item); |
| | | arrKeys.forEach(key => { |
| | | var strFieldDic = key + 'Data'; |
| | | //æä¸¾è½¬å¼ |
| | | if (this[strFieldDic] && this[strFieldDic].length > 0) { |
| | | let arrFieldDic = this[strFieldDic].filter(v => String(v.code) == String(item[key])); |
| | | if (arrFieldDic.length > 0) { |
| | | item[key] = arrFieldDic[0]?.name || '没ææä¸¾å¼'; |
| | | } |
| | | } |
| | | // æ¥ææªå |
| | | if (arrDataCutout.length > 0) { |
| | | arrDataCutout.forEach(itemIn => { |
| | | if (key == itemIn.dataIndex && item[key]) { |
| | | item[key] = item[key].split(" ")[0] |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | }) |
| | | exportExcel(res.data.rows, entozh, "xlsx", `${this.$route.meta.title}`) |
| | | }).catch((err) => { |
| | | this.loading = false |
| | | this.$message.error('ä¸è½½é误ï¼è·åæä»¶æµé误' + err) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | toggleAdvanced () { |
| | | this.advanced = !this.advanced |
| | | this.handleTableHt() //è®¾ç½®ä¸»è¡¨è¡¨æ ¼é«åº¦ |
| | | }, |
| | | onChangecreatedTime(date, dateString) { |
| | | this.queryParam.createdTime = dateString |
| | | }, |
| | | onChangeupdatedTime(date, dateString) { |
| | | this.queryParam.updatedTime = dateString |
| | | }, |
| | | handleOk () { |
| | | this.$refs.table.refresh() |
| | | }, |
| | | onSelectChange (selectedRowKeys, selectedRows) { |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.selectedRows = selectedRows |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="less"> |
| | | .table-operator { |
| | | margin-bottom: 18px; |
| | | } |
| | | button { |
| | | margin-right: 8px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- @ok="handleSubmit" --> |
| | | <a-modal |
| | | title="æ§å¶å±æ§è§åæç»" |
| | | :width="900" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | @cancel="handleCancel" |
| | | @ok="visible=false" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <control-rule-detail ref="controlRuleDetail" @ok="handleOk" /> |
| | | </a-spin> |
| | | </a-modal> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment' |
| | | import { WmsControlRuleEdit } from '@/api/modular/main/WmsBase/WmsControlRuleManage' |
| | | import ControlRuleDetail from './detail.vue' |
| | | |
| | | export default { |
| | | components: { |
| | | ControlRuleDetail |
| | | }, |
| | | data() { |
| | | return { |
| | | Id: 0, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 15 } |
| | | }, |
| | | record: {}, |
| | | visible: false, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this) |
| | | } |
| | | }, |
| | | methods: { |
| | | moment, |
| | | // åå§åæ¹æ³ |
| | | edit(record) { |
| | | this.visible = true |
| | | this.Id = record.id |
| | | this.$nextTick(() => {}) |
| | | //深度æ·è´ ç§»é¤VUEççå¬ï¼é²æ¢INDEX页é¢å¼åå¨ |
| | | this.record = JSON.parse(JSON.stringify(record)) |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue({ |
| | | id: record.id, |
| | | ruleCode: record.ruleCode, |
| | | ruleName: record.ruleName, |
| | | ruleDesc: record.ruleDesc, |
| | | isDisabled: record.isDisabled |
| | | }) |
| | | }) |
| | | }, |
| | | handleOk(){ |
| | | alert("2") |
| | | }, |
| | | handleSubmit() { |
| | | const { |
| | | form: { validateFields } |
| | | } = this |
| | | this.confirmLoading = true |
| | | validateFields((errors, values) => { |
| | | if (!errors) { |
| | | for (const key in values) { |
| | | if (values[key] == null) continue |
| | | if (typeof values[key] === 'object') { |
| | | values[key] = JSON.stringify(values[key]) |
| | | this.record[key] = values[key] |
| | | } else { |
| | | this.record[key] = values[key] |
| | | } |
| | | } |
| | | WmsControlRuleEdit(this.record) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.$message.success('ç¼è¾æå') |
| | | this.confirmLoading = false |
| | | this.$emit('ok', this.record) |
| | | this.handleCancel() |
| | | } else { |
| | | this.$message.error('ç¼è¾å¤±è´¥ï¼' + JSON.stringify(res.message)) |
| | | } |
| | | }) |
| | | .finally(res => { |
| | | this.confirmLoading = false |
| | | }) |
| | | } else { |
| | | this.confirmLoading = false |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.form.resetFields() |
| | | this.visible = false |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | title="ç¼è¾æ§å¶å±æ§è§å" |
| | | :width="900" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | @ok="handleSubmit" |
| | | @cancel="handleCancel" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-form-item label="è§åç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input |
| | | placeholder="请è¾å
¥è§åç¼å·" |
| | | v-decorator="['ruleCode', { rules: [{ required: true, message: '请è¾å
¥è§åç¼å·ï¼' }] }]" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item label="è§ååç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input |
| | | placeholder="请è¾å
¥è§ååç§°" |
| | | v-decorator="['ruleName', { rules: [{ required: true, message: '请è¾å
¥è§ååç§°ï¼' }] }]" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item label="è§åæè¿°" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥è§åæè¿°" v-decorator="['ruleDesc']" /> |
| | | </a-form-item> |
| | | <a-form-item label="æ¯å¦ç¦ç¨" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-switch |
| | | v-decorator="[ |
| | | 'isDisabled', |
| | | { rules: [{ required: true, message: 'è¯·éæ©æ¯å¦ç¦ç¨ï¼' }], valuePropName: 'checked' } |
| | | ]" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item v-show="false"><a-input v-decorator="['id']"/></a-form-item> |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment' |
| | | import { WmsControlRuleEdit } from '@/api/modular/main/WmsBase/WmsControlRuleManage' |
| | | export default { |
| | | data() { |
| | | return { |
| | | Id: 0, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 15 } |
| | | }, |
| | | record: {}, |
| | | visible: false, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this) |
| | | } |
| | | }, |
| | | methods: { |
| | | moment, |
| | | // åå§åæ¹æ³ |
| | | edit(record) { |
| | | this.visible = true |
| | | this.Id = record.id |
| | | this.$nextTick(() => {}) |
| | | //深度æ·è´ ç§»é¤VUEççå¬ï¼é²æ¢INDEX页é¢å¼åå¨ |
| | | this.record = JSON.parse(JSON.stringify(record)) |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue({ |
| | | id: record.id, |
| | | ruleCode: record.ruleCode, |
| | | ruleName: record.ruleName, |
| | | ruleDesc: record.ruleDesc, |
| | | isDisabled: record.isDisabled |
| | | }) |
| | | }) |
| | | }, |
| | | handleSubmit() { |
| | | const { |
| | | form: { validateFields } |
| | | } = this |
| | | this.confirmLoading = true |
| | | validateFields((errors, values) => { |
| | | if (!errors) { |
| | | for (const key in values) { |
| | | if (values[key] == null) continue |
| | | if (typeof values[key] === 'object') { |
| | | values[key] = JSON.stringify(values[key]) |
| | | this.record[key] = values[key] |
| | | } else { |
| | | this.record[key] = values[key] |
| | | } |
| | | } |
| | | WmsControlRuleEdit(this.record) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.$message.success('ç¼è¾æå') |
| | | this.confirmLoading = false |
| | | this.$emit('ok', this.record) |
| | | this.handleCancel() |
| | | } else { |
| | | this.$message.error('ç¼è¾å¤±è´¥ï¼' + JSON.stringify(res.message)) |
| | | } |
| | | }) |
| | | .finally(res => { |
| | | this.confirmLoading = false |
| | | }) |
| | | } else { |
| | | this.confirmLoading = false |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.form.resetFields() |
| | | this.visible = false |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :width="850" |
| | | :destroyOnClose="true" |
| | | :visible="visible" |
| | | :forceRender="true" |
| | | title="æ¹é导å
¥" |
| | | cancelText="åæ¶ä¸ä¼ " |
| | | okText="å¼å§ä¸ä¼ " |
| | | @cancel="handleCancel" |
| | | @ok="handleSubmit"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-row :span="24"> |
| | | <span>è¯·éæ©è¦å¯¼å
¥çæ°æ®æä»¶ï¼Excelæ ¼å¼ï¼</span> |
| | | </a-row> |
| | | <p></p> |
| | | <a-row> |
| | | <a-col :span="16"> |
| | | <a-upload-dragger accept=".xlsx,.xls" :multiple="false" :customRequest="customRequest" @change="handleChange" :beforeUpload="beforeUpload"> |
| | | <a-icon style="font-size: 40px;" type="cloud-upload" /> |
| | | </a-upload-dragger> |
| | | </a-col> |
| | | <!--<a-col :span="8"> |
| | | <span>导å
¥æ¨¡å¼ï¼</span> |
| | | <a-select |
| | | style="width: 130px" |
| | | placeholder="è¯·éæ©å¯¼å
¥æ¨¡å¼" |
| | | v-model="importExcelType"> |
| | | <a-select-option |
| | | v-for="(item,index) in importExcelTypeData" |
| | | :key="index" |
| | | :value="item.code">{{ item.name }} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-col>--> |
| | | </a-row> |
| | | <a-row :span="24"> |
| | | <!--<a-button @click="showDemand" style="width: 150px;text-align: left;" type="link" v-show="!detailed"> |
| | | ç¹å»æ¥çæä»¶ä¸ä¼ è¦æ± |
| | | </a-button>--> |
| | | <span>ã</span> |
| | | <a-button style="width: 90px;text-align: left;" @click="wmsControlRuleDownloadExcelTemplate" type="link">ä¸è½½å¯¼å
¥æ¨¡æ¿</a-button>ï¼å¡«åå¹¶ä¸ä¼ |
| | | <span>ã</span> |
| | | <a-button @click="showDemand" style="width: 150px;text-align: left;" type="link" v-show="detailed"> |
| | | æ¶èµ· |
| | | </a-button> |
| | | </a-row> |
| | | <a-row v-show="detailed" style="background: #fef4e8; height: 30px;" :span="24"> |
| | | <a-breadcrumb> |
| | | <a-breadcrumb-item style="line-height: 30px;color: #faad14;margin-left: 18px;">æä»¶ä¸ä¼ è¦æ±</a-breadcrumb-item> |
| | | </a-breadcrumb> |
| | | </a-row> |
| | | <pre v-show="detailed"> |
| | | <div v-html="demandText"></div> |
| | | </pre> |
| | | <a-table v-show="detailed" :columns="columns" :data-source="dataList" :rowKey="(record) => record.processID" :pagination="false"></a-table> |
| | | <pre v-show="detailed"> |
| | | <div v-html="columnText"></div> |
| | | </pre> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { downloadFile, checkFile, parseExcelFieldText, parseDemandText } from '@/utils/util' |
| | | |
| | | import { WmsControlRuleImportExcel, WmsControlRuleDownloadExcelTemplate} from '@/api/modular/main/WmsBase/WmsControlRuleManage' |
| | | import { sysExcelTemplateGetColumnList } from '@/api/modular/system/excelTemplateManage' |
| | | export default { |
| | | components: { |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | detailed: false, |
| | | confirmLoading: false, |
| | | fileList: [], |
| | | importExcelTypeData: [], |
| | | importExcelType: '1', |
| | | uploadFile: null, |
| | | columns: [], |
| | | dataList: [], |
| | | demandText:'', |
| | | columnText: '' |
| | | } |
| | | }, |
| | | methods: { |
| | | index() { |
| | | this.visible = true; |
| | | this.importExcelTypeData = this.$options.filters['dictData']('import_excel_type') |
| | | this.demandText = parseDemandText("wmsControlRuleDownloadExcelTemplate") |
| | | window.downloadFile = this.wmsControlRuleDownloadExcelTemplate; |
| | | this.getTable(); |
| | | }, |
| | | showDemand() { |
| | | this.detailed = !this.detailed; |
| | | }, |
| | | customRequest(document) { |
| | | this.uploadFile = document |
| | | }, |
| | | getTable() { |
| | | sysExcelTemplateGetColumnList({className: "WmsControlRule"}).then(res => |
| | | { |
| | | if (res.success) { |
| | | this.columns =[]; |
| | | this.dataList = [{}]; |
| | | res.data.forEach(x => { |
| | | this.columns.push({ |
| | | dataIndex: x.columnName, |
| | | key: x.columnName, |
| | | title: x.columnComment |
| | | }); |
| | | this.dataList[0][x.columnName] = x.isRequired ? "å¿
å¡«" : "éå¿
å¡«" |
| | | }); |
| | | this.columnText = parseExcelFieldText(res.data); |
| | | } |
| | | }); |
| | | }, |
| | | beforeUpload(fileInfo) { |
| | | let res = checkFile(fileInfo, 1073741824, ['.xlsx', '.xls']); |
| | | if (!res.success) { |
| | | this.$message.warning(res.msg) |
| | | return false |
| | | } |
| | | setTimeout(() => {this.uploadFile.onSuccess(this.uploadFile.file)}, 1000) |
| | | }, |
| | | handleChange(fileInfo) { |
| | | if (fileInfo.file.status === 'error') { |
| | | fileInfo.fileList.splice(0, 1) |
| | | } |
| | | if (fileInfo.file.status === 'done') { |
| | | if (fileInfo.fileList.length > 1) { |
| | | fileInfo.fileList.splice(0, 1) |
| | | } |
| | | this.fileList = fileInfo.file |
| | | } |
| | | }, |
| | | handleSubmit() { |
| | | this.confirmLoading = true |
| | | const formData = new FormData() |
| | | formData.append('file', this.uploadFile.file) |
| | | WmsControlRuleImportExcel(formData, {importExcelType: this.importExcelType}).then(res => { |
| | | this.$message.success('æä½æå') |
| | | this.confirmLoading = false |
| | | this.$emit('ok', []) |
| | | this.handleCancel() |
| | | }).finally((res)=>{this.confirmLoading = false}) |
| | | }, |
| | | handleCancel() { |
| | | this.visible = false |
| | | this.detailed = false |
| | | }, |
| | | wmsControlRuleDownloadExcelTemplate() { |
| | | WmsControlRuleDownloadExcelTemplate({version: "v2"}).then((res) => { |
| | | downloadFile(res); |
| | | }).catch((err) => { |
| | | this.$message.error('ä¸è½½é误ï¼è·åæä»¶æµé误' + err) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | ::v-deep .ant-upload.ant-upload-drag { |
| | | position: relative; |
| | | width: 140px; |
| | | height: 135px; |
| | | text-align: center; |
| | | background: #fafafa; |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 2px; |
| | | cursor: pointer; |
| | | -webkit-transition: border-color 0.3s; |
| | | transition: border-color 0.3s; |
| | | } |
| | | ::v-deep .ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger), .ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger) { |
| | | color: #ffc53d; |
| | | border-color: white; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- æ§å¶å±æ§è§å --> |
| | | <div ref="boxOutWrap" class="boxOutWrap"> |
| | | <div ref="boxForm" class="boxForm"> |
| | | <a-card :bordered="false" :bodyStyle="tstyle"> |
| | | <div class="table-page-search-wrapper" v-if="hasPerm('WmsControlRule:page')"> |
| | | <a-form layout="inline"> |
| | | <a-row :gutter="48"> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="è§åç¼å·"> |
| | | <a-input v-model="queryParam.ruleCode" allow-clear placeholder="请è¾å
¥è§åç¼å·" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="è§ååç§°"> |
| | | <a-input v-model="queryParam.ruleName" allow-clear placeholder="请è¾å
¥è§ååç§°" /> |
| | | </a-form-item> </a-col |
| | | ><template v-if="advanced"> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="è§åæè¿°"> |
| | | <a-input v-model="queryParam.ruleDesc" allow-clear placeholder="请è¾å
¥è§åæè¿°" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ¯å¦ç¦ç¨"> |
| | | <a-select |
| | | :allowClear="true" |
| | | style="width: 100%" |
| | | v-model="queryParam.isDisabled" |
| | | placeholder="è¯·éæ©æ¯å¦ç¦ç¨" |
| | | > |
| | | <a-select-option v-for="(item, index) in isDisabledData" :key="index" :value="item.code">{{ |
| | | item.name |
| | | }}</a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | <!--å¹´ææ¥æ¶åç§--> |
| | | <!--æ¶é´èå´--> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="å建æ¶é´"> |
| | | <a-range-picker |
| | | style="width: 100%" |
| | | :placeholder="['å¼å§æ¶é´', 'ç»ææ¶é´']" |
| | | :show-time="{ |
| | | format: 'HH:mm:ss', |
| | | defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')] |
| | | }" |
| | | v-model="queryParam.createdTime" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | @change="onChangecreatedTime" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <!--å¹´ææ¥æ¶åç§--> |
| | | <!--æ¶é´èå´--> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ´æ°æ¶é´"> |
| | | <a-range-picker |
| | | style="width: 100%" |
| | | :placeholder="['å¼å§æ¶é´', 'ç»ææ¶é´']" |
| | | :show-time="{ |
| | | format: 'HH:mm:ss', |
| | | defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')] |
| | | }" |
| | | v-model="queryParam.updatedTime" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | @change="onChangeupdatedTime" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="å建è
åç§°"> |
| | | <a-input v-model="queryParam.createdUserName" allow-clear placeholder="请è¾å
¥å建è
åç§°" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ä¿®æ¹è
åç§°"> |
| | | <a-input v-model="queryParam.updatedUserName" allow-clear placeholder="请è¾å
¥ä¿®æ¹è
åç§°" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </template> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <span class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="$refs.table.refresh(true)">æ¥è¯¢</a-button> |
| | | <a-button style="margin-left: 8px" @click="() => (queryParam = {})">éç½®</a-button> |
| | | <a @click="toggleAdvanced" style="margin-left: 8px"> |
| | | {{ advanced ? 'æ¶èµ·' : 'å±å¼' }} |
| | | <a-icon :type="advanced ? 'up' : 'down'" /> |
| | | </a> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | </a-card> |
| | | </div> |
| | | <a-card :bordered="false"> |
| | | <s-table |
| | | ref="table" |
| | | :columns="columns" |
| | | :data="loadData" |
| | | :alert="true" |
| | | @changeTablePage="pageInfo = $event" |
| | | :scroll="{ x: true, y: tableHeight }" |
| | | :rowKey="record => record.id" |
| | | :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" |
| | | > |
| | | <template class="table-operator" slot="operator" v-if="hasPerm('WmsControlRule:add')"> |
| | | <!-- <div ref="actionBar" class="actionBar"> |
| | | <a-button |
| | | type="info" |
| | | v-if="hasPerm('sysExcelTemplate:importExcel')" |
| | | icon="upload" |
| | | @click="$refs.excelForm.index()" |
| | | > |
| | | 导å
¥ |
| | | </a-button> |
| | | <a-button |
| | | type="info" |
| | | v-if="hasPerm('WmsControlRule:exportExcel')" |
| | | icon="download" |
| | | @click="WmsControlRuleToExcel()" |
| | | > |
| | | å¯¼åº |
| | | </a-button> |
| | | <a-button type="primary" v-if="hasPerm('WmsControlRule:add')" icon="plus" @click="$refs.addForm.add()" |
| | | >æ°å¢æ§å¶å±æ§è§å</a-button |
| | | > |
| | | </div> --> |
| | | </template> |
| | | <span slot="isDisabledscopedSlots" slot-scope="text"> |
| | | <div v-if="text === true"> |
| | | <a-tag color="green">æ¯</a-tag> |
| | | </div> |
| | | <div v-else-if="text == false"> |
| | | <a-tag color="volcano">å¦</a-tag> |
| | | </div> |
| | | <div v-else=""></div> |
| | | </span> |
| | | <span slot="action" slot-scope="text, record"> |
| | | <!-- èªå®ä¹ --> |
| | | <a v-if="hasPerm('WmsControlRule:getdetail')" @click="$refs.detailForm.edit(record)">详æ
</a> |
| | | |
| | | </a-popconfirm> |
| | | </span> |
| | | </s-table> |
| | | <add-form ref="addForm" @ok="handleOk" /> |
| | | <edit-form ref="editForm" @ok="handleOk" /> |
| | | <excel-form ref="excelForm" @ok="handleOk" /> |
| | | |
| | | <!-- èªå®ä¹ --> |
| | | <detail-form ref="detailForm" @ok="handleOk" /> |
| | | |
| | | </a-card> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { STable } from '@/components' |
| | | import moment from 'moment' |
| | | import { |
| | | WmsControlRulePage, |
| | | WmsControlRuleDelete, |
| | | WmsControlRuleToExcel |
| | | } from '@/api/modular/main/WmsBase/WmsControlRuleManage' |
| | | //èªå®ä¹tableé«åº¦ |
| | | import setTableHtMixin from '@/mixins/handleTableHt.js' |
| | | import addForm from './addForm.vue' |
| | | import { exportExcel } from '@/utils/exportToExcel' |
| | | import { downloadFile } from '@/utils/util' |
| | | import editForm from './editForm.vue' |
| | | import excelForm from './excelForm.vue' |
| | | import detailForm from './details.vue' |
| | | |
| | | |
| | | export default { |
| | | mixins: [setTableHtMixin], |
| | | components: { |
| | | STable, |
| | | addForm, |
| | | editForm, |
| | | excelForm, |
| | | detailForm |
| | | }, |
| | | data() { |
| | | return { |
| | | advanced: false, // é«çº§æç´¢ å±å¼/å
³é |
| | | queryParam: {}, |
| | | pageInfo: { |
| | | current: 1, |
| | | pageSize: 10 |
| | | }, |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | width: '60px', |
| | | align: 'center', |
| | | customRender: (text, record, index) => `${index + 1 + (this.pageInfo.current - 1) * this.pageInfo.pageSize}` |
| | | }, |
| | | { |
| | | title: 'è§åç¼å·', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'ruleCode' |
| | | }, |
| | | { |
| | | title: 'è§ååç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'ruleName' |
| | | }, |
| | | { |
| | | title: 'è§åæè¿°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'ruleDesc' |
| | | }, |
| | | { |
| | | title: 'æ¯å¦ç¦ç¨', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'isDisabled', |
| | | scopedSlots: { customRender: 'isDisabledscopedSlots' } |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'createdTime' |
| | | }, |
| | | { |
| | | title: 'æ´æ°æ¶é´', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'updatedTime' |
| | | }, |
| | | { |
| | | title: 'å建è
åç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'createdUserName' |
| | | }, |
| | | { |
| | | title: 'ä¿®æ¹è
åç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'updatedUserName' |
| | | } |
| | | ], |
| | | tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, |
| | | // å è½½æ°æ®æ¹æ³ å¿
须为 Promise 对象 |
| | | loadData: parameter => { |
| | | return WmsControlRulePage(Object.assign(parameter, this.switchingDate())).then(res => { |
| | | return res.data |
| | | }) |
| | | }, |
| | | selectedRowKeys: [], |
| | | selectedRows: [] |
| | | } |
| | | }, |
| | | created() { |
| | | if (this.hasPerm('WmsControlRule:edit') || this.hasPerm('WmsControlRule:delete')) { |
| | | this.columns.push({ |
| | | title: 'æä½', |
| | | width: '150px', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' } |
| | | }) |
| | | } |
| | | const path = this.$route.path |
| | | const columnStr = window.localStorage.getItem(path) |
| | | if (columnStr) { |
| | | var _columns = JSON.parse(columnStr) |
| | | this.columns.forEach(element => { |
| | | var fObj = _columns.find((item, index) => { |
| | | return item.dataIndex === element.dataIndex |
| | | }) |
| | | if (fObj != undefined && fObj != null) { |
| | | element.checked = fObj.checked |
| | | } |
| | | }) |
| | | } |
| | | const isDisabledOption = this.$options |
| | | this.isDisabledData = isDisabledOption.filters['dictData']('yes_true_false') |
| | | |
| | | this.handleTableHt() //è®¾ç½®ä¸»è¡¨è¡¨æ ¼é«åº¦ |
| | | window.addEventListener( |
| | | 'resize', |
| | | () => { |
| | | this.handleTableHt() // çå¬å±å¹å¤§å°æ¹åè¡¨æ ¼é«åº¦ |
| | | }, |
| | | false |
| | | ) |
| | | }, |
| | | methods: { |
| | | moment, |
| | | /** |
| | | * æ¥è¯¢åæ°ç»è£
|
| | | */ |
| | | switchingDate() { |
| | | const obj = JSON.parse(JSON.stringify(this.queryParam)) |
| | | return obj |
| | | }, |
| | | WmsControlRuleDelete(record) { |
| | | WmsControlRuleDelete(record).then(res => { |
| | | if (res.success) { |
| | | this.$message.success('å 餿å') |
| | | this.$refs.table.refresh() |
| | | } else { |
| | | this.$message.error('å é¤å¤±è´¥') // + res.message |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | WmsControlRuleToExcel() { |
| | | this.loading = true |
| | | let entozh = {} |
| | | const path = this.$route.path |
| | | if (window.localStorage.getItem(path)) { |
| | | JSON.parse(window.localStorage.getItem(path)).forEach(item => { |
| | | if (item.dataIndex != 'action' && item.checked) { |
| | | entozh[item.dataIndex] = item.title |
| | | } |
| | | }) |
| | | } else { |
| | | //ç´æ¥ç¹å¯¼åº |
| | | this.columns.forEach(item => { |
| | | if (item.dataIndex != 'action') { |
| | | entozh[item.dataIndex] = item.title |
| | | } |
| | | }) |
| | | } |
| | | WmsControlRulePage(Object.assign({ pageSize: 100000, pageIndex: 1 }, this.queryParam)) |
| | | .then(res => { |
| | | this.loading = false |
| | | //éè¦æªåæ¥æçåæ®µ |
| | | var arrDataCutout = this.columns.filter(v => v.customCutout == true) |
| | | res.data.rows.forEach(item => { |
| | | var arrKeys = Object.keys(item) |
| | | arrKeys.forEach(key => { |
| | | var strFieldDic = key + 'Data' |
| | | //æä¸¾è½¬å¼ |
| | | if (this[strFieldDic] && this[strFieldDic].length > 0) { |
| | | let arrFieldDic = this[strFieldDic].filter(v => String(v.code) == String(item[key])) |
| | | if (arrFieldDic.length > 0) { |
| | | item[key] = arrFieldDic[0]?.name || '没ææä¸¾å¼' |
| | | } |
| | | } |
| | | // æ¥ææªå |
| | | if (arrDataCutout.length > 0) { |
| | | arrDataCutout.forEach(itemIn => { |
| | | if (key == itemIn.dataIndex && item[key]) { |
| | | item[key] = item[key].split(' ')[0] |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | exportExcel(res.data.rows, entozh, 'xlsx', `${this.$route.meta.title}`) |
| | | }) |
| | | .catch(err => { |
| | | this.loading = false |
| | | this.$message.error('ä¸è½½é误ï¼è·åæä»¶æµé误' + err) |
| | | }) |
| | | }, |
| | | |
| | | toggleAdvanced() { |
| | | this.advanced = !this.advanced |
| | | this.handleTableHt() //è®¾ç½®ä¸»è¡¨è¡¨æ ¼é«åº¦ |
| | | }, |
| | | onChangecreatedTime(date, dateString) { |
| | | this.queryParam.createdTime = dateString |
| | | }, |
| | | onChangeupdatedTime(date, dateString) { |
| | | this.queryParam.updatedTime = dateString |
| | | }, |
| | | handleOk() { |
| | | this.$refs.table.refresh() |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectedRows) { |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.selectedRows = selectedRows |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="less"> |
| | | .table-operator { |
| | | margin-bottom: 18px; |
| | | } |
| | | button { |
| | | margin-right: 8px; |
| | | } |
| | | </style> |
ÎļþÃû´Ó iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/addFormWmsSubstituteGood.vue ÐÞ¸Ä |
| | |
| | | <template> |
| | | <!-- æ¿ä»£å管ç --> |
| | | <a-form :form="form"> |
| | | <a-modal |
| | | title="æ°å¢æ¿ä»£å管ç" |
| | | :width="900" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | @ok="handleSubmit" |
| | | @cancel="handleCancel"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-form-item label="æ¿ä»£ç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥æ¿ä»£ç¼å·" v-decorator="['substituteCode', {rules: [{required: true, message: '请è¾å
¥æ¿ä»£ç¼å·ï¼'}]}]" /> |
| | | </a-form-item> |
| | |
| | | <a-switch v-decorator="['isDisabled',{rules: [{ required: true, message: 'è¯·éæ©æ¯å¦ç¦ç¨ï¼' }], valuePropName: 'checked'}]" /> |
| | | </a-form-item> |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- æ¿ä»£å管ç --> |
| | | <div style="background-color: white"> |
| | | <!-- <a-spin :spinning="loading"> --> |
| | | <div class="wms-task-management-detail-div"> |
| | | <div class="drawer-content"> |
| | | <!-- <span style="font-weight:bold;cursor:default;"> |
| | | <a style="cursor:default;">{{ row.no }}</a>åæ®è¯¦æ
|
| | | </span> --> |
| | | <div style="margin-top: 10px;"> |
| | | <a-table :columns="columns" :data-source="list" row-key="id" :pagination="false" :scroll="{ x: true }"> |
| | | <template slot="index" slot-scope="text, record, index">{{ index + 1 }}</template> |
| | | <span slot="containerStatusscopedSlots" slot-scope="text"> |
| | | <a-tag :color="text == '1' ? '#daa520' : text == '2' ? '#cd5c5c' : text == '3' ? '#add8e6' : '#696969'">{{ |
| | | 'orderdetails_statusenum' | dictType(text) |
| | | }}</a-tag> |
| | | </span> |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a-popconfirm v-if="hasPerm('BaseCustomer:delete')" placement="topRight" title="确认å é¤ï¼" |
| | | @confirm="() => itemDelete(record, index)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | </div> |
| | | |
| | | <p @click="visible = true">æ°å¢è¡</p> |
| | | |
| | | <a-modal title="æ¿ä»£åå表" :width="900" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit" |
| | | @cancel="handleCancel"> |
| | | <show-list ref="showList" @ok="handleOk" /> |
| | | <!-- <a-spin :spinning="confirmLoading"></a-spin> --> |
| | | </a-modal> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { WmsOrderRukuDetail } from '@/api/modular/main/WmsOrderManage' |
| | | import showList from './index.vue' |
| | | |
| | | export default { |
| | | name: 'wmsOrderRukuManagementDetailDrawer', |
| | | emits: ['update:visible'], |
| | | props: { |
| | | visible: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | row: { |
| | | type: Object, |
| | | default: function () { |
| | | return {} |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | showList |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | containerStatusData: [], |
| | | list: [], |
| | | columns: [ |
| | | { |
| | | dataIndex: 'index', |
| | | title: 'åºå·', |
| | | fixed: 'left', |
| | | width: '60', |
| | | scopedSlots: { customRender: 'index' }, |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: 'æ¿ä»£ç¼å·', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'substituteCode' |
| | | }, |
| | | { |
| | | title: 'ç©æç¼å·', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'materialCode' |
| | | }, |
| | | { |
| | | title: 'ç©æåç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'materialName' |
| | | }, |
| | | { |
| | | title: 'æ¿ä»£åç©æç¼å·', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '140px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '140px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'substituteMaterialCode' |
| | | }, |
| | | { |
| | | title: 'æ¿ä»£åç©æåç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '140px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '140px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'substituteMaterialName' |
| | | }, |
| | | { |
| | | title: 'æ¿ä»£æ¬¡åº', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'substituteIndex' |
| | | }, |
| | | ], |
| | | // å页 |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30', '40'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + 'å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0, |
| | | size: 'small' |
| | | } |
| | | } |
| | | }, |
| | | |
| | | created() { |
| | | const containerStatusOption = this.$options |
| | | this.containerStatusData = containerStatusOption.filters['dictData']('orderdetails_statusenum') |
| | | |
| | | this.columns.push({ |
| | | title: 'æä½', |
| | | width: '150px', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' } |
| | | }) |
| | | }, |
| | | methods: { |
| | | onClose() { |
| | | this.close() |
| | | }, |
| | | close() { |
| | | this.$emit('update:visible', false) |
| | | }, |
| | | afterVisibleChange(visible) { |
| | | if (visible) { |
| | | this.initShow() |
| | | } else { |
| | | this.afterClsoe() |
| | | } |
| | | }, |
| | | initShow() { |
| | | this.loading = true |
| | | this.getList(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | getList(row) { |
| | | let params = { id: row.id } |
| | | WmsOrderRukuDetail(params) |
| | | .then(d => { |
| | | this.list = d.data.rows || [] |
| | | this.$emit('update:visible', true) |
| | | // callback && callback(true) |
| | | }) |
| | | .catch(() => { |
| | | this.$emit('update:visible', false) |
| | | this.list = [] |
| | | // callback && callback(false) |
| | | }) |
| | | }, |
| | | afterClsoe() { |
| | | this.list = [] |
| | | }, |
| | | handleOk(param) { |
| | | this.list = param |
| | | }, |
| | | handleSubmit() { |
| | | this.visible = false |
| | | }, |
| | | handleCancel() { |
| | | this.visible = false |
| | | }, |
| | | itemDelete(record, index) { |
| | | this.list.splice(index, 1) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .wms-task-management-detail-div { |
| | | height: 100%; |
| | | overflow: auto; |
| | | |
| | | .drawer-content { |
| | | padding: 16px; |
| | | } |
| | | } |
| | | </style> |
copy from iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/addFormWmsSubstituteGood.vue
copy to iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/WmsSubstituteGood/editForm.vue
Îļþ´Ó iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/addFormWmsSubstituteGood.vue ¸´ÖÆ |
| | |
| | | <template> |
| | | <!-- æ¿ä»£å管ç --> |
| | | <a-form :form="form"> |
| | | <a-modal |
| | | title="ç¼è¾æ¿ä»£å管ç" |
| | | :width="900" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | @ok="handleSubmit" |
| | | @cancel="handleCancel"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-form-item label="æ¿ä»£ç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥æ¿ä»£ç¼å·" v-decorator="['substituteCode', {rules: [{required: true, message: '请è¾å
¥æ¿ä»£ç¼å·ï¼'}]}]" /> |
| | | </a-form-item> |
| | |
| | | <a-form-item label="æ¯å¦ç¦ç¨" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-switch v-decorator="['isDisabled',{rules: [{ required: true, message: 'è¯·éæ©æ¯å¦ç¦ç¨ï¼' }], valuePropName: 'checked'}]" /> |
| | | </a-form-item> |
| | | <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment' |
| | | import moment from 'moment' |
| | | import { |
| | | WmsSubstituteGoodAdd |
| | | WmsSubstituteGoodEdit |
| | | } from '@/api/modular/main/WmsBase/WmsSubstituteGoodManage' |
| | | export default { |
| | | data () { |
| | | return { |
| | | Id: 0, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | |
| | | xs: { span: 24 }, |
| | | sm: { span: 15 } |
| | | }, |
| | | record: {}, |
| | | visible: false, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this) |
| | |
| | | methods: { |
| | | moment, |
| | | // åå§åæ¹æ³ |
| | | add (record) { |
| | | this.visible = true |
| | | edit (record) { |
| | | this.visible = true; |
| | | this.Id = record.id; |
| | | this.$nextTick(() => { |
| | | |
| | | }); |
| | | //深度æ·è´ ç§»é¤VUEççå¬ï¼é²æ¢INDEX页é¢å¼åå¨ |
| | | this.record = JSON.parse(JSON.stringify(record)) |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue( |
| | | { |
| | | id: record.id, |
| | | substituteCode: record.substituteCode, |
| | | materialCode: record.materialCode, |
| | | materialName: record.materialName, |
| | | substituteMaterialCode: record.substituteMaterialCode, |
| | | substituteMaterialName: record.substituteMaterialName, |
| | | substituteIndex: record.substituteIndex, |
| | | isDisabled: record.isDisabled |
| | | } |
| | | ) |
| | | }) |
| | | }, |
| | | /** |
| | | * æäº¤è¡¨å |
| | | */ |
| | | handleSubmit () { |
| | | const { form: { validateFields } } = this |
| | | this.confirmLoading = true |
| | | validateFields((errors, values) => { |
| | | if (!errors) { |
| | | for (const key in values) { |
| | | if (values[key] == null) continue |
| | | if (typeof (values[key]) === 'object') { |
| | | values[key] = JSON.stringify(values[key]) |
| | | this.record[key] = values[key] |
| | | } else { |
| | | this.record[key] = values[key] |
| | | } |
| | | } |
| | | WmsSubstituteGoodAdd(values).then((res) => { |
| | | WmsSubstituteGoodEdit(this.record).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.$message.success('ç¼è¾æå') |
| | | this.confirmLoading = false |
| | | this.$emit('ok', values) |
| | | this.$emit('ok', this.record) |
| | | this.handleCancel() |
| | | } else { |
| | | this.$message.error('æ°å¢å¤±è´¥ï¼' + JSON.stringify(res.message)) |
| | | this.$message.error('ç¼è¾å¤±è´¥ï¼' + JSON.stringify(res.message)) |
| | | } |
| | | }).finally((res) => { |
| | | this.confirmLoading = false |
| | | }) |
| | | } else { |
| | | }else{ |
| | | this.confirmLoading = false |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | }, |
| | | handleCancel () { |
| | | this.form.resetFields() |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :width="850" |
| | | :destroyOnClose="true" |
| | | :visible="visible" |
| | | :forceRender="true" |
| | | title="æ¹é导å
¥" |
| | | cancelText="åæ¶ä¸ä¼ " |
| | | okText="å¼å§ä¸ä¼ " |
| | | @cancel="handleCancel" |
| | | @ok="handleSubmit"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-row :span="24"> |
| | | <span>è¯·éæ©è¦å¯¼å
¥çæ°æ®æä»¶ï¼Excelæ ¼å¼ï¼</span> |
| | | </a-row> |
| | | <p></p> |
| | | <a-row> |
| | | <a-col :span="16"> |
| | | <a-upload-dragger accept=".xlsx,.xls" :multiple="false" :customRequest="customRequest" @change="handleChange" :beforeUpload="beforeUpload"> |
| | | <a-icon style="font-size: 40px;" type="cloud-upload" /> |
| | | </a-upload-dragger> |
| | | </a-col> |
| | | <!--<a-col :span="8"> |
| | | <span>导å
¥æ¨¡å¼ï¼</span> |
| | | <a-select |
| | | style="width: 130px" |
| | | placeholder="è¯·éæ©å¯¼å
¥æ¨¡å¼" |
| | | v-model="importExcelType"> |
| | | <a-select-option |
| | | v-for="(item,index) in importExcelTypeData" |
| | | :key="index" |
| | | :value="item.code">{{ item.name }} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-col>--> |
| | | </a-row> |
| | | <a-row :span="24"> |
| | | <!--<a-button @click="showDemand" style="width: 150px;text-align: left;" type="link" v-show="!detailed"> |
| | | ç¹å»æ¥çæä»¶ä¸ä¼ è¦æ± |
| | | </a-button>--> |
| | | <span>ã</span> |
| | | <a-button style="width: 90px;text-align: left;" @click="wmsSubstituteGoodDownloadExcelTemplate" type="link">ä¸è½½å¯¼å
¥æ¨¡æ¿</a-button>ï¼å¡«åå¹¶ä¸ä¼ |
| | | <span>ã</span> |
| | | <a-button @click="showDemand" style="width: 150px;text-align: left;" type="link" v-show="detailed"> |
| | | æ¶èµ· |
| | | </a-button> |
| | | </a-row> |
| | | <a-row v-show="detailed" style="background: #fef4e8; height: 30px;" :span="24"> |
| | | <a-breadcrumb> |
| | | <a-breadcrumb-item style="line-height: 30px;color: #faad14;margin-left: 18px;">æä»¶ä¸ä¼ è¦æ±</a-breadcrumb-item> |
| | | </a-breadcrumb> |
| | | </a-row> |
| | | <pre v-show="detailed"> |
| | | <div v-html="demandText"></div> |
| | | </pre> |
| | | <a-table v-show="detailed" :columns="columns" :data-source="dataList" :rowKey="(record) => record.processID" :pagination="false"></a-table> |
| | | <pre v-show="detailed"> |
| | | <div v-html="columnText"></div> |
| | | </pre> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { downloadFile, checkFile, parseExcelFieldText, parseDemandText } from '@/utils/util' |
| | | |
| | | import { WmsSubstituteGoodImportExcel, WmsSubstituteGoodDownloadExcelTemplate} from '@/api/modular/main/WmsBase/WmsSubstituteGoodManage' |
| | | import { sysExcelTemplateGetColumnList } from '@/api/modular/system/excelTemplateManage' |
| | | export default { |
| | | components: { |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | detailed: false, |
| | | confirmLoading: false, |
| | | fileList: [], |
| | | importExcelTypeData: [], |
| | | importExcelType: '1', |
| | | uploadFile: null, |
| | | columns: [], |
| | | dataList: [], |
| | | demandText:'', |
| | | columnText: '' |
| | | } |
| | | }, |
| | | methods: { |
| | | index() { |
| | | this.visible = true; |
| | | this.importExcelTypeData = this.$options.filters['dictData']('import_excel_type') |
| | | this.demandText = parseDemandText("wmsSubstituteGoodDownloadExcelTemplate") |
| | | window.downloadFile = this.wmsSubstituteGoodDownloadExcelTemplate; |
| | | this.getTable(); |
| | | }, |
| | | showDemand() { |
| | | this.detailed = !this.detailed; |
| | | }, |
| | | customRequest(document) { |
| | | this.uploadFile = document |
| | | }, |
| | | getTable() { |
| | | sysExcelTemplateGetColumnList({className: "WmsSubstituteGood"}).then(res => |
| | | { |
| | | if (res.success) { |
| | | this.columns =[]; |
| | | this.dataList = [{}]; |
| | | res.data.forEach(x => { |
| | | this.columns.push({ |
| | | dataIndex: x.columnName, |
| | | key: x.columnName, |
| | | title: x.columnComment |
| | | }); |
| | | this.dataList[0][x.columnName] = x.isRequired ? "å¿
å¡«" : "éå¿
å¡«" |
| | | }); |
| | | this.columnText = parseExcelFieldText(res.data); |
| | | } |
| | | }); |
| | | }, |
| | | beforeUpload(fileInfo) { |
| | | let res = checkFile(fileInfo, 1073741824, ['.xlsx', '.xls']); |
| | | if (!res.success) { |
| | | this.$message.warning(res.msg) |
| | | return false |
| | | } |
| | | setTimeout(() => {this.uploadFile.onSuccess(this.uploadFile.file)}, 1000) |
| | | }, |
| | | handleChange(fileInfo) { |
| | | if (fileInfo.file.status === 'error') { |
| | | fileInfo.fileList.splice(0, 1) |
| | | } |
| | | if (fileInfo.file.status === 'done') { |
| | | if (fileInfo.fileList.length > 1) { |
| | | fileInfo.fileList.splice(0, 1) |
| | | } |
| | | this.fileList = fileInfo.file |
| | | } |
| | | }, |
| | | handleSubmit() { |
| | | this.confirmLoading = true |
| | | const formData = new FormData() |
| | | formData.append('file', this.uploadFile.file) |
| | | WmsSubstituteGoodImportExcel(formData, {importExcelType: this.importExcelType}).then(res => { |
| | | this.$message.success('æä½æå') |
| | | this.confirmLoading = false |
| | | this.$emit('ok', []) |
| | | this.handleCancel() |
| | | }).finally((res)=>{this.confirmLoading = false}) |
| | | }, |
| | | handleCancel() { |
| | | this.visible = false |
| | | this.detailed = false |
| | | }, |
| | | wmsSubstituteGoodDownloadExcelTemplate() { |
| | | WmsSubstituteGoodDownloadExcelTemplate({version: "v2"}).then((res) => { |
| | | downloadFile(res); |
| | | }).catch((err) => { |
| | | this.$message.error('ä¸è½½é误ï¼è·åæä»¶æµé误' + err) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | ::v-deep .ant-upload.ant-upload-drag { |
| | | position: relative; |
| | | width: 140px; |
| | | height: 135px; |
| | | text-align: center; |
| | | background: #fafafa; |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 2px; |
| | | cursor: pointer; |
| | | -webkit-transition: border-color 0.3s; |
| | | transition: border-color 0.3s; |
| | | } |
| | | ::v-deep .ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger), .ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger) { |
| | | color: #ffc53d; |
| | | border-color: white; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div ref="boxOutWrap" class="boxOutWrap"> |
| | | <div ref="boxForm" class="boxForm"> |
| | | <a-card :bordered="false" :bodyStyle="tstyle"> |
| | | |
| | | <div class="table-page-search-wrapper" v-if="hasPerm('WmsSubstituteGood:page')"> |
| | | <a-form layout="inline"> |
| | | <a-row :gutter="48"> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ¿ä»£ç¼å·"> |
| | | <a-input v-model="queryParam.substituteCode" allow-clear placeholder="请è¾å
¥æ¿ä»£ç¼å·" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ç©æç¼å·"> |
| | | <a-input v-model="queryParam.materialCode" allow-clear placeholder="请è¾å
¥ç©æç¼å·" /> |
| | | </a-form-item> |
| | | </a-col><template v-if="advanced"> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ç©æåç§°"> |
| | | <a-input v-model="queryParam.materialName" allow-clear placeholder="请è¾å
¥ç©æåç§°" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ¿ä»£åç©æç¼å·"> |
| | | <a-input v-model="queryParam.substituteMaterialCode" allow-clear |
| | | placeholder="请è¾å
¥æ¿ä»£åç©æç¼å·" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ¿ä»£åç©æåç§°"> |
| | | <a-input v-model="queryParam.substituteMaterialName" allow-clear |
| | | placeholder="请è¾å
¥æ¿ä»£åç©æåç§°" /> |
| | | </a-form-item> |
| | | </a-col><a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ¿ä»£æ¬¡åº"> |
| | | <a-input-number v-model="queryParam.substituteIndex" style="width: 100%" allow-clear |
| | | placeholder="请è¾å
¥æ¿ä»£æ¬¡åº" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ¯å¦ç¦ç¨"> |
| | | <a-select :allowClear="true" style="width: 100%" v-model="queryParam.isDisabled" |
| | | placeholder="è¯·éæ©æ¯å¦ç¦ç¨"> |
| | | <a-select-option v-for="(item, index) in isDisabledData" :key="index" |
| | | :value="item.code">{{ item.name }}</a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | <!--å¹´ææ¥æ¶åç§--> |
| | | <!--æ¶é´èå´--> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="å建æ¶é´"> |
| | | <a-range-picker style="width: 100%" :placeholder="['å¼å§æ¶é´', 'ç»ææ¶é´']" :show-time="{ |
| | | format: 'HH:mm:ss', defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')] |
| | | }" |
| | | v-model="queryParam.createdTime" value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm:ss" @change="onChangecreatedTime" /> |
| | | |
| | | </a-form-item> |
| | | </a-col> |
| | | <!--å¹´ææ¥æ¶åç§--> |
| | | <!--æ¶é´èå´--> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ´æ°æ¶é´"> |
| | | <a-range-picker style="width: 100%" :placeholder="['å¼å§æ¶é´', 'ç»ææ¶é´']" :show-time="{ |
| | | format: 'HH:mm:ss', defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')] |
| | | }" |
| | | v-model="queryParam.updatedTime" value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm:ss" @change="onChangeupdatedTime" /> |
| | | |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="å建è
åç§°"> |
| | | <a-input v-model="queryParam.createdUserName" allow-clear placeholder="请è¾å
¥å建è
åç§°" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ä¿®æ¹è
åç§°"> |
| | | <a-input v-model="queryParam.updatedUserName" allow-clear placeholder="请è¾å
¥ä¿®æ¹è
åç§°" /> |
| | | </a-form-item> |
| | | </a-col> </template> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <span class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="$refs.table.refresh(true)">æ¥è¯¢</a-button> |
| | | <a-button style="margin-left: 8px" @click="() => queryParam = {}">éç½®</a-button> |
| | | <a @click="toggleAdvanced" style="margin-left: 8px"> {{ advanced ? 'æ¶èµ·' : 'å±å¼' }} |
| | | <a-icon :type="advanced ? 'up' : 'down'" /> |
| | | </a> |
| | | </span> |
| | | </a-col> |
| | | |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | </a-card> |
| | | </div> |
| | | <a-card :bordered="false"> |
| | | <s-table ref="table" :columns="columns" :data="loadData" :alert="true" @changeTablePage="pageInfo = $event" |
| | | :scroll="{ x: true, y: tableHeight }" :rowKey="(record) => record.id" |
| | | :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"> |
| | | <!-- <template class="table-operator" slot="operator" v-if="hasPerm('WmsSubstituteGood:add')"> |
| | | <div ref="actionBar" class="actionBar"> |
| | | <a-button type="info" v-if="hasPerm('sysExcelTemplate:importExcel')" icon="upload" |
| | | @click="$refs.excelForm.index()"> |
| | | 导å
¥ |
| | | </a-button> |
| | | <a-button type="info" v-if="hasPerm('WmsSubstituteGood:exportExcel')" icon="download" |
| | | @click="WmsSubstituteGoodToExcel()"> |
| | | å¯¼åº |
| | | </a-button> |
| | | <a-button type="primary" v-if="hasPerm('WmsSubstituteGood:add')" icon="plus" |
| | | @click="$refs.addForm.add()">æ°å¢æ¿ä»£å管ç</a-button> |
| | | </div> |
| | | </template> --> |
| | | <span slot="isDisabledscopedSlots" slot-scope="text"> |
| | | <div v-if="text === true"> |
| | | <a-tag color="green">æ¯</a-tag> |
| | | </div> |
| | | <div v-else-if="text == false"> |
| | | <a-tag color="volcano">å¦</a-tag> |
| | | </div> |
| | | <div v-else=""></div> |
| | | </span> |
| | | <span slot="action" slot-scope="text, record"> |
| | | |
| | | <a v-if="hasPerm('WmsSubstituteGood:edit')" @click="$refs.editForm.edit(record)">ç¼è¾</a> |
| | | <a-divider type="vertical" |
| | | v-if="hasPerm('WmsSubstituteGood:edit') & hasPerm('WmsSubstituteGood:delete')" /> |
| | | <a-popconfirm v-if="hasPerm('WmsSubstituteGood:delete')" placement="topRight" title="确认å é¤ï¼" |
| | | @confirm="() => WmsSubstituteGoodDelete(record)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | </s-table> |
| | | <add-form ref="addForm" @ok="handleOk" /> |
| | | <edit-form ref="editForm" @ok="handleOk" /> |
| | | <excel-form ref="excelForm" @ok="handleOk" /> |
| | | </a-card> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { STable } from '@/components' |
| | | import moment from 'moment' |
| | | import { WmsSubstituteGoodPage, WmsSubstituteGoodDelete, WmsSubstituteGoodToExcel } from '@/api/modular/main/WmsBase/WmsSubstituteGoodManage' |
| | | //èªå®ä¹tableé«åº¦ |
| | | import setTableHtMixin from '@/mixins/handleTableHt.js' |
| | | import addForm from './addForm.vue' |
| | | import { exportExcel } from '@/utils/exportToExcel' |
| | | import { downloadFile } from '@/utils/util' |
| | | import editForm from './editForm.vue' |
| | | import excelForm from './excelForm.vue' |
| | | export default { |
| | | mixins: [setTableHtMixin], |
| | | components: { |
| | | STable, |
| | | addForm, |
| | | editForm, |
| | | excelForm |
| | | }, |
| | | data() { |
| | | return { |
| | | advanced: false, // é«çº§æç´¢ å±å¼/å
³é |
| | | queryParam: {}, |
| | | pageInfo: { |
| | | current: 1, |
| | | pageSize: 10 |
| | | }, |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | width: '60px', |
| | | align: 'center', |
| | | customRender: (text, record, index) => `${index + 1 + (this.pageInfo.current - 1) * this.pageInfo.pageSize}` |
| | | }, |
| | | { |
| | | title: 'æ¿ä»£ç¼å·', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'substituteCode' |
| | | }, |
| | | { |
| | | title: 'ç©æç¼å·', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'materialCode' |
| | | }, |
| | | { |
| | | title: 'ç©æåç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'materialName' |
| | | }, |
| | | { |
| | | title: 'æ¿ä»£åç©æç¼å·', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '140px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '140px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'substituteMaterialCode' |
| | | }, |
| | | { |
| | | title: 'æ¿ä»£åç©æåç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '140px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '140px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'substituteMaterialName' |
| | | }, |
| | | { |
| | | title: 'æ¿ä»£æ¬¡åº', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'substituteIndex' |
| | | }, |
| | | { |
| | | title: 'æ¯å¦ç¦ç¨', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'isDisabled', |
| | | scopedSlots: { customRender: 'isDisabledscopedSlots' } |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'createdTime' |
| | | }, |
| | | { |
| | | title: 'æ´æ°æ¶é´', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'updatedTime' |
| | | }, |
| | | { |
| | | title: 'å建è
åç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'createdUserName' |
| | | }, |
| | | { |
| | | title: 'ä¿®æ¹è
åç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'updatedUserName' |
| | | } |
| | | ], |
| | | tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, |
| | | // å è½½æ°æ®æ¹æ³ å¿
须为 Promise 对象 |
| | | loadData: parameter => { |
| | | return WmsSubstituteGoodPage(Object.assign(parameter, this.switchingDate())).then((res) => { |
| | | return res.data |
| | | }) |
| | | }, |
| | | selectedRowKeys: [], |
| | | selectedRows: [] |
| | | } |
| | | }, |
| | | created() { |
| | | if (this.hasPerm('WmsSubstituteGood:edit') || this.hasPerm('WmsSubstituteGood:delete')) { |
| | | this.columns.push({ |
| | | title: 'æä½', |
| | | width: '150px', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' } |
| | | }) |
| | | } |
| | | const path = this.$route.path |
| | | const columnStr = window.localStorage.getItem(path) |
| | | if (columnStr) { |
| | | var _columns = JSON.parse(columnStr) |
| | | this.columns.forEach(element => { |
| | | var fObj = _columns.find((item, index) => { |
| | | return item.dataIndex === element.dataIndex; |
| | | }) |
| | | if (fObj != undefined && fObj != null) { |
| | | element.checked = fObj.checked; |
| | | } |
| | | }); |
| | | } |
| | | const isDisabledOption = this.$options |
| | | this.isDisabledData = isDisabledOption.filters['dictData']('yes_true_false') |
| | | |
| | | this.handleTableHt() //è®¾ç½®ä¸»è¡¨è¡¨æ ¼é«åº¦ |
| | | window.addEventListener( |
| | | 'resize', |
| | | () => { |
| | | this.handleTableHt() // çå¬å±å¹å¤§å°æ¹åè¡¨æ ¼é«åº¦ |
| | | }, |
| | | false |
| | | ) |
| | | |
| | | }, |
| | | methods: { |
| | | moment, |
| | | /** |
| | | * æ¥è¯¢åæ°ç»è£
|
| | | */ |
| | | switchingDate() { |
| | | const obj = JSON.parse(JSON.stringify(this.queryParam)) |
| | | return obj |
| | | }, |
| | | WmsSubstituteGoodDelete(record) { |
| | | WmsSubstituteGoodDelete(record).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success('å 餿å') |
| | | this.$refs.table.refresh() |
| | | } else { |
| | | this.$message.error('å é¤å¤±è´¥') // + res.message |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | WmsSubstituteGoodToExcel() { |
| | | this.loading = true |
| | | let entozh = {}; |
| | | const path = this.$route.path; |
| | | if (window.localStorage.getItem(path)) { |
| | | JSON.parse(window.localStorage.getItem(path)).forEach(item => { |
| | | if (item.dataIndex != 'action' && item.checked) { |
| | | entozh[item.dataIndex] = item.title |
| | | } |
| | | }) |
| | | } else { //ç´æ¥ç¹å¯¼åº |
| | | this.columns.forEach(item => { |
| | | if (item.dataIndex != 'action') { |
| | | entozh[item.dataIndex] = item.title |
| | | } |
| | | }) |
| | | } |
| | | WmsSubstituteGoodPage(Object.assign({ pageSize: 100000, pageIndex: 1 }, this.queryParam)).then((res) => { |
| | | this.loading = false; |
| | | //éè¦æªåæ¥æçåæ®µ |
| | | var arrDataCutout = this.columns.filter(v => v.customCutout == true); |
| | | res.data.rows.forEach(item => { |
| | | var arrKeys = Object.keys(item); |
| | | arrKeys.forEach(key => { |
| | | var strFieldDic = key + 'Data'; |
| | | //æä¸¾è½¬å¼ |
| | | if (this[strFieldDic] && this[strFieldDic].length > 0) { |
| | | let arrFieldDic = this[strFieldDic].filter(v => String(v.code) == String(item[key])); |
| | | if (arrFieldDic.length > 0) { |
| | | item[key] = arrFieldDic[0]?.name || '没ææä¸¾å¼'; |
| | | } |
| | | } |
| | | // æ¥ææªå |
| | | if (arrDataCutout.length > 0) { |
| | | arrDataCutout.forEach(itemIn => { |
| | | if (key == itemIn.dataIndex && item[key]) { |
| | | item[key] = item[key].split(" ")[0] |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | }) |
| | | exportExcel(res.data.rows, entozh, "xlsx", `${this.$route.meta.title}`) |
| | | }).catch((err) => { |
| | | this.loading = false |
| | | this.$message.error('ä¸è½½é误ï¼è·åæä»¶æµé误' + err) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | toggleAdvanced() { |
| | | this.advanced = !this.advanced |
| | | this.handleTableHt() //è®¾ç½®ä¸»è¡¨è¡¨æ ¼é«åº¦ |
| | | }, |
| | | onChangecreatedTime(date, dateString) { |
| | | this.queryParam.createdTime = dateString |
| | | }, |
| | | onChangeupdatedTime(date, dateString) { |
| | | this.queryParam.updatedTime = dateString |
| | | }, |
| | | handleOk() { |
| | | this.$refs.table.refresh() |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectedRows) { |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.selectedRows = selectedRows |
| | | this.$emit('ok', selectedRows) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="less">.table-operator { |
| | | margin-bottom: 18px; |
| | | } |
| | | |
| | | button { |
| | | margin-right: 8px; |
| | | }</style> |
ÎļþÃû´Ó iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/addFormBaseCustomer.vue ÐÞ¸Ä |
| | |
| | | <template> |
| | | <!-- æ°å¢å®¢æ·æ¡£æ¡ --> |
| | | <a-form :form="form"> |
| | | <a-modal |
| | | title="æ°å¢å®¢æ·æ¡£æ¡" |
| | | :width="900" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | @ok="handleSubmit" |
| | | @cancel="handleCancel"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-form-item label="客æ·ç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥å®¢æ·ç¼å·" v-decorator="['custCode', {rules: [{required: true, message: '请è¾å
¥å®¢æ·ç¼å·ï¼'}]}]" /> |
| | | </a-form-item> |
| | |
| | | <a-switch v-decorator="['isDisabled', { valuePropName: 'checked' }]" /> |
| | | </a-form-item> |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div style="background-color: white"> |
| | | <!-- <a-spin :spinning="loading"> --> |
| | | <div class="wms-task-management-detail-div"> |
| | | <div class="drawer-content"> |
| | | <!-- <span style="font-weight:bold;cursor:default;"> |
| | | <a style="cursor:default;">{{ row.no }}</a>åæ®è¯¦æ
|
| | | </span> --> |
| | | <div style="margin-top: 10px;"> |
| | | <a-table :columns="columns" :data-source="list" row-key="id" :pagination="false" :scroll="{ x: true }"> |
| | | <template slot="index" slot-scope="text, record, index">{{ index + 1 }}</template> |
| | | <span slot="containerStatusscopedSlots" slot-scope="text"> |
| | | <a-tag :color="text == '1' ? '#daa520' : text == '2' ? '#cd5c5c' : text == '3' ? '#add8e6' : '#696969'">{{ |
| | | 'orderdetails_statusenum' | dictType(text) |
| | | }}</a-tag> |
| | | </span> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a-popconfirm v-if="hasPerm('BaseCustomer:delete')" placement="topRight" title="确认å é¤ï¼" |
| | | @confirm="() => itemDelete(record, index)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | </div> |
| | | |
| | | <p @click="visible = true">æ°å¢è¡</p> |
| | | |
| | | <a-modal title="客æ·å表" :width="900" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit" |
| | | @cancel="handleCancel"> |
| | | <show-list ref="showList" @ok="handleOk" /> |
| | | <!-- <a-spin :spinning="confirmLoading"></a-spin> --> |
| | | </a-modal> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { WmsOrderRukuDetail } from '@/api/modular/main/WmsOrderManage' |
| | | import showList from './index.vue' |
| | | |
| | | export default { |
| | | name: 'wmsOrderRukuManagementDetailDrawer', |
| | | emits: ['update:visible'], |
| | | props: { |
| | | visible: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | row: { |
| | | type: Object, |
| | | default: function () { |
| | | return {} |
| | | } |
| | | } |
| | | }, |
| | | components: { |
| | | showList |
| | | }, |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | containerStatusData: [], |
| | | list: [], |
| | | columns: [ |
| | | { |
| | | dataIndex: 'index', |
| | | title: 'åºå·', |
| | | fixed: 'left', |
| | | width: '60', |
| | | scopedSlots: { customRender: 'index' }, |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '客æ·ç¼å·', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'custCode' |
| | | }, |
| | | { |
| | | title: '客æ·ä¸æåç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px' //æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'custChinaName' |
| | | } |
| | | ], |
| | | // å页 |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30', '40'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + 'å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0, |
| | | size: 'small' |
| | | } |
| | | } |
| | | }, |
| | | |
| | | created() { |
| | | const containerStatusOption = this.$options |
| | | this.containerStatusData = containerStatusOption.filters['dictData']('orderdetails_statusenum') |
| | | |
| | | this.columns.push({ |
| | | title: 'æä½', |
| | | width: '150px', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' } |
| | | }) |
| | | }, |
| | | methods: { |
| | | onClose() { |
| | | this.close() |
| | | }, |
| | | close() { |
| | | this.$emit('update:visible', false) |
| | | }, |
| | | afterVisibleChange(visible) { |
| | | if (visible) { |
| | | this.initShow() |
| | | } else { |
| | | this.afterClsoe() |
| | | } |
| | | }, |
| | | initShow() { |
| | | this.loading = true |
| | | this.getList(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | getList(row) { |
| | | let params = { id: row.id } |
| | | WmsOrderRukuDetail(params) |
| | | .then(d => { |
| | | this.list = d.data.rows || [] |
| | | this.$emit('update:visible', true) |
| | | // callback && callback(true) |
| | | }) |
| | | .catch(() => { |
| | | this.$emit('update:visible', false) |
| | | this.list = [] |
| | | // callback && callback(false) |
| | | }) |
| | | }, |
| | | afterClsoe() { |
| | | this.list = [] |
| | | }, |
| | | handleOk(param) { |
| | | this.list = param |
| | | }, |
| | | handleSubmit() { |
| | | this.visible = false |
| | | }, |
| | | handleCancel() { |
| | | this.visible = false |
| | | }, |
| | | itemDelete(record, index) { |
| | | this.list.splice(index, 1) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .wms-task-management-detail-div { |
| | | height: 100%; |
| | | overflow: auto; |
| | | |
| | | .drawer-content { |
| | | padding: 16px; |
| | | } |
| | | } |
| | | </style> |
copy from iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/addFormBaseCustomer.vue
copy to iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/addFormBaseCustomer/editForm.vue
Îļþ´Ó iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/addFormBaseCustomer.vue ¸´ÖÆ |
| | |
| | | <template> |
| | | <!-- æ°å¢å®¢æ·æ¡£æ¡ --> |
| | | <a-form :form="form"> |
| | | <a-modal |
| | | title="ç¼è¾å®¢æ·æ¡£æ¡" |
| | | :width="900" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | @ok="handleSubmit" |
| | | @cancel="handleCancel"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-form-item label="客æ·ç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-input placeholder="请è¾å
¥å®¢æ·ç¼å·" v-decorator="['custCode', {rules: [{required: true, message: '请è¾å
¥å®¢æ·ç¼å·ï¼'}]}]" /> |
| | | </a-form-item> |
| | |
| | | <a-form-item label="æ¯å¦ç¦ç¨" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> |
| | | <a-switch v-decorator="['isDisabled', { valuePropName: 'checked' }]" /> |
| | | </a-form-item> |
| | | <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item> |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment' |
| | | import moment from 'moment' |
| | | import { |
| | | BaseCustomerAdd |
| | | BaseCustomerEdit |
| | | } from '@/api/modular/main/WmsBase/BaseCustomerManage' |
| | | export default { |
| | | data () { |
| | | return { |
| | | Id: 0, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | |
| | | xs: { span: 24 }, |
| | | sm: { span: 15 } |
| | | }, |
| | | record: {}, |
| | | visible: false, |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this) |
| | |
| | | methods: { |
| | | moment, |
| | | // åå§åæ¹æ³ |
| | | add (record) { |
| | | this.visible = true |
| | | edit (record) { |
| | | this.visible = true; |
| | | this.Id = record.id; |
| | | this.$nextTick(() => { |
| | | |
| | | }); |
| | | //深度æ·è´ ç§»é¤VUEççå¬ï¼é²æ¢INDEX页é¢å¼åå¨ |
| | | this.record = JSON.parse(JSON.stringify(record)) |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue( |
| | | { |
| | | id: record.id, |
| | | custCode: record.custCode, |
| | | custChinaName: record.custChinaName, |
| | | custEnglishName: record.custEnglishName, |
| | | mnemonicCode: record.mnemonicCode, |
| | | custType: record.custType, |
| | | custTypeName: record.custTypeName, |
| | | linkMan: record.linkMan, |
| | | phone: record.phone, |
| | | email: record.email, |
| | | zipCode: record.zipCode, |
| | | province: record.province, |
| | | city: record.city, |
| | | address: record.address, |
| | | isDisabled: record.isDisabled |
| | | } |
| | | ) |
| | | }) |
| | | }, |
| | | /** |
| | | * æäº¤è¡¨å |
| | | */ |
| | | handleSubmit () { |
| | | const { form: { validateFields } } = this |
| | | this.confirmLoading = true |
| | | validateFields((errors, values) => { |
| | | if (!errors) { |
| | | for (const key in values) { |
| | | if (values[key] == null) continue |
| | | if (typeof (values[key]) === 'object') { |
| | | values[key] = JSON.stringify(values[key]) |
| | | this.record[key] = values[key] |
| | | } else { |
| | | this.record[key] = values[key] |
| | | } |
| | | } |
| | | BaseCustomerAdd(values).then((res) => { |
| | | BaseCustomerEdit(this.record).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success('æ°å¢æå') |
| | | this.$message.success('ç¼è¾æå') |
| | | this.confirmLoading = false |
| | | this.$emit('ok', values) |
| | | this.$emit('ok', this.record) |
| | | this.handleCancel() |
| | | } else { |
| | | this.$message.error('æ°å¢å¤±è´¥ï¼' + JSON.stringify(res.message)) |
| | | this.$message.error('ç¼è¾å¤±è´¥ï¼' + JSON.stringify(res.message)) |
| | | } |
| | | }).finally((res) => { |
| | | this.confirmLoading = false |
| | | }) |
| | | } else { |
| | | }else{ |
| | | this.confirmLoading = false |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | }, |
| | | handleCancel () { |
| | | this.form.resetFields() |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :width="850" |
| | | :destroyOnClose="true" |
| | | :visible="visible" |
| | | :forceRender="true" |
| | | title="æ¹é导å
¥" |
| | | cancelText="åæ¶ä¸ä¼ " |
| | | okText="å¼å§ä¸ä¼ " |
| | | @cancel="handleCancel" |
| | | @ok="handleSubmit"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-row :span="24"> |
| | | <span>è¯·éæ©è¦å¯¼å
¥çæ°æ®æä»¶ï¼Excelæ ¼å¼ï¼</span> |
| | | </a-row> |
| | | <p></p> |
| | | <a-row> |
| | | <a-col :span="16"> |
| | | <a-upload-dragger accept=".xlsx,.xls" :multiple="false" :customRequest="customRequest" @change="handleChange" :beforeUpload="beforeUpload"> |
| | | <a-icon style="font-size: 40px;" type="cloud-upload" /> |
| | | </a-upload-dragger> |
| | | </a-col> |
| | | <!--<a-col :span="8"> |
| | | <span>导å
¥æ¨¡å¼ï¼</span> |
| | | <a-select |
| | | style="width: 130px" |
| | | placeholder="è¯·éæ©å¯¼å
¥æ¨¡å¼" |
| | | v-model="importExcelType"> |
| | | <a-select-option |
| | | v-for="(item,index) in importExcelTypeData" |
| | | :key="index" |
| | | :value="item.code">{{ item.name }} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-col>--> |
| | | </a-row> |
| | | <a-row :span="24"> |
| | | <!--<a-button @click="showDemand" style="width: 150px;text-align: left;" type="link" v-show="!detailed"> |
| | | ç¹å»æ¥çæä»¶ä¸ä¼ è¦æ± |
| | | </a-button>--> |
| | | <span>ã</span> |
| | | <a-button style="width: 90px;text-align: left;" @click="baseCustomerDownloadExcelTemplate" type="link">ä¸è½½å¯¼å
¥æ¨¡æ¿</a-button>ï¼å¡«åå¹¶ä¸ä¼ |
| | | <span>ã</span> |
| | | <a-button @click="showDemand" style="width: 150px;text-align: left;" type="link" v-show="detailed"> |
| | | æ¶èµ· |
| | | </a-button> |
| | | </a-row> |
| | | <a-row v-show="detailed" style="background: #fef4e8; height: 30px;" :span="24"> |
| | | <a-breadcrumb> |
| | | <a-breadcrumb-item style="line-height: 30px;color: #faad14;margin-left: 18px;">æä»¶ä¸ä¼ è¦æ±</a-breadcrumb-item> |
| | | </a-breadcrumb> |
| | | </a-row> |
| | | <pre v-show="detailed"> |
| | | <div v-html="demandText"></div> |
| | | </pre> |
| | | <a-table v-show="detailed" :columns="columns" :data-source="dataList" :rowKey="(record) => record.processID" :pagination="false"></a-table> |
| | | <pre v-show="detailed"> |
| | | <div v-html="columnText"></div> |
| | | </pre> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { downloadFile, checkFile, parseExcelFieldText, parseDemandText } from '@/utils/util' |
| | | |
| | | import { BaseCustomerImportExcel, BaseCustomerDownloadExcelTemplate} from '@/api/modular/main/WmsBase/BaseCustomerManage' |
| | | import { sysExcelTemplateGetColumnList } from '@/api/modular/system/excelTemplateManage' |
| | | export default { |
| | | components: { |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | detailed: false, |
| | | confirmLoading: false, |
| | | fileList: [], |
| | | importExcelTypeData: [], |
| | | importExcelType: '1', |
| | | uploadFile: null, |
| | | columns: [], |
| | | dataList: [], |
| | | demandText:'', |
| | | columnText: '' |
| | | } |
| | | }, |
| | | methods: { |
| | | index() { |
| | | this.visible = true; |
| | | this.importExcelTypeData = this.$options.filters['dictData']('import_excel_type') |
| | | this.demandText = parseDemandText("baseCustomerDownloadExcelTemplate") |
| | | window.downloadFile = this.baseCustomerDownloadExcelTemplate; |
| | | this.getTable(); |
| | | }, |
| | | showDemand() { |
| | | this.detailed = !this.detailed; |
| | | }, |
| | | customRequest(document) { |
| | | this.uploadFile = document |
| | | }, |
| | | getTable() { |
| | | sysExcelTemplateGetColumnList({className: "BaseCustomer"}).then(res => |
| | | { |
| | | if (res.success) { |
| | | this.columns =[]; |
| | | this.dataList = [{}]; |
| | | res.data.forEach(x => { |
| | | this.columns.push({ |
| | | dataIndex: x.columnName, |
| | | key: x.columnName, |
| | | title: x.columnComment |
| | | }); |
| | | this.dataList[0][x.columnName] = x.isRequired ? "å¿
å¡«" : "éå¿
å¡«" |
| | | }); |
| | | this.columnText = parseExcelFieldText(res.data); |
| | | } |
| | | }); |
| | | }, |
| | | beforeUpload(fileInfo) { |
| | | let res = checkFile(fileInfo, 1073741824, ['.xlsx', '.xls']); |
| | | if (!res.success) { |
| | | this.$message.warning(res.msg) |
| | | return false |
| | | } |
| | | setTimeout(() => {this.uploadFile.onSuccess(this.uploadFile.file)}, 1000) |
| | | }, |
| | | handleChange(fileInfo) { |
| | | if (fileInfo.file.status === 'error') { |
| | | fileInfo.fileList.splice(0, 1) |
| | | } |
| | | if (fileInfo.file.status === 'done') { |
| | | if (fileInfo.fileList.length > 1) { |
| | | fileInfo.fileList.splice(0, 1) |
| | | } |
| | | this.fileList = fileInfo.file |
| | | } |
| | | }, |
| | | handleSubmit() { |
| | | this.confirmLoading = true |
| | | const formData = new FormData() |
| | | formData.append('file', this.uploadFile.file) |
| | | BaseCustomerImportExcel(formData, {importExcelType: this.importExcelType}).then(res => { |
| | | this.$message.success('æä½æå') |
| | | this.confirmLoading = false |
| | | this.$emit('ok', []) |
| | | this.handleCancel() |
| | | }).finally((res)=>{this.confirmLoading = false}) |
| | | }, |
| | | handleCancel() { |
| | | this.visible = false |
| | | this.detailed = false |
| | | }, |
| | | baseCustomerDownloadExcelTemplate() { |
| | | BaseCustomerDownloadExcelTemplate({version: "v2"}).then((res) => { |
| | | downloadFile(res); |
| | | }).catch((err) => { |
| | | this.$message.error('ä¸è½½é误ï¼è·åæä»¶æµé误' + err) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | ::v-deep .ant-upload.ant-upload-drag { |
| | | position: relative; |
| | | width: 140px; |
| | | height: 135px; |
| | | text-align: center; |
| | | background: #fafafa; |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 2px; |
| | | cursor: pointer; |
| | | -webkit-transition: border-color 0.3s; |
| | | transition: border-color 0.3s; |
| | | } |
| | | ::v-deep .ant-btn:focus:not(.ant-btn-primary):not(.ant-btn-danger), .ant-btn:hover:not(.ant-btn-primary):not(.ant-btn-danger) { |
| | | color: #ffc53d; |
| | | border-color: white; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div ref="boxOutWrap" class="boxOutWrap"> |
| | | <div ref="boxForm" class="boxForm"> |
| | | <a-card :bordered="false" :bodyStyle="tstyle"> |
| | | |
| | | <div class="table-page-search-wrapper" v-if="hasPerm('BaseCustomer:page')"> |
| | | <a-form layout="inline"> |
| | | <a-row :gutter="48"> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="客æ·ç¼å·"> |
| | | <a-input v-model="queryParam.custCode" allow-clear placeholder="请è¾å
¥å®¢æ·ç¼å·" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="客æ·ä¸æåç§°"> |
| | | <a-input v-model="queryParam.custChinaName" allow-clear placeholder="请è¾å
¥å®¢æ·ä¸æåç§°" /> |
| | | </a-form-item> |
| | | </a-col><template v-if="advanced"> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="客æ·è±æåç§°"> |
| | | <a-input v-model="queryParam.custEnglishName" allow-clear placeholder="请è¾å
¥å®¢æ·è±æåç§°" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="å©è®°ç "> |
| | | <a-input v-model="queryParam.mnemonicCode" allow-clear placeholder="请è¾å
¥å©è®°ç " /> |
| | | </a-form-item> |
| | | </a-col><a-col :md="8" :sm="24"> |
| | | <a-form-item label="ç±»å"> |
| | | <a-input-number v-model="queryParam.custType" style="width: 100%" allow-clear |
| | | placeholder="请è¾å
¥ç±»å" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ç±»ååç§°"> |
| | | <a-input v-model="queryParam.custTypeName" allow-clear placeholder="请è¾å
¥ç±»ååç§°" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="è系人"> |
| | | <a-input v-model="queryParam.linkMan" allow-clear placeholder="请è¾å
¥è系人" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="çµè¯"> |
| | | <a-input v-model="queryParam.phone" allow-clear placeholder="请è¾å
¥çµè¯" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="çµåé®ä»¶"> |
| | | <a-input v-model="queryParam.email" allow-clear placeholder="请è¾å
¥çµåé®ä»¶" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="é®ç¼"> |
| | | <a-input v-model="queryParam.zipCode" allow-clear placeholder="请è¾å
¥é®ç¼" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ç份"> |
| | | <a-input v-model="queryParam.province" allow-clear placeholder="请è¾å
¥ç份" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="åå¸"> |
| | | <a-input v-model="queryParam.city" allow-clear placeholder="请è¾å
¥åå¸" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="å°å"> |
| | | <a-input v-model="queryParam.address" allow-clear placeholder="请è¾å
¥å°å" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ¯å¦ç¦ç¨"> |
| | | <a-select :allowClear="true" style="width: 100%" v-model="queryParam.isDisabled" |
| | | placeholder="è¯·éæ©æ¯å¦ç¦ç¨"> |
| | | <a-select-option v-for="(item, index) in isDisabledData" :key="index" |
| | | :value="item.code">{{ item.name }}</a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | <!--å¹´ææ¥æ¶åç§--> |
| | | <!--æ¶é´èå´--> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="å建æ¶é´"> |
| | | <a-range-picker style="width: 100%" :placeholder="['å¼å§æ¶é´', 'ç»ææ¶é´']" :show-time="{ |
| | | format: 'HH:mm:ss', defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')] |
| | | }" |
| | | v-model="queryParam.createdTime" value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm:ss" @change="onChangecreatedTime" /> |
| | | |
| | | </a-form-item> |
| | | </a-col> |
| | | <!--å¹´ææ¥æ¶åç§--> |
| | | <!--æ¶é´èå´--> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="æ´æ°æ¶é´"> |
| | | <a-range-picker style="width: 100%" :placeholder="['å¼å§æ¶é´', 'ç»ææ¶é´']" :show-time="{ |
| | | format: 'HH:mm:ss', defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')] |
| | | }" |
| | | v-model="queryParam.updatedTime" value-format="YYYY-MM-DD HH:mm:ss" |
| | | format="YYYY-MM-DD HH:mm:ss" @change="onChangeupdatedTime" /> |
| | | |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="å建è
åç§°"> |
| | | <a-input v-model="queryParam.createdUserName" allow-clear placeholder="请è¾å
¥å建è
åç§°" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="8" :sm="24"> |
| | | <a-form-item label="ä¿®æ¹è
åç§°"> |
| | | <a-input v-model="queryParam.updatedUserName" allow-clear placeholder="请è¾å
¥ä¿®æ¹è
åç§°" /> |
| | | </a-form-item> |
| | | </a-col> </template> |
| | | |
| | | <a-col :md="8" :sm="24"> |
| | | <span class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="$refs.table.refresh(true)">æ¥è¯¢</a-button> |
| | | <a-button style="margin-left: 8px" @click="() => queryParam = {}">éç½®</a-button> |
| | | <a @click="toggleAdvanced" style="margin-left: 8px"> {{ advanced ? 'æ¶èµ·' : 'å±å¼' }} |
| | | <a-icon :type="advanced ? 'up' : 'down'" /> |
| | | </a> |
| | | </span> |
| | | </a-col> |
| | | |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | </a-card> |
| | | </div> |
| | | <a-card :bordered="false"> |
| | | <s-table ref="table" :columns="columns" :data="loadData" :alert="true" @changeTablePage="pageInfo = $event" |
| | | :scroll="{ x: true, y: tableHeight }" :rowKey="(record) => record.id" |
| | | :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"> |
| | | <template class="table-operator" slot="operator" v-if="hasPerm('BaseCustomer:add')"> |
| | | <!-- <div ref="actionBar" class="actionBar"> |
| | | <a-button type="info" v-if="hasPerm('sysExcelTemplate:importExcel')" icon="upload" @click="$refs.excelForm.index()"> |
| | | 导å
¥ |
| | | </a-button> |
| | | <a-button type="info" v-if="hasPerm('BaseCustomer:exportExcel')" icon="download" @click="BaseCustomerToExcel()"> |
| | | å¯¼åº |
| | | </a-button> |
| | | <a-button type="primary" v-if="hasPerm('BaseCustomer:add')" icon="plus" @click="$refs.addForm.add()">æ°å¢å®¢æ·æ¡£æ¡</a-button> |
| | | </div> --> |
| | | </template> |
| | | <span slot="isDisabledscopedSlots" slot-scope="text"> |
| | | <div v-if="text === true"> |
| | | <a-tag color="green">æ¯</a-tag> |
| | | </div> |
| | | <div v-else-if="text == false"> |
| | | <a-tag color="volcano">å¦</a-tag> |
| | | </div> |
| | | <div v-else=""></div> |
| | | </span> |
| | | <span slot="action" slot-scope="text, record"> |
| | | |
| | | <a v-if="hasPerm('BaseCustomer:edit')" @click="$refs.editForm.edit(record)">ç¼è¾</a> |
| | | <a-divider type="vertical" v-if="hasPerm('BaseCustomer:edit') & hasPerm('BaseCustomer:delete')" /> |
| | | <a-popconfirm v-if="hasPerm('BaseCustomer:delete')" placement="topRight" title="确认å é¤ï¼" |
| | | @confirm="() => BaseCustomerDelete(record)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | </s-table> |
| | | <add-form ref="addForm" @ok="handleOk" /> |
| | | <edit-form ref="editForm" @ok="handleOk" /> |
| | | <excel-form ref="excelForm" @ok="handleOk" /> |
| | | </a-card> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { STable } from '@/components' |
| | | import moment from 'moment' |
| | | import { BaseCustomerPage, BaseCustomerDelete, BaseCustomerToExcel } from '@/api/modular/main/WmsBase/BaseCustomerManage' |
| | | //èªå®ä¹tableé«åº¦ |
| | | import setTableHtMixin from '@/mixins/handleTableHt.js' |
| | | import addForm from './addForm.vue' |
| | | import { exportExcel } from '@/utils/exportToExcel' |
| | | import { downloadFile } from '@/utils/util' |
| | | import editForm from './editForm.vue' |
| | | import excelForm from './excelForm.vue' |
| | | export default { |
| | | mixins: [setTableHtMixin], |
| | | components: { |
| | | STable, |
| | | addForm, |
| | | editForm, |
| | | excelForm |
| | | }, |
| | | data() { |
| | | return { |
| | | advanced: false, // é«çº§æç´¢ å±å¼/å
³é |
| | | queryParam: {}, |
| | | pageInfo: { |
| | | current: 1, |
| | | pageSize: 10 |
| | | }, |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | width: '60px', |
| | | align: 'center', |
| | | customRender: (text, record, index) => `${index + 1 + (this.pageInfo.current - 1) * this.pageInfo.pageSize}` |
| | | }, |
| | | { |
| | | title: '客æ·ç¼å·', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'custCode' |
| | | }, |
| | | { |
| | | title: '客æ·ä¸æåç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'custChinaName' |
| | | }, |
| | | { |
| | | title: '客æ·è±æåç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'custEnglishName' |
| | | }, |
| | | { |
| | | title: 'å©è®°ç ', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'mnemonicCode' |
| | | }, |
| | | { |
| | | title: 'ç±»å', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '80px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '80px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'custType' |
| | | }, |
| | | { |
| | | title: 'ç±»ååç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'custTypeName' |
| | | }, |
| | | { |
| | | title: 'è系人', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'linkMan' |
| | | }, |
| | | { |
| | | title: 'çµè¯', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'phone' |
| | | }, |
| | | { |
| | | title: 'çµåé®ä»¶', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'email' |
| | | }, |
| | | { |
| | | title: 'é®ç¼', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'zipCode' |
| | | }, |
| | | { |
| | | title: 'ç份', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'province' |
| | | }, |
| | | { |
| | | title: 'åå¸', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'city' |
| | | }, |
| | | { |
| | | title: 'å°å', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'address' |
| | | }, |
| | | { |
| | | title: 'æ¯å¦ç¦ç¨', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'isDisabled', |
| | | scopedSlots: { customRender: 'isDisabledscopedSlots' } |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'createdTime' |
| | | }, |
| | | { |
| | | title: 'æ´æ°æ¶é´', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'updatedTime' |
| | | }, |
| | | { |
| | | title: 'å建è
åç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'createdUserName' |
| | | }, |
| | | { |
| | | title: 'ä¿®æ¹è
åç§°', |
| | | align: 'center', |
| | | customHeaderCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | customCell: () => { |
| | | return { |
| | | style: { |
| | | 'min-width': '120px'//æå°å宽设置 |
| | | } |
| | | } |
| | | }, |
| | | sorter: true, |
| | | dataIndex: 'updatedUserName' |
| | | } |
| | | ], |
| | | tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' }, |
| | | // å è½½æ°æ®æ¹æ³ å¿
须为 Promise 对象 |
| | | loadData: parameter => { |
| | | return BaseCustomerPage(Object.assign(parameter, this.switchingDate())).then((res) => { |
| | | return res.data |
| | | }) |
| | | }, |
| | | selectedRowKeys: [], |
| | | selectedRows: [] |
| | | } |
| | | }, |
| | | created() { |
| | | if (this.hasPerm('BaseCustomer:edit') || this.hasPerm('BaseCustomer:delete')) { |
| | | this.columns.push({ |
| | | title: 'æä½', |
| | | width: '150px', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' } |
| | | }) |
| | | } |
| | | const path = this.$route.path |
| | | const columnStr = window.localStorage.getItem(path) |
| | | if (columnStr) { |
| | | var _columns = JSON.parse(columnStr) |
| | | this.columns.forEach(element => { |
| | | var fObj = _columns.find((item, index) => { |
| | | return item.dataIndex === element.dataIndex; |
| | | }) |
| | | if (fObj != undefined && fObj != null) { |
| | | element.checked = fObj.checked; |
| | | } |
| | | }); |
| | | } |
| | | const isDisabledOption = this.$options |
| | | this.isDisabledData = isDisabledOption.filters['dictData']('yes_true_false') |
| | | |
| | | this.handleTableHt() //è®¾ç½®ä¸»è¡¨è¡¨æ ¼é«åº¦ |
| | | window.addEventListener( |
| | | 'resize', |
| | | () => { |
| | | this.handleTableHt() // çå¬å±å¹å¤§å°æ¹åè¡¨æ ¼é«åº¦ |
| | | }, |
| | | false |
| | | ) |
| | | |
| | | }, |
| | | methods: { |
| | | moment, |
| | | /** |
| | | * æ¥è¯¢åæ°ç»è£
|
| | | */ |
| | | switchingDate() { |
| | | const obj = JSON.parse(JSON.stringify(this.queryParam)) |
| | | return obj |
| | | }, |
| | | BaseCustomerDelete(record) { |
| | | BaseCustomerDelete(record).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success('å 餿å') |
| | | this.$refs.table.refresh() |
| | | } else { |
| | | this.$message.error('å é¤å¤±è´¥') // + res.message |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | BaseCustomerToExcel() { |
| | | this.loading = true |
| | | let entozh = {}; |
| | | const path = this.$route.path; |
| | | if (window.localStorage.getItem(path)) { |
| | | JSON.parse(window.localStorage.getItem(path)).forEach(item => { |
| | | if (item.dataIndex != 'action' && item.checked) { |
| | | entozh[item.dataIndex] = item.title |
| | | } |
| | | }) |
| | | } else { //ç´æ¥ç¹å¯¼åº |
| | | this.columns.forEach(item => { |
| | | if (item.dataIndex != 'action') { |
| | | entozh[item.dataIndex] = item.title |
| | | } |
| | | }) |
| | | } |
| | | BaseCustomerPage(Object.assign({ pageSize: 100000, pageIndex: 1 }, this.queryParam)).then((res) => { |
| | | this.loading = false; |
| | | //éè¦æªåæ¥æçåæ®µ |
| | | var arrDataCutout = this.columns.filter(v => v.customCutout == true); |
| | | res.data.rows.forEach(item => { |
| | | var arrKeys = Object.keys(item); |
| | | arrKeys.forEach(key => { |
| | | var strFieldDic = key + 'Data'; |
| | | //æä¸¾è½¬å¼ |
| | | if (this[strFieldDic] && this[strFieldDic].length > 0) { |
| | | let arrFieldDic = this[strFieldDic].filter(v => String(v.code) == String(item[key])); |
| | | if (arrFieldDic.length > 0) { |
| | | item[key] = arrFieldDic[0]?.name || '没ææä¸¾å¼'; |
| | | } |
| | | } |
| | | // æ¥ææªå |
| | | if (arrDataCutout.length > 0) { |
| | | arrDataCutout.forEach(itemIn => { |
| | | if (key == itemIn.dataIndex && item[key]) { |
| | | item[key] = item[key].split(" ")[0] |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | }) |
| | | exportExcel(res.data.rows, entozh, "xlsx", `${this.$route.meta.title}`) |
| | | }).catch((err) => { |
| | | this.loading = false |
| | | this.$message.error('ä¸è½½é误ï¼è·åæä»¶æµé误' + err) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | toggleAdvanced() { |
| | | this.advanced = !this.advanced |
| | | this.handleTableHt() //è®¾ç½®ä¸»è¡¨è¡¨æ ¼é«åº¦ |
| | | }, |
| | | onChangecreatedTime(date, dateString) { |
| | | this.queryParam.createdTime = dateString |
| | | }, |
| | | onChangeupdatedTime(date, dateString) { |
| | | this.queryParam.updatedTime = dateString |
| | | }, |
| | | handleOk() { |
| | | this.$refs.table.refresh() |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectedRows) { |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.selectedRows = selectedRows |
| | | this.$emit('ok', selectedRows) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="less"> |
| | | .table-operator { |
| | | margin-bottom: 18px; |
| | | } |
| | | |
| | | button { |
| | | margin-right: 8px; |
| | | }</style> |
| | |
| | | /// <summary> |
| | | /// 容å¨ç±»åID |
| | | /// </summary> |
| | | public virtual long? ContainerTypeId { get; set; } |
| | | [Required(ErrorMessage = "容å¨ç±»åIDä¸è½ä¸ºç©º")] |
| | | public virtual long ContainerTypeId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 容å¨ç±»ååç§° |
| | | /// </summary> |
| | | [Required(ErrorMessage = "容å¨ç±»ååç§°ä¸è½ä¸ºç©º")] |
| | | public virtual string ContainerTypeName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç±»åID |
| | | /// </summary> |
| | | public virtual long? MaterialTypeId { get; set; } |
| | | [Required(ErrorMessage = "ç©æç±»åIDä¸è½ä¸ºç©º")] |
| | | public virtual long MaterialTypeId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç±»åç¼å· |
| | | /// </summary> |
| | | [Required(ErrorMessage = "ç©æç±»åç¼å·ä¸è½ä¸ºç©º")] |
| | | public virtual string MaterialTypeCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç±»ååç§° |
| | | /// </summary> |
| | | [Required(ErrorMessage = "ç©æç±»ååç§°ä¸è½ä¸ºç©º")] |
| | | public virtual string MaterialTypeName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æå®¹å¨å®¹é |
| | | /// </summary> |
| | | public virtual decimal? BoxQty { get; set; } |
| | | [Required(ErrorMessage = "ç©æå®¹å¨å®¹éä¸è½ä¸ºç©º")] |
| | | public virtual decimal BoxQty { get; set; } |
| | | |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// 容å¨ç±»åID |
| | | /// </summary> |
| | | public long? ContainerTypeId { get; set; } |
| | | public long ContainerTypeId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 容å¨ç±»ååç§° |
| | |
| | | /// <summary> |
| | | /// ç©æç±»åID |
| | | /// </summary> |
| | | public long? MaterialTypeId { get; set; } |
| | | public long MaterialTypeId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç±»åç¼å· |
| | |
| | | /// <summary> |
| | | /// ç©æå®¹å¨å®¹é |
| | | /// </summary> |
| | | public decimal? BoxQty { get; set; } |
| | | public decimal BoxQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Idä¸»é® |
| | |
| | | |
| | | |
| | | #region éªè¯ |
| | | |
| | | if (string.IsNullOrEmpty(_ContainerTypeId)) |
| | | { |
| | | throw Oops.Oh($"第{index}è¡[容å¨ç±»åID]{_ContainerTypeId}ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | |
| | | if(!string.IsNullOrEmpty(_ContainerTypeId)) |
| | | { |
| | | if (!long.TryParse(_ContainerTypeId, out long outContainerTypeId)&&!string.IsNullOrEmpty(_ContainerTypeId)) |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(_ContainerTypeName)) |
| | | { |
| | | throw Oops.Oh($"第{index}è¡[容å¨ç±»ååç§°]{_ContainerTypeName}ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | |
| | | if(!string.IsNullOrEmpty(_ContainerTypeName)) |
| | | { |
| | | addItem.ContainerTypeName = (string)_ContainerTypeName; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(_MaterialTypeId)) |
| | | { |
| | | throw Oops.Oh($"第{index}è¡[ç©æç±»åID]{_MaterialTypeId}ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | |
| | | if(!string.IsNullOrEmpty(_MaterialTypeId)) |
| | | { |
| | | if (!long.TryParse(_MaterialTypeId, out long outMaterialTypeId)&&!string.IsNullOrEmpty(_MaterialTypeId)) |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(_MaterialTypeCode)) |
| | | { |
| | | throw Oops.Oh($"第{index}è¡[ç©æç±»åç¼å·]{_MaterialTypeCode}ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | |
| | | if(!string.IsNullOrEmpty(_MaterialTypeCode)) |
| | | { |
| | | addItem.MaterialTypeCode = (string)_MaterialTypeCode; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(_MaterialTypeName)) |
| | | { |
| | | throw Oops.Oh($"第{index}è¡[ç©æç±»ååç§°]{_MaterialTypeName}ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | |
| | | if(!string.IsNullOrEmpty(_MaterialTypeName)) |
| | | { |
| | | addItem.MaterialTypeName = (string)_MaterialTypeName; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(_BoxQty)) |
| | | { |
| | | throw Oops.Oh($"第{index}è¡[ç©æå®¹å¨å®¹é]{_BoxQty}ä¸è½ä¸ºç©ºï¼"); |
| | | } |
| | | |
| | | if(!string.IsNullOrEmpty(_BoxQty)) |
| | | { |
| | | if (!decimal.TryParse(_BoxQty, out decimal outBoxQty)&&!string.IsNullOrEmpty(_BoxQty)) |
| | |
| | | |
| | | |
| | | |
| | | bool isExist = false; |
| | | if (!isEdit)//æ°å¢ |
| | | { |
| | | //æ°æ®æ¯å¦åå¨éå¤ |
| | | isExist = await _wmsContainerPackagingRep.AnyAsync(u => |
| | | u.ContainerTypeId.Equals(input.ContainerTypeId) |
| | | ,false); |
| | | } |
| | | else//ç¼è¾ |
| | | { |
| | | |
| | | |
| | | |
| | | //å½åç¼è¾æ°æ®ä»¥å¤æ¯å¦åå¨éå¤ |
| | | isExist = await _wmsContainerPackagingRep.AnyAsync(u => |
| | | u.Id != input.Id |
| | | &&u.ContainerTypeId.Equals(input.ContainerTypeId) |
| | | ,false); |
| | | } |
| | | |
| | | |
| | | |
| | | //没æé
ç½®èå主é®ï¼ä¸éè¦éªé |
| | | if (isExist) throw Oops.Oh(ErrorCode.E0001); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | private async Task CheckExisitForImport(List<WmsContainerPackaging> inputs) |
| | | { |
| | | //æ ¹æ®èå主é®éªè¯è¡¨æ ¼ä¸ä¸æ¯å¦å·²åå¨ç¸åæ°æ® |
| | | if (inputs?.Count <= 0) |
| | | { |
| | | throw Oops.Oh($"导å
¥æ°æ®ä¸è½ä¸ºç©º"); |
| | | } |
| | | //æ°æ®æ¯å¦éå¤ |
| | | var existExcelItem = inputs.GroupBy(g => new { |
| | | g.ContainerTypeId |
| | | }) |
| | | .Where(g => g.Count() > 1) |
| | | .Select(s => new { |
| | | s.Key.ContainerTypeId |
| | | }).FirstOrDefault(); |
| | | if (existExcelItem != null) |
| | | { |
| | | var wmsContainerPackaging = existExcelItem.Adapt<WmsContainerPackaging>(); |
| | | var item= existExcelItem.Adapt<WmsContainerPackaging>(); |
| | | throw Oops.Oh($"导å
¥çè¡¨æ ¼ä¸,容å¨ç±»åID[{item.ContainerTypeId}]å·²åå¨"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //æ ¹æ®èå主é®éªè¯æ°æ®åºä¸æ¯å¦å·²åå¨ç¸åæ°æ® |
| | | var existDBItem = await _wmsContainerPackagingRep.DetachedEntities.FirstOrDefaultAsync(w=> |
| | | inputs.Select(s=>"" |
| | | +s.ContainerTypeId |
| | | ) |
| | | .Contains("" |
| | | +w.ContainerTypeId |
| | | )); |
| | | if (existDBItem != null) |
| | | { |
| | | var wmsContainerPackaging = existExcelItem.Adapt<WmsContainerPackaging>(); |
| | | var item= existExcelItem.Adapt<WmsContainerPackaging>(); |
| | | throw Oops.Oh($"ç³»ç»ä¸,容å¨ç±»åID[{item.ContainerTypeId}]å·²åå¨"); |
| | | } |
| | | } |
| | | |
| | | #endregion |