|  | @@ -11,25 +11,24 @@
 | 
	
		
			
				|  |  |          <div>
 | 
	
		
			
				|  |  |            <a-card >
 | 
	
		
			
				|  |  |              <div class="table-page-search-wrapper">
 | 
	
		
			
				|  |  | -                <a-form :model="queryParams" :label-col="labelCol" :wrapper-col="wrapperCol">
 | 
	
		
			
				|  |  | +                <a-form :model="queryParams" :label-col="labelCol" :wrapper-col="wrapperCol" ref="formDataRef">
 | 
	
		
			
				|  |  |                  <a-row :gutter="24">
 | 
	
		
			
				|  |  |                      <a-col :xl="24" :lg="24" :md="24">
 | 
	
		
			
				|  |  | -                        <a-form-item label="产品(name)">
 | 
	
		
			
				|  |  | -                          <ApiSelect
 | 
	
		
			
				|  |  | -                                    :api="productListList"
 | 
	
		
			
				|  |  | -                                    showSearch
 | 
	
		
			
				|  |  | -                                    v-model:value="queryParams.name"
 | 
	
		
			
				|  |  | -                                    optionFilterProp="label"
 | 
	
		
			
				|  |  | -                                    resultField="records"
 | 
	
		
			
				|  |  | -                                    labelField="chineseName"
 | 
	
		
			
				|  |  | -                                    valueField="code"
 | 
	
		
			
				|  |  | -                                    />
 | 
	
		
			
				|  |  | +                        <a-form-item label="产品(product name)" name="productId"> 
 | 
	
		
			
				|  |  | +                          <a-select v-model:value="queryParams.productId" style="width: 100%;" @change="changeProduct" allowClear>
 | 
	
		
			
				|  |  | +                            <a-select-option v-for="item in productOption" :key="item.id" :value="item.id">{{ item.label }}</a-select-option>
 | 
	
		
			
				|  |  | +                          </a-select>
 | 
	
		
			
				|  |  |                          </a-form-item>
 | 
	
		
			
				|  |  |                      </a-col>
 | 
	
		
			
				|  |  |                      <a-col :xl="24" :lg="24" :md="24">
 | 
	
		
			
				|  |  | -                        <a-form-item label="附件(attachs)">
 | 
	
		
			
				|  |  | -							<JUpload v-model:value="queryParams.attachs"></JUpload>
 | 
	
		
			
				|  |  | -						</a-form-item>
 | 
	
		
			
				|  |  | +                        <a-form-item label="名称(name)" name="name"> 
 | 
	
		
			
				|  |  | +                          <a-input v-model:value="queryParams.name" AutoComplete='off'></a-input>
 | 
	
		
			
				|  |  | +                        </a-form-item>
 | 
	
		
			
				|  |  | +                    </a-col>
 | 
	
		
			
				|  |  | +                    <a-col :xl="24" :lg="24" :md="24">
 | 
	
		
			
				|  |  | +                        <a-form-item label="附件(attachs)" name="attachs">
 | 
	
		
			
				|  |  | +                          <JUpload v-model:value="queryParams.attachs"></JUpload>
 | 
	
		
			
				|  |  | +                        </a-form-item>
 | 
	
		
			
				|  |  |                      </a-col>
 | 
	
		
			
				|  |  |                  </a-row>
 | 
	
		
			
				|  |  |              </a-form>
 | 
	
	
		
			
				|  | @@ -47,6 +46,7 @@
 | 
	
		
			
				|  |  |      const emit = defineEmits([ 'addList']); //定义emit
 | 
	
		
			
				|  |  |      var visible = ref(false)
 | 
	
		
			
				|  |  |      var title = ref('')
 | 
	
		
			
				|  |  | +    var formDataRef=ref();
 | 
	
		
			
				|  |  |      var executeMethod =ref('')
 | 
	
		
			
				|  |  |      const labelCol = reactive({
 | 
	
		
			
				|  |  |          xs:24,
 | 
	
	
		
			
				|  | @@ -56,19 +56,22 @@
 | 
	
		
			
				|  |  |          xs: 24,
 | 
	
		
			
				|  |  |          sm: 16,
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  | +    var productOption = ref([]);
 | 
	
		
			
				|  |  |      const FileUploadModalRef = ref();
 | 
	
		
			
				|  |  |      const queryParams = ref({
 | 
	
		
			
				|  |  |          name:'',
 | 
	
		
			
				|  |  |          attachs:'',
 | 
	
		
			
				|  |  |          headId:'',
 | 
	
		
			
				|  |  | -        type:''
 | 
	
		
			
				|  |  | +        type:'',
 | 
	
		
			
				|  |  | +        productId:"",
 | 
	
		
			
				|  |  | +        productName:''
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |      function handleOk(){
 | 
	
		
			
				|  |  |          let executeUrl = ''
 | 
	
		
			
				|  |  |          if(executeMethod.value=='add'){
 | 
	
		
			
				|  |  | -            executeUrl = '/saleCode/saleOrderFiles/add'
 | 
	
		
			
				|  |  | +            executeUrl = '/saleCode/saleDeliveryFiles/add'
 | 
	
		
			
				|  |  |          }else{
 | 
	
		
			
				|  |  | -            executeUrl = '/saleCode/saleOrderFiles/edit'
 | 
	
		
			
				|  |  | +            executeUrl = '/saleCode/saleDeliveryFiles/edit'
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          defHttp.post({ url: executeUrl, params: queryParams.value }, { isTransformResponse: false }).then((res) => {
 | 
	
		
			
				|  |  |            if (res.success) {
 | 
	
	
		
			
				|  | @@ -82,6 +85,7 @@
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      function handleCancel(){
 | 
	
		
			
				|  |  |        visible.value = false
 | 
	
		
			
				|  |  | +      formDataRef.value.resetFields()
 | 
	
		
			
				|  |  |        Modal.destroyAll();
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      function getTable(fatherId,fatherTitle,status,id){
 | 
	
	
		
			
				|  | @@ -93,9 +97,10 @@
 | 
	
		
			
				|  |  |          if(status=='edit'){
 | 
	
		
			
				|  |  |              getForm(id)
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        productListList()
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      function getForm(id){
 | 
	
		
			
				|  |  | -        defHttp.get({ url: '/saleCode/saleOrderFiles/queryById', params: {id:id} }, { isTransformResponse: false }).then((res) => {
 | 
	
		
			
				|  |  | +        defHttp.get({ url: '/saleCode/saleDeliveryFiles/queryById', params: {id:id} }, { isTransformResponse: false }).then((res) => {
 | 
	
		
			
				|  |  |            if (res.success) {
 | 
	
		
			
				|  |  |              queryParams.value = res.result
 | 
	
		
			
				|  |  |            } else {
 | 
	
	
		
			
				|  | @@ -104,8 +109,27 @@
 | 
	
		
			
				|  |  |          })
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      function productListList(){
 | 
	
		
			
				|  |  | -        let params = {pageSize:-1}
 | 
	
		
			
				|  |  | -        return defHttp.get({url:'/baseCode/baseProductArchive/list',params});
 | 
	
		
			
				|  |  | +        productOption.value = []
 | 
	
		
			
				|  |  | +        defHttp.get({ url: '/baseCode/baseProductArchive/list', params: {pageSize:-1} }, { isTransformResponse: false }).then((res) => {
 | 
	
		
			
				|  |  | +          if (res.success) {
 | 
	
		
			
				|  |  | +            res.result.records.map(item=>{
 | 
	
		
			
				|  |  | +              productOption.value.push({
 | 
	
		
			
				|  |  | +                id:item.id,
 | 
	
		
			
				|  |  | +                label:item.chineseName
 | 
	
		
			
				|  |  | +              })
 | 
	
		
			
				|  |  | +            })
 | 
	
		
			
				|  |  | +           
 | 
	
		
			
				|  |  | +          } else {
 | 
	
		
			
				|  |  | +            message.warning(res.message);
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    function changeProduct(date){
 | 
	
		
			
				|  |  | +      productOption.value.map(item=>{
 | 
	
		
			
				|  |  | +        if(item.id==date){
 | 
	
		
			
				|  |  | +          queryParams.value.productName = item.label
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      defineExpose({
 | 
	
		
			
				|  |  |        getTable
 |